config

package
v2.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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
		}
		Statsd struct {
			Enabled bool
		}
	}
	DefaultPipelines struct {
		StructValidation struct {
			Enabled bool
		}
	}
}

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 NewConfig

func NewConfig(cfgs ...*viper.Viper) *Config

NewConfig creates a new config with a given viper config if given

func (*Config) Get

func (c *Config) Get(s string) interface{}

Get returns an interface from the inner config

func (*Config) GetBool

func (c *Config) GetBool(s string) bool

GetBool returns an boolean from the inner config

func (*Config) GetDuration

func (c *Config) GetDuration(s string) time.Duration

GetDuration returns a duration from the inner config

func (*Config) GetInt

func (c *Config) GetInt(s string) int

GetInt returns an int from the inner config

func (*Config) GetString

func (c *Config) GetString(s string) string

GetString returns a string from the inner config

func (*Config) GetStringMapString

func (c *Config) GetStringMapString(s string) map[string]string

GetStringMapString returns a string map string from the inner config

func (*Config) GetStringSlice

func (c *Config) GetStringSlice(s string) []string

GetStringSlice returns a string slice from the inner config

func (*Config) Unmarshal

func (c *Config) Unmarshal(v interface{}) error

Unmarshal unmarshals config into v

func (*Config) UnmarshalKey

func (c *Config) UnmarshalKey(s string, v interface{}) error

UnmarshalKey unmarshals key into v

type ETCDBindingConfig

type ETCDBindingConfig struct {
	DialTimeout time.Duration
	Endpoints   []string
	Prefix      string
	LeaseTTL    time.Duration
}

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
	Max         int
	Exponential int
	MinDelay    int
	MaxDelay    int
	MaxRandom   int
}

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
	Endpoints          []string
	Prefix             string
	TransactionTimeout time.Duration
}

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
	User        string
	Pass        string
	DialTimeout time.Duration
	Prefix      string
	Heartbeat   struct {
		TTL time.Duration
		Log bool
	}
	SyncServers struct {
		Interval    time.Duration
		Parallelism int
	}
	Revoke struct {
		Timeout time.Duration
	}
	GrantLease struct {
		Timeout       time.Duration
		MaxRetries    int
		RetryInterval time.Duration
	}
	Shutdown struct {
		Delay time.Duration
	}
	ServerTypesBlacklist []string
}

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
	LazyConnection bool
	RequestTimeout time.Duration
}

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
}

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
}

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

type MemoryGroupConfig struct {
	TickDuration time.Duration
}

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
	MaxReconnectionRetries int
	RequestTimeout         time.Duration
	ConnectionTimeout      time.Duration
}

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
	MaxReconnectionRetries int
	Buffer                 struct {
		Messages int
		Push     int
	}
	Services          int
	ConnectionTimeout time.Duration
}

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
	}
	Handler struct {
		Messages struct {
			Compression bool
		}
	}
	Buffer struct {
		Agent struct {
			Messages int
		}
		Handler struct {
			LocalProcess  int
			RemoteProcess int
		}
	}
	Concurrency struct {
		Handler struct {
			Dispatch int
		}
	}
	Session struct {
		Unique bool
	}
	Metrics struct {
		Period time.Duration
	}
	Acceptor struct {
		ProxyProtocol bool
	}
}

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
		AdditionalLabels map[string]string
	}
	Game        string
	ConstLabels map[string]string
}

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
	Interval     time.Duration
	ForceDisable bool
}

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
		Prefix string
		Rate   float64
	}
	ConstLabels map[string]string
}

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
		Pool      string
		Password  string
	}
	Namespace   string
	Concurrency int
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL