Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.2.0
type Account struct { // Users that belong to the account. Users []*ConfigUser `json:"users,omitempty"` // Exports are the exports from this account. Exports []*Export `json:"exports,omitempty"` // Imports are the imports from this account. Imports []*Import `json:"imports,omitempty"` }
Account with users.
type AuthConfig ¶
type AuthConfig struct { // Users that belong to the global account. Users []*ConfigUser `json:"users"` // Accounts that separate the subject namespaces. Accounts map[string]*Account `json:"accounts,omitempty"` }
AuthConfig represents the complete authorization config for the NATS Server.
func (*AuthConfig) AsJSON ¶
func (ac *AuthConfig) AsJSON() ([]byte, error)
AsJSON returns the JSON representation of the AuthConfig.
type ConfigUser ¶
type ConfigUser struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Nkey string `json:"nkey,omitempty"` Permissions *Permissions `json:"permissions,omitempty"` }
ConfigUser is a user as it will be represented in the configuration of the NATS Server.
type Export ¶ added in v0.3.0
type Export struct { Stream string `json:"stream,omitempty"` Service string `json:"service,omitempty"` Accounts []string `json:"accounts,omitempty"` Response string `json:"response,omitempty"` }
Export
type GenericImport ¶ added in v0.3.0
type GenericImport struct { Account string `json:"account,omitempty"` Subject string `json:"subject,omitempty"` }
GenericImport
type Import ¶ added in v0.3.0
type Import struct { Service *GenericImport `json:"service,omitempty"` Stream *GenericImport `json:"stream,omitempty"` StreamPrefix string `json:"prefix,omitempty"` ServiceTo string `json:"to,omitempty"` }
Import
type PermissionRules ¶
type PermissionRules struct { Allow []string `json:"allow,omitempty"` Deny []string `json:"deny,omitempty"` }
PermissionRules represents the allow/deny rules for publish/subscribe.
type Permissions ¶
type Permissions struct { // Publish are the publish permissions. Publish *PermissionRules `json:"publish,omitempty"` // Subscribe are the subscriber permissions. Subscribe *PermissionRules `json:"subscribe,omitempty"` }
Permissions are the publish/subscribe rules.
func (*Permissions) AsJSON ¶
func (p *Permissions) AsJSON() ([]byte, error)
AsJSON returns a byte slice of the type.
type User ¶
type User struct { // Username Username string `json:"username,omitempty"` // Password Password string `json:"password,omitempty"` // Nkey Nkey string `json:"nkey,omitempty"` // FIXME: Change into role and consolidate into a single type? // it would have to be filtered out on export though since // cannot have an extra field that is not recognized by the // server. Permissions string `json:"permissions,omitempty"` // Account is the account on which this user exists, // by default being the global account. Account string `json:"account,omitempty"` }
User represents the payload that a client can make.
Click to show internal directories.
Click to hide internal directories.