Documentation ¶
Index ¶
- Variables
- func GBool(name, shorthand string, value bool, usage string) *bool
- func GInt(name, shorthand string, value int, usage string) *int
- func GString(name, shorthand string, value string, usage string) *string
- func Home() (home string)
- func IsTermDumb() bool
- func NatsDir(serverName string) string
- func TryLock() (err error)
- func Unlock()
- func Update(update func(*Config) error) error
- func WithLock(f func() error) error
- type Config
- type MachineID
- type Role
- type Subdir
Constants ¶
This section is empty.
Variables ¶
View Source
var BindAddr = GString("bind", "B", "0.0.0.0", "Bind address for public connections")
View Source
var DialerSubnet = GString("subnet-dialer", "", "127.2.0.0/16", "Dialer subnet")
View Source
var Dumb = GBool("dumb", "D", IsTermDumb(), "Disable interactive prompts and complex ui")
View Source
var EnvName = GString("env", "E", "", "Environment name, used for running multiple instances of pmesh")
View Source
var GetMachineID = sync.OnceValue(func() MachineID { hash := sha1.New() hn, _ := os.Hostname() hash.Write([]byte(hn + "---pmesh")) if hid, err := host.HostID(); err == nil && len(hid) > 0 { hash.Write([]byte(strings.ToLower(hid))) } s := hash.Sum(nil) s[0] |= 2 return MachineID(binary.LittleEndian.Uint32(s[:4])) })
View Source
var HttpPort = GInt("http", "H", 80, "Listen port for public HTTP")
View Source
var HttpsPort = GInt("https", "S", 443, "Listen port for public HTTPS")
View Source
var InternalPort = GInt("internal-port", "", 8443, "Internal port")
View Source
var LocalBindAddr = GString("local-bind", "L", "127.0.0.1", "Bind address for local connections")
View Source
var RootCommand = &cobra.Command{ Use: "pmesh", Short: "pme.sh is an all-in one service manager, reverse proxy, and enterprise service bus.", PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { if cmd.Flag("cwd").Changed { err = os.Chdir(cmd.Flag("cwd").Value.String()) } return }, }
Global from either environment or command line.
View Source
var ServiceSubnet = GString("subnet-service", "", "127.1.0.0/16", "Service subnet")
View Source
var Verbose = GBool("verbose", "V", false, "Enable verbose logging")
Global flags.
Functions ¶
Types ¶
type Config ¶
type Config struct { Role Role `json:"role"` // Role of this server Remote string `json:"remote"` // URL of the PNATS/NATS server if we're a regular client Host string `json:"host"` // Hostname of this server Cluster string `json:"cluster"` // Cluster name Secret string `json:"secret"` // Secret key used for all encryption Topology map[string][]string `json:"topology"` // Topology of the mesh [Hostname -> Cluster] Advertised string `json:"advertised"` // Advertised hostname of this server PeerUD map[string]any `json:"peerud"` // Arbitrary data to be sent to peers LocalUD map[string]any `json:"localud"` // Arbitrary data used for parsing yaml }
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
Click to show internal directories.
Click to hide internal directories.