Documentation
¶
Overview ¶
Package ether manages the bus (the ether): an embedded NATS server, or a connection to an external cluster. The interface is the same for both modes - neither thrall nor lord can tell the difference, because both speak only NATS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientOptions ¶
ClientOptions builds the nats options for a secured bus from credential paths: a CA the client verifies the server against and an nkey seed it authenticates with. An empty path adds no option, so an empty pair connects unsecured. Shared by the lord (via Config) and the operator CLI, so every client constructs the same options in one place.
Types ¶
type Auth ¶
type Auth struct {
NkeySeed string `toml:"nkey_seed"`
}
Auth configures client authentication to an external bus. NkeySeed is the path to an nkey seed file the client signs the server nonce with. Empty = no auth.
type Config ¶
type Config struct {
Mode string `toml:"mode"` // "embedded" | "external"
URL string `toml:"url"` // for external: "nats://a:4222,nats://b:4222"
// StoreDir is the JetStream storage directory for the embedded server. Empty
// (the default) uses an ephemeral temp dir removed on Stop; a fixed path keeps
// the durable mailbox across a lord/process restart. Ignored in external mode.
StoreDir string `toml:"store_dir"`
TLS TLS `toml:"tls"` // client-side transport security (external mode)
Auth Auth `toml:"auth"` // client authentication (external mode)
}
Config corresponds to the nats section in the manifest.
type Ether ¶
type Ether struct {
// contains filtered or unexported fields
}
Ether holds the running bus and the system connection for the lord and registry.