From 43e230d4cd1c388b16e6bf4811f604a811fac535 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 6 Jun 2023 15:20:00 -0400 Subject: [PATCH] tsnet: document how to use Dir with multiple servers per process (#8286) Followup from a conversation on the Gophers slack, also matches the examples in the tsnet kb. Closes #8287 Signed-off-by: Xe Iaso --- tsnet/tsnet.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tsnet/tsnet.go b/tsnet/tsnet.go index 1b0ae7bb6..eec421bfc 100644 --- a/tsnet/tsnet.go +++ b/tsnet/tsnet.go @@ -66,6 +66,12 @@ type Server struct { // state. If empty, a directory is selected automatically // under os.UserConfigDir (https://golang.org/pkg/os/#UserConfigDir). // based on the name of the binary. + // + // If you want to use multiple tsnet services in the same + // binary, you will need to make sure that Dir is set uniquely + // for each service. A good pattern for this is to have a + // "base" directory (such as your mutable storage folder) and + // then append the hostname on the end of it. Dir string // Store specifies the state store to use.