Documentation ¶
Index ¶
- func NewCustomMetricsSpec(config *Config) *models.CustomMetricsSpec
- func NewDefaultCustomMetricsSpec() *models.CustomMetricsSpec
- type BuilderConfig
- type Config
- func (c *Config) Get(s string) interface{}
- func (c *Config) GetBool(s string) bool
- func (c *Config) GetDuration(s string) time.Duration
- func (c *Config) GetInt(s string) int
- func (c *Config) GetString(s string) string
- func (c *Config) GetStringMapString(s string) map[string]string
- func (c *Config) GetStringSlice(s string) []string
- func (c *Config) Unmarshal(v interface{}) error
- func (c *Config) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- type ETCDBindingConfig
- type EnqueueOpts
- type EtcdGroupServiceConfig
- type EtcdServiceDiscoveryConfig
- type GRPCClientConfig
- type GRPCServerConfig
- type InfoRetrieverConfig
- type MemoryGroupConfig
- type NatsRPCClientConfig
- type NatsRPCServerConfig
- type PitayaConfig
- type PrometheusConfig
- type RateLimitingConfig
- type StatsdConfig
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCustomMetricsSpec ¶
func NewCustomMetricsSpec(config *Config) *models.CustomMetricsSpec
NewCustomMetricsSpec returns a *CustomMetricsSpec by reading config key (DEPRECATED)
func NewDefaultCustomMetricsSpec ¶
func NewDefaultCustomMetricsSpec() *models.CustomMetricsSpec
NewDefaultCustomMetricsSpec returns an empty *CustomMetricsSpec
Types ¶
type BuilderConfig ¶
type BuilderConfig struct { Pitaya PitayaConfig Metrics struct { Prometheus struct { Enabled bool `mapstructure:"enabled"` } `mapstructure:"prometheus"` Statsd struct { Enabled bool `mapstructure:"enabled"` } `mapstructure:"statsd"` } `mapstructure:"metrics"` DefaultPipelines struct { StructValidation struct { Enabled bool `mapstructure:"enabled"` } `mapstructure:"structvalidation"` } `mapstructure:"defaultpipelines"` }
BuilderConfig provides configuration for Builder
func NewBuilderConfig ¶
func NewBuilderConfig(config *Config) *BuilderConfig
NewBuilderConfig reads from config to build builder configuration
func NewDefaultBuilderConfig ¶
func NewDefaultBuilderConfig() *BuilderConfig
NewDefaultBuilderConfig provides default builder configuration
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a wrapper around a viper config
func (*Config) GetDuration ¶
GetDuration returns a duration from the inner config
func (*Config) GetStringMapString ¶
GetStringMapString returns a string map string from the inner config
func (*Config) GetStringSlice ¶
GetStringSlice returns a string slice from the inner config
func (*Config) UnmarshalKey ¶
func (c *Config) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalKey unmarshals key into v
type ETCDBindingConfig ¶
type ETCDBindingConfig struct { DialTimeout time.Duration `mapstructure:"dialtimeout"` Endpoints []string `mapstructure:"endpoints"` Prefix string `mapstructure:"prefix"` LeaseTTL time.Duration `mapstructure:"leasettl"` }
ETCDBindingConfig provides configuration for ETCDBindingStorage
func NewDefaultETCDBindingConfig ¶
func NewDefaultETCDBindingConfig() *ETCDBindingConfig
NewDefaultETCDBindingConfig provides default configuration for ETCDBindingStorage
func NewETCDBindingConfig ¶
func NewETCDBindingConfig(config *Config) *ETCDBindingConfig
NewETCDBindingConfig reads from config to build ETCDBindingStorage configuration
type EnqueueOpts ¶
type EnqueueOpts struct { Enabled bool `mapstructure:"enabled"` Max int `mapstructure:"max"` Exponential int `mapstructure:"exponential"` MinDelay int `mapstructure:"mindelay"` MaxDelay int `mapstructure:"maxdelay"` MaxRandom int `mapstructure:"maxrandom"` }
EnqueueOpts has retry options for worker
func NewDefaultEnqueueOpts ¶
func NewDefaultEnqueueOpts() *EnqueueOpts
NewDefaultEnqueueOpts provides default EnqueueOpts
func NewEnqueueOpts ¶
func NewEnqueueOpts(config *Config) *EnqueueOpts
NewEnqueueOpts reads from config to build *EnqueueOpts
type EtcdGroupServiceConfig ¶
type EtcdGroupServiceConfig struct { DialTimeout time.Duration `mapstructure:"dialtimeout"` Endpoints []string `mapstructure:"endpoints"` Prefix string `mapstructure:"prefix"` TransactionTimeout time.Duration `mapstructure:"transactiontimeout"` }
EtcdGroupServiceConfig provides ETCD configuration
func NewDefaultEtcdGroupServiceConfig ¶
func NewDefaultEtcdGroupServiceConfig() *EtcdGroupServiceConfig
NewDefaultEtcdGroupServiceConfig provides default ETCD configuration
func NewEtcdGroupServiceConfig ¶
func NewEtcdGroupServiceConfig(config *Config) *EtcdGroupServiceConfig
NewEtcdGroupServiceConfig reads from config to build ETCD configuration
type EtcdServiceDiscoveryConfig ¶
type EtcdServiceDiscoveryConfig struct { Endpoints []string `mapstructure:"endpoints"` User string `mapstructure:"user"` Pass string `mapstructure:"pass"` DialTimeout time.Duration `mapstructure:"dialtimeout"` Prefix string `mapstructure:"prefix"` Heartbeat struct { TTL time.Duration `mapstructure:"ttl"` Log bool `mapstructure:"log"` } `mapstructure:"heartbeat"` SyncServers struct { Interval time.Duration `mapstructure:"interval"` Parallelism int `mapstructure:"parallelism"` } `mapstructure:"syncservers"` Revoke struct { Timeout time.Duration `mapstructure:"timeout"` } `mapstructure:"revoke"` GrantLease struct { Timeout time.Duration `mapstructure:"timeout"` MaxRetries int `mapstructure:"maxretries"` RetryInterval time.Duration `mapstructure:"retryinterval"` } `mapstructure:"grantlease"` Shutdown struct { Delay time.Duration `mapstructure:"delay"` } `mapstructure:"shutdown"` ServerTypesBlacklist []string `mapstructure:"servertypesblacklist"` }
EtcdServiceDiscoveryConfig Etcd service discovery config
func NewDefaultEtcdServiceDiscoveryConfig ¶
func NewDefaultEtcdServiceDiscoveryConfig() *EtcdServiceDiscoveryConfig
NewDefaultEtcdServiceDiscoveryConfig Etcd service discovery default config
func NewEtcdServiceDiscoveryConfig ¶
func NewEtcdServiceDiscoveryConfig(config *Config) *EtcdServiceDiscoveryConfig
NewEtcdServiceDiscoveryConfig Etcd service discovery config with default config paths
type GRPCClientConfig ¶
type GRPCClientConfig struct { DialTimeout time.Duration `mapstructure:"dialtimeout"` LazyConnection bool `mapstructure:"lazyconnection"` RequestTimeout time.Duration `mapstructure:"requesttimeout"` }
GRPCClientConfig rpc client config struct
func NewDefaultGRPCClientConfig ¶
func NewDefaultGRPCClientConfig() *GRPCClientConfig
NewDefaultGRPCClientConfig rpc client default config struct
func NewGRPCClientConfig ¶
func NewGRPCClientConfig(config *Config) *GRPCClientConfig
NewGRPCClientConfig reads from config to build GRPCCLientConfig
type GRPCServerConfig ¶
type GRPCServerConfig struct {
Port int `mapstructure:"port"`
}
GRPCServerConfig provides configuration for GRPCServer
func NewDefaultGRPCServerConfig ¶
func NewDefaultGRPCServerConfig() *GRPCServerConfig
NewDefaultGRPCServerConfig returns a default GRPCServerConfig
func NewGRPCServerConfig ¶
func NewGRPCServerConfig(config *Config) *GRPCServerConfig
NewGRPCServerConfig reads from config to build GRPCServerConfig
type InfoRetrieverConfig ¶
type InfoRetrieverConfig struct {
Region string `mapstructure:"region"`
}
InfoRetrieverConfig provides InfoRetriever configuration
func NewDefaultInfoRetrieverConfig ¶
func NewDefaultInfoRetrieverConfig() *InfoRetrieverConfig
NewDefaultInfoRetrieverConfig provides default configuration for InfoRetriever
func NewInfoRetrieverConfig ¶
func NewInfoRetrieverConfig(c *Config) *InfoRetrieverConfig
NewInfoRetrieverConfig reads from config to build configuration for InfoRetriever
type MemoryGroupConfig ¶
MemoryGroupConfig provides configuration for MemoryGroup
func NewDefaultMemoryGroupConfig ¶
func NewDefaultMemoryGroupConfig() *MemoryGroupConfig
NewDefaultMemoryGroupConfig returns a new, default group instance
func NewMemoryGroupConfig ¶
func NewMemoryGroupConfig(conf *Config) *MemoryGroupConfig
NewMemoryGroupConfig returns a new, default group instance
type NatsRPCClientConfig ¶
type NatsRPCClientConfig struct { Connect string `mapstructure:"connect"` MaxReconnectionRetries int `mapstructure:"maxreconnectionretries"` RequestTimeout time.Duration `mapstructure:"requesttimeout"` ConnectionTimeout time.Duration `mapstructure:"connectiontimeout"` }
NatsRPCClientConfig provides nats client configuration
func NewDefaultNatsRPCClientConfig ¶
func NewDefaultNatsRPCClientConfig() *NatsRPCClientConfig
NewDefaultNatsRPCClientConfig provides default nats client configuration
func NewNatsRPCClientConfig ¶
func NewNatsRPCClientConfig(config *Config) *NatsRPCClientConfig
NewNatsRPCClientConfig reads from config to build nats client configuration
type NatsRPCServerConfig ¶
type NatsRPCServerConfig struct { Connect string `mapstructure:"connect"` MaxReconnectionRetries int `mapstructure:"maxreconnectionretries"` Buffer struct { Messages int `mapstructure:"messages"` Push int `mapstructure:"push"` } `mapstructure:"buffer"` Services int `mapstructure:"services"` ConnectionTimeout time.Duration `mapstructure:"connectiontimeout"` }
NatsRPCServerConfig provides nats server configuration
func NewDefaultNatsRPCServerConfig ¶
func NewDefaultNatsRPCServerConfig() *NatsRPCServerConfig
NewDefaultNatsRPCServerConfig provides default nats server configuration
func NewNatsRPCServerConfig ¶
func NewNatsRPCServerConfig(config *Config) *NatsRPCServerConfig
NewNatsRPCServerConfig reads from config to build nats server configuration
type PitayaConfig ¶
type PitayaConfig struct { Heartbeat struct { Interval time.Duration `mapstructure:"interval"` } `mapstructure:"heartbeat"` Handler struct { Messages struct { Compression bool `mapstructure:"compression"` } `mapstructure:"messages"` } `mapstructure:"handler"` Buffer struct { Agent struct { Messages int `mapstructure:"messages"` } `mapstructure:"agent"` Handler struct { LocalProcess int `mapstructure:"localprocess"` RemoteProcess int `mapstructure:"remoteprocess"` } `mapstructure:"handler"` } `mapstructure:"buffer"` Concurrency struct { Handler struct { Dispatch int `mapstructure:"dispatch"` } `mapstructure:"handler"` } `mapstructure:"concurrency"` Session struct { Unique bool `mapstructure:"unique"` Drain struct { Enabled bool `mapstructure:"enabled"` Timeout time.Duration `mapstructure:"timeout"` Period time.Duration `mapstructure:"period"` } `mapstructure:"drain"` } `mapstructure:"session"` Metrics struct { Period time.Duration `mapstructure:"period"` } `mapstructure:"metrics"` Acceptor struct { ProxyProtocol bool `mapstructure:"proxyprotocol"` } `mapstructure:"acceptor"` }
PitayaConfig provides configuration for a pitaya app
func NewDefaultPitayaConfig ¶
func NewDefaultPitayaConfig() *PitayaConfig
NewDefaultPitayaConfig provides default configuration for Pitaya App
func NewPitayaConfig ¶
func NewPitayaConfig(config *Config) *PitayaConfig
NewPitayaConfig returns a config instance with values extracted from default config paths
type PrometheusConfig ¶
type PrometheusConfig struct { Prometheus struct { Port int `mapstructure:"port"` AdditionalLabels map[string]string `mapstructure:"additionallabels"` } `mapstructure:"prometheus"` Game string `mapstructure:"game"` ConstLabels map[string]string `mapstructure:"constlabels"` }
PrometheusConfig provides configuration for PrometheusReporter
func NewDefaultPrometheusConfig ¶
func NewDefaultPrometheusConfig() *PrometheusConfig
NewDefaultPrometheusConfig provides default configuration for PrometheusReporter
func NewPrometheusConfig ¶
func NewPrometheusConfig(config *Config) *PrometheusConfig
NewPrometheusConfig reads from config to build configuration for PrometheusReporter
type RateLimitingConfig ¶
type RateLimitingConfig struct { Limit int `mapstructure:"limit"` Interval time.Duration `mapstructure:"interval"` ForceDisable bool `mapstructure:"forcedisable"` }
RateLimitingConfig rate limits config
func NewDefaultRateLimitingConfig ¶
func NewDefaultRateLimitingConfig() *RateLimitingConfig
NewDefaultRateLimitingConfig rate limits default config
func NewRateLimitingConfig ¶
func NewRateLimitingConfig(config *Config) *RateLimitingConfig
NewRateLimitingConfig reads from config to build rate limiting configuration
type StatsdConfig ¶
type StatsdConfig struct { Statsd struct { Host string `mapstructure:"host"` Prefix string `mapstructure:"prefix"` Rate float64 `mapstructure:"rate"` } `mapstructure:"statsd"` ConstLabels map[string]string `mapstructure:"consttags"` }
StatsdConfig provides configuration for statsd
func NewDefaultStatsdConfig ¶
func NewDefaultStatsdConfig() *StatsdConfig
NewDefaultStatsdConfig provides default configuration for statsd
func NewStatsdConfig ¶
func NewStatsdConfig(config *Config) *StatsdConfig
NewStatsdConfig reads from config to build configuration for statsd
type WorkerConfig ¶
type WorkerConfig struct { Redis struct { ServerURL string `mapstructure:"serverurl"` Pool string `mapstructure:"pool"` Password string `mapstructure:"password"` } `mapstructure:"redis"` Namespace string `mapstructure:"namespace"` Concurrency int `mapstructure:"concurrency"` }
WorkerConfig provides worker configuration
func NewDefaultWorkerConfig ¶
func NewDefaultWorkerConfig() *WorkerConfig
NewDefaultWorkerConfig provides worker default configuration
func NewWorkerConfig ¶
func NewWorkerConfig(config *Config) *WorkerConfig
NewWorkerConfig provides worker configuration based on default string paths