Versions in this module Expand all Collapse all v0 v0.3.0 Nov 27, 2026 Changes in this version + const MaxControlLine + var ErrRole = fmt.Errorf("no such role") + var Roles = []Role + func ApplyRoles(opts *natsserver.Options, serverAuth config.NATSServerAuth, namespace string, ...) error + func AuditStream(namespace string, auditCfg config.NATSAudit) jetstream.StreamConfig + func AuthOptions(auth config.NATSAuth) natsclient.AuthOptions + func Close(nc natsCloser) + func ConnectionOptions(conn config.NATSConnection, name string) (*natsclient.Options, error) + func Dial(log *slog.Logger, opts *natsclient.Options) (*natsclient.Client, error) + func EnrollmentKV(namespace string, enrollmentCfg config.NATSEnrollment) jetstream.KeyValueConfig + func FactsKV(namespace string, factsCfg config.NATSFacts) jetstream.KeyValueConfig + func FileStateKV(namespace string, fileStateCfg config.NATSFileState) jetstream.KeyValueConfig + func JetStreamKey(cfg config.NATSServerJetStream) (string, error) + func JobKV(namespace string, kvCfg config.NATSKV) jetstream.KeyValueConfig + func ObjectStore(namespace string, objectsCfg config.NATSObjects) jetstream.ObjectStoreConfig + func Prepare(ctx context.Context, log *slog.Logger, opts *natsclient.Options, ...) error + func RegistryKV(namespace string, registryCfg config.NATSRegistry) jetstream.KeyValueConfig + func SecretsKV(namespace string, secretsCfg config.NATSSecrets) jetstream.KeyValueConfig + func ServerClientAuth(serverAuth config.NATSServerAuth) natsclient.AuthOptions + func ServerOptions(host string, port int, storeDir string, serverAuth config.NATSServerAuth, ...) (*natsserver.Options, error) + func Setup(ctx context.Context, nc JetStream, namespace string, cfg config.NATS) error + func StateKV(namespace string, stateCfg config.NATSState) jetstream.KeyValueConfig + func StorageType(s string) jetstream.StorageType + func Telemetry(opts *natsclient.Options, mp *sdkmetric.MeterProvider) *natsclient.Options + type JetStream interface + KVCreateOrUpdate func(ctx context.Context, config jetstream.KeyValueConfig) error + ObjectStoreCreateOrUpdate func(ctx context.Context, config jetstream.ObjectStoreConfig) error + StreamCreateOrUpdate func(ctx context.Context, config jetstream.StreamConfig) error + type Permissions struct + Publish []string + Responses bool + Subscribe []string + func RolePermissions(role Role, namespace string, cfg config.NATS) (Permissions, error) + type Role string + const RoleAgent + const RoleController + const RoleJoin + const RoleSetup