Documentation ¶
Index ¶
- Constants
- Variables
- func BrokerName() string
- func GetHostname() string
- func Host() string
- func NewConfigurationError(errStr string) error
- func NewConfigurationErrorf(format string, args ...interface{}) error
- func ToSnakeCase(str string) string
- type ApiConfig
- type AuthenticationConfig
- type AuthorizationConfig
- type BrokerConfig
- type ClientConfig
- type Config
- type GrpcConfig
- type JWTAuthenticationConfig
- type LogConfig
- type LogLevelType
- type QueueConfig
- type ResourceConfig
- type RestConfig
- type RestCorsConfig
- type RoutingConfig
- type SecurityConfig
- type SecurityModeType
- type ServerState
- type StoreConfig
Constants ¶
View Source
const ( LogLevelTypeTrace = "trace" LogLevelTypeDebug = "debug" LogLevelTypeInfo = "info" LogLevelTypeWarn = "warn" LogLevelTypeError = "error" LogLevelTypeFatal = "fatal" )
Variables ¶
View Source
var Version string
Functions ¶
func BrokerName ¶
func BrokerName() string
func GetHostname ¶
func GetHostname() string
func NewConfigurationError ¶
func NewConfigurationErrorf ¶
func ToSnakeCase ¶
Types ¶
type AuthenticationConfig ¶
type AuthenticationConfig struct { Enable bool `json:"enable"` JwtConfig *JWTAuthenticationConfig `json:"jwtConfig"` Type string `json:"type"` Config string `json:"config"` }
func (*AuthenticationConfig) Validate ¶
func (c *AuthenticationConfig) Validate() error
type AuthorizationConfig ¶
type AuthorizationConfig struct { Enable bool `json:"enable"` PolicyData string `json:"policyData"` FilePath string `json:"filePath"` Url string `json:"url"` AutoReload int `json:"autoReload"` }
func (*AuthorizationConfig) Validate ¶
func (a *AuthorizationConfig) Validate() error
type BrokerConfig ¶
type BrokerConfig struct { Port int `json:"-"` MaxPayload int `json:"maxPayload"` WriteDeadline int `json:"writeDeadline"` MaxConn int `json:"maxConn"` MonitoringPort int `json:"-"` MemoryPipe *pipe.Pipe `json:"-"` WriteBufferSize int `json:"writeBufferSize"` ReadBufferSize int `json:"readBufferSize"` DiskSyncSeconds int `json:"diskSyncSeconds"` SliceMaxMessages int `json:"sliceMaxMessages"` SliceMaxBytes int64 `json:"sliceMaxBytes"` SliceMaxAgeSeconds int `json:"sliceMaxAgeSeconds"` ParallelRecovery int `json:"parallelRecovery"` }
func (*BrokerConfig) Validate ¶
func (b *BrokerConfig) Validate() error
type ClientConfig ¶
type ClientConfig struct { GrpcHost string `json:"grpcHost"` GrpcPort int `json:"grpcPort"` ApiAddress string `json:"apiAddress"` AuthToken string `json:"authToken"` ClientID string `json:"clientId"` }
func (*ClientConfig) Validate ¶
func (c *ClientConfig) Validate() error
type Config ¶
type Config struct { Host string `json:"-"` Client *ClientConfig `json:"client"` Api *ApiConfig `json:"api"` Log *LogConfig `json:"log"` Broker *BrokerConfig `json:"broker"` Store *StoreConfig `json:"store"` Queue *QueueConfig `json:"queue"` Grpc *GrpcConfig `json:"grpc"` Rest *RestConfig `json:"rest"` Authorization *AuthorizationConfig `json:"authorization"` Authentication *AuthenticationConfig `json:"authentication"` Security *SecurityConfig `json:"security"` Routing *RoutingConfig `json:"routing"` // contains filtered or unexported fields }
func GetAppConfig ¶
func GetCopyAppConfig ¶
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
func (*Config) GetVersion ¶
func (*Config) SetVersion ¶
type GrpcConfig ¶
type GrpcConfig struct { Port int `json:"port"` SubBuffSize int `json:"subBuffSize"` BodyLimit int `json:"bodyLimit"` }
func (*GrpcConfig) Validate ¶
func (g *GrpcConfig) Validate() error
type JWTAuthenticationConfig ¶
type JWTAuthenticationConfig struct { Key string `json:"key"` FilePath string `json:"filePath"` SignatureType string `json:"signatureType"` }
func (*JWTAuthenticationConfig) Validate ¶
func (jc *JWTAuthenticationConfig) Validate() error
type LogConfig ¶
type LogConfig struct {
Level LogLevelType `json:"level"`
}
type LogLevelType ¶
type LogLevelType string
type QueueConfig ¶
type QueueConfig struct { MaxNumberOfMessages int32 `json:"maxNumberOfMessages"` MaxWaitTimeoutSeconds int32 `json:"maxWaitTimeoutSeconds"` MaxExpirationSeconds int32 `json:"maxExpirationSeconds"` MaxDelaySeconds int32 `json:"maxDelaySeconds"` MaxReceiveCount int32 `json:"maxReceiveCount"` MaxVisibilitySeconds int32 `json:"maxVisibilitySeconds"` DefaultVisibilitySeconds int32 `json:"defaultVisibilitySeconds"` DefaultWaitTimeoutSeconds int32 `json:"defaultWaitTimeoutSeconds"` MaxInflight int32 `json:"maxInflight"` PubAckWaitSeconds int32 `json:"pubAckWaitSeconds"` }
func (*QueueConfig) Validate ¶
func (q *QueueConfig) Validate() error
type ResourceConfig ¶
func (*ResourceConfig) Empty ¶
func (r *ResourceConfig) Empty() bool
func (*ResourceConfig) Get ¶
func (r *ResourceConfig) Get() ([]byte, error)
func (*ResourceConfig) GetWithoutWithSpace ¶
func (r *ResourceConfig) GetWithoutWithSpace() ([]byte, error)
type RestConfig ¶
type RestConfig struct { Port int `json:"port"` ReadTimeout int `json:"readTimeout"` WriteTimeout int `json:"writeTimeout"` SubBuffSize int `json:"subBuffSize"` BodyLimit string `json:"bodyLimit"` Cors *RestCorsConfig `json:"cors"` }
func (*RestConfig) Validate ¶
func (r *RestConfig) Validate() error
type RestCorsConfig ¶
type RestCorsConfig struct { AllowOrigins []string `json:"allowOrigins"` AllowMethods []string `json:"allowMethods"` AllowHeaders []string `json:"allowHeaders"` AllowCredentials bool `json:"allowCredentials"` ExposeHeaders []string `json:"exposeHeaders"` MaxAge int `json:"maxAge"` }
func (*RestCorsConfig) Validate ¶
func (rc *RestCorsConfig) Validate() error
type RoutingConfig ¶
type RoutingConfig struct { Enable bool `json:"enable"` Data string `json:"data"` FilePath string `json:"filePath"` Url string `json:"url"` AutoReload int `json:"autoReload"` }
func (*RoutingConfig) Validate ¶
func (a *RoutingConfig) Validate() error
type SecurityConfig ¶
type SecurityConfig struct { Cert *ResourceConfig `json:"cert"` Key *ResourceConfig `json:"key"` Ca *ResourceConfig `json:"ca"` }
func (*SecurityConfig) Mode ¶
func (s *SecurityConfig) Mode() SecurityModeType
func (*SecurityConfig) Validate ¶
func (s *SecurityConfig) Validate() error
type SecurityModeType ¶
type SecurityModeType int
const ( SecurityModeNone SecurityModeType = iota SecurityModeTLS SecurityModeMTLS )
type ServerState ¶
type ServerState struct { Host string `json:"host"` Version string `json:"version"` ServerStartTime int64 `json:"server_start_time"` ServerUpTimeSeconds int64 `json:"server_up_time_seconds"` }
func GetServerState ¶
func GetServerState() *ServerState
type StoreConfig ¶
type StoreConfig struct { CleanStore bool `json:"cleanStore"` StorePath string `json:"storePath"` MaxQueues int `json:"maxQueues"` MaxSubscribers int `json:"maxSubscribers"` MaxMessages int `json:"maxMessages"` MaxQueueSize int64 `json:"maxQueueSize"` MaxRetention int `json:"maxRetention"` MaxPurgeInactive int `json:"maxPurgeInactive"` }
func (*StoreConfig) Validate ¶
func (s *StoreConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.