Documentation
¶
Overview ¶
Package kit names a product built on lockkit. Every lockkit package that needs a name, an account, a directory or an environment variable takes a Product instead of a literal, so two products on one machine never share a socket, a config directory or a keychain service.
Index ¶
- func StateBase() (string, error)
- type Product
- func (p Product) Env(suffix string) string
- func (p Product) ProjectDir() string
- func (p Product) RuntimeDir() (string, error)
- func (p Product) RuntimeDirEnv() string
- func (p Product) SharedSocketDir() string
- func (p Product) StateDir() (string, error)
- func (p Product) SystemConfigPath() string
- func (p Product) UserConfigDir() (string, error)
- func (p Product) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Product ¶
type Product struct {
// Name is the binary name and the directory name under every config,
// state and runtime directory ("locksql").
Name string
// Tagline is the line under the name in the banner.
Tagline string
// Account is the dedicated console account ("locksql").
Account string
// ClientsGroup's members may reach the console ("locksql-clients").
ClientsGroup string
// KeychainService names every OS keychain item of the product.
KeychainService string
// EnvPrefix prefixes the product's environment variables ("LOCKSQL_").
EnvPrefix string
// Version is the product's version, without a leading v.
Version string
}
Product is the identity of a product: its names on the machine.
func (Product) Env ¶
Env is the name of the product's environment variable suffix ("RUNTIME_DIR" → "LOCKSQL_RUNTIME_DIR").
func (Product) ProjectDir ¶
ProjectDir is the project directory name: "." + Name.
func (Product) RuntimeDir ¶
RuntimeDir is the private directory of the user's console sockets: $<prefix>RUNTIME_DIR/Name when set, else $XDG_RUNTIME_DIR/Name (Linux) or $TMPDIR/Name (macOS), else /tmp/Name-<uid>.
func (Product) RuntimeDirEnv ¶
RuntimeDirEnv is the variable that overrides the runtime dir on every OS when set to an absolute path: the sockets then live in $<prefix>RUNTIME_DIR/Name.
func (Product) SharedSocketDir ¶
SharedSocketDir is the default socket directory of a separated setup.
func (Product) SystemConfigPath ¶
SystemConfigPath is the machine-wide setup file: /etc/Name/system.toml.
func (Product) UserConfigDir ¶
UserConfigDir is <user config dir>/Name.