Documentation ¶
Index ¶
- func FromBuffer(buf *bytes.Buffer, cfg *Config) error
- func FromFile(configFile string, cfg *Config) error
- type BadgerDb
- type C2S
- type ChannelBindingMechanism
- type Compression
- type CompressionLevel
- type Config
- type LogLevel
- type Logger
- type ModOffline
- type ModPing
- type ModRegistration
- type ModVersion
- type MySQLDb
- type ResourceConflictPolicy
- type Server
- type ServerType
- type Storage
- type StorageType
- type TLS
- type Transport
- type TransportType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromBuffer ¶
FromBuffer loads default global configuration from a specified byte buffer.
Types ¶
type BadgerDb ¶
type BadgerDb struct {
DataDir string `yaml:"data_dir"`
}
BadgerDB represents BadgerDB storage configuration.
type C2S ¶
type C2S struct {
Domains []string
}
C2S represents a client-to-server manager configuration.
func (*C2S) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface.
type ChannelBindingMechanism ¶
type ChannelBindingMechanism int
ChannelBindingMechanism represents a scram channel binding mechanism.
const ( // TLSUnique represents 'tls-unique' channel binding mechanism. TLSUnique ChannelBindingMechanism = iota )
type Compression ¶
type Compression struct {
Level CompressionLevel
}
Compression represents a server stream compression configuration.
func (*Compression) UnmarshalYAML ¶
func (c *Compression) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML satisfies Unmarshaler interface.
type CompressionLevel ¶
type CompressionLevel int
CompressionLevel represents a stream compression level.
const ( // NoCompression represents no stream compression. NoCompression CompressionLevel = iota // DefaultCompression represents 'default' stream compression level. DefaultCompression // BestCompression represents 'best for size' stream compression level. BestCompression // SpeedCompression represents 'best for speed' stream compression level. SpeedCompression )
func (CompressionLevel) String ¶
func (cl CompressionLevel) String() string
String returns CompressionLevel string representation.
type Config ¶
type Config struct { PIDFile string `yaml:"pid_path"` Debug struct { Port int `yaml:"port"` } `yaml:"debug"` Logger Logger `yaml:"logger"` Storage Storage `yaml:"storage"` C2S C2S `yaml:"c2s"` Servers []Server `yaml:"servers"` }
Config represents a global configuration.
type Logger ¶
Logger represents a logger manager configuration.
func (*Logger) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface.
type ModOffline ¶
type ModOffline struct {
QueueSize int `yaml:"queue_size"`
}
ModOffline represents Offline Storage module configuration.
type ModRegistration ¶
type ModRegistration struct { AllowRegistration bool `yaml:"allow_registration"` AllowChange bool `yaml:"allow_change"` AllowCancel bool `yaml:"allow_cancel"` }
ModRegistration represents XMPP In-Band Registration module (XEP-0077) configuration.
type ModVersion ¶
type ModVersion struct {
ShowOS bool `yaml:"show_os"`
}
ModVersion represents XMPP Software Version module (XEP-0092) configuration.
type MySQLDb ¶
type MySQLDb struct { Host string `yaml:"host"` User string `yaml:"user"` Password string `yaml:"password"` Database string `yaml:"database"` PoolSize int `yaml:"pool_size"` }
MySQLDb represents MySQL storage configuration.
type ResourceConflictPolicy ¶
type ResourceConflictPolicy int
ResourceConflictPolicy represents a resource conflict policy.
const ( // Override represents 'override' resource conflict policy. Override ResourceConflictPolicy = iota // Reject represents 'reject' resource conflict policy. Reject // Replace represents 'replace' resource conflict policy. Replace )
type Server ¶
type Server struct { ID string Type ServerType ResourceConflict ResourceConflictPolicy Transport Transport SASL []string TLS TLS Modules map[string]struct{} Compression Compression ModOffline ModOffline ModRegistration ModRegistration ModVersion ModVersion ModPing ModPing }
Server represents an XMPP server configuration.
func (*Server) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface.
type ServerType ¶
type ServerType int
ServerType represents a server type (c2s, s2s).
const ( // C2SServerType represents a client to client server type. C2SServerType ServerType = iota // S2SServerType represents a server-to-client server type. S2SServerType )
func (ServerType) String ¶
func (st ServerType) String() string
String returns ServerType string representation.
type Storage ¶
type Storage struct { Type StorageType MySQL *MySQLDb BadgerDB *BadgerDb }
Storage represents an storage manager configuration.
func (*Storage) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface.
type StorageType ¶
type StorageType int
StorageType represents a storage manager type.
const ( // MySQL represents a MySQL storage type. MySQL StorageType = iota // BadgerDB represents a BadgerDB storage type. BadgerDB // Mock represents a in-memory storage type. Mock )
type Transport ¶
type Transport struct { Type TransportType BindAddress string Port int ConnectTimeout int KeepAlive int BufferSize int }
Transport represents an XMPP stream transport configuration.
func (*Transport) UnmarshalYAML ¶
UnmarshalYAML satisfies Unmarshaler interface.
type TransportType ¶
type TransportType int
TransportType represents a stream transport type (socket).
const ( // Socket represents a socket transport. Socket TransportType = iota )
func (TransportType) String ¶
func (tt TransportType) String() string
String returns TransportType string representation.