Documentation ¶
Index ¶
- func GetNatsServerInfos() (*api.ServerInformationResponse, error)
- func NewCreds(jwt string, nkey string) string
- type Authorization
- type Config
- func (c *Config) AddNGSRemote(credentials string, accountPublicKey string, denyImports []string, ...) error
- func (c *Config) AddRemote(url string, credentials string, accountPublicKey string, denyImports []string, ...) error
- func (c *Config) RemoveRemoteByAccountPubKey(accountPublicKey string) error
- func (c *Config) RemoveRemoteByCredsfile(path string) error
- func (c *Config) ToJSON() (string, error)
- type Jetstream
- type Leafnodes
- type Option
- func WithAdminUser(user string, password string) Option
- func WithCacheResolver(operatorJWT string, sysAccountPubKey string, sysAccountJWT string, ...) Option
- func WithFullResolver(operatorJWT string, sysAccountPubKey string, sysAccountJWT string, ...) Option
- func WithJetstream(storageDir string, domain string) Option
- func WithNGSRemote(credentials string, accountPublicKey string, denyImports []string, ...) Option
- func WithPidFile(pidFile string) Option
- func WithRemote(url string, credentials string, accountPublicKey string, denyImports []string, ...) Option
- type Remotes
- type Resolver
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNatsServerInfos ¶ added in v0.5.2
func GetNatsServerInfos() (*api.ServerInformationResponse, error)
GetNatsServerInfos returns the nats server information
Types ¶
type Authorization ¶
type Authorization struct {
Users []User `json:"users,omitempty"`
}
Authorization is the authorization configuration
type Config ¶
type Config struct { Jetstream *Jetstream `json:"jetstream,omitempty"` Authorization *Authorization `json:"authorization,omitempty"` PidFile *string `json:"pid_file,omitempty"` HTTP int `json:"http"` Leafnodes *Leafnodes `json:"leafnodes,omitempty"` Operator *string `json:"operator,omitempty"` SystemAccount *string `json:"system_account,omitempty"` Resolver *Resolver `json:"resolver,omitempty"` ResolverPreload interface{} `json:"resolver_preload,omitempty"` }
Config is the configuration for the NATS server
func LoadFromFile ¶
LoadFromFile loads a config ftom a JSON file
func LoadFromJSON ¶
LoadFromJSON loads a config from a JSON string
func (*Config) AddNGSRemote ¶
func (c *Config) AddNGSRemote(credentials string, accountPublicKey string, denyImports []string, denyExports []string) error
AddNGSRemote adds a NGS remote to the config
func (*Config) AddRemote ¶
func (c *Config) AddRemote(url string, credentials string, accountPublicKey string, denyImports []string, denyExports []string) error
AddRemote adds a remote to the configs
func (*Config) RemoveRemoteByAccountPubKey ¶
RemoveRemoteByAccountPubKey removes a remote by account public key
func (*Config) RemoveRemoteByCredsfile ¶
RemoveRemoteByCredsfile removes a remote by credentials files path
type Leafnodes ¶
type Leafnodes struct {
Remotes []Remotes `json:"remotes"`
}
Leafnodes is the leafnode configuration part
type Option ¶
type Option func(*Config)
Option is a type that represents a Config option
func WithAdminUser ¶
WithAdminUser sets an admin user
func WithCacheResolver ¶
func WithCacheResolver(operatorJWT string, sysAccountPubKey string, sysAccountJWT string, jwtStoragePath string) Option
WithCacheResolver sets a cached resolver (used for leaf nats servers)
func WithFullResolver ¶
func WithFullResolver(operatorJWT string, sysAccountPubKey string, sysAccountJWT string, jwtStoragePath string) Option
WithFullResolver sets a full resolver (used for nats account servers)
func WithJetstream ¶ added in v0.5.2
WithJetstream enabled jetstream and sets the store dir and an domain
type Remotes ¶
type Remotes struct { // URL is the remote url, e.g. tls://connect.ngs.global:7422 or nats://localhost:4222 URL string `json:"url"` // Path to creds file Credentials string `json:"credentials"` // Account public key Account string `json:"account"` // DenyImports is a list of subjects to deny imports for DenyImports []string `json:"deny_imports,omitempty"` // DenyExports is a list of subjects to deny exports for DenyExports []string `json:"deny_exports,omitempty"` }
Remotes is the remote configuration part