Documentation
¶
Index ¶
- Constants
- type ConfigValidator
- type FileLogging
- type GRPCClient
- type GRPCClientCredentials
- type GRPCGatewayConfig
- type GRPCServer
- type GRPCServerCredentials
- type GRPCServerTransport
- type Kafka
- type KafkaConsumerOptions
- type KafkaOffset
- type KafkaProducerOptions
- type KafkaRebalanceStrategy
- type Logging
- type NATSQueue
- type PostgreSQL
- type Redis
- type S3
- type Telemetry
- type TelemetryKind
- type TelemetrySampling
Constants ¶
View Source
const ( TelemetryKindZipkin = "zipkin" TelemetryKindOTLPGRPC = "otlp_grpc" TelemetryKindOTLPHTTP = "otlp_http" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigValidator ¶
type ConfigValidator interface {
Validate() (err error)
}
type FileLogging ¶
type FileLogging struct { Enable bool `mapstructure:"enable" json:"enable"` Compress bool `mapstructure:"compress" json:"compress"` MaxBackups int `mapstructure:"max_backups" json:"maxBackups"` MaxSizeMB int `mapstructure:"max_size_mb" json:"maxSizeMB"` MaxAgeDays int `mapstructure:"max_age_days" json:"maxAgeDays"` Path string `mapstructure:"path" json:"path"` }
type GRPCClient ¶
type GRPCClient struct { Address string `json:"address" mapstructure:"address"` Timeout time.Duration `json:"timeout" mapstructure:"timeout"` Credentials *GRPCClientCredentials `json:"credentials" mapstructure:"credentials"` }
func (*GRPCClient) Validate ¶
func (c *GRPCClient) Validate() (err error)
type GRPCClientCredentials ¶
type GRPCClientCredentials struct { Secure bool `json:"secure" mapstructure:"secure"` CertFile string `json:"certFile" mapstructure:"cert_file"` ServerNameOverride string `json:"serverNameOverride" mapstructure:"server_name_override"` }
func (GRPCClientCredentials) TransportCredentials ¶
func (c GRPCClientCredentials) TransportCredentials() (credentials.TransportCredentials, error)
func (GRPCClientCredentials) Validate ¶
func (c GRPCClientCredentials) Validate() (err error)
type GRPCGatewayConfig ¶
type GRPCGatewayConfig struct { Client GRPCClient `json:"client" mapstructure:"client"` Host string `json:"host" mapstructure:"host"` Port int `json:"port" mapstructure:"port"` }
func (*GRPCGatewayConfig) HostPort ¶
func (c *GRPCGatewayConfig) HostPort() string
func (*GRPCGatewayConfig) Validate ¶
func (g *GRPCGatewayConfig) Validate() (err error)
type GRPCServer ¶
type GRPCServer struct {
Transports []GRPCServerTransport `json:"transports" mapstructure:"transports"`
}
func (*GRPCServer) Validate ¶
func (c *GRPCServer) Validate() (err error)
type GRPCServerCredentials ¶
type GRPCServerCredentials struct { Secure bool `json:"secure" mapstructure:"secure"` CertFile string `json:"certFile" mapstructure:"cert_file"` KeyFile string `json:"keyFile" mapstructure:"key_file"` }
func (*GRPCServerCredentials) TransportCredentials ¶
func (c *GRPCServerCredentials) TransportCredentials() (credentials.TransportCredentials, error)
func (*GRPCServerCredentials) Validate ¶
func (c *GRPCServerCredentials) Validate() (err error)
type GRPCServerTransport ¶
type GRPCServerTransport struct { Host string `json:"host" mapstructure:"host"` Port int `json:"port" mapstructure:"port"` Credentials GRPCServerCredentials `json:"credentials" mapstructure:"credentials"` }
func (GRPCServerTransport) HostPort ¶
func (g GRPCServerTransport) HostPort() string
func (*GRPCServerTransport) Validate ¶
func (g *GRPCServerTransport) Validate() (err error)
type Kafka ¶
type Kafka struct { Name string `mapstructure:"name"` Topic string `mapstructure:"topic"` Producer *KafkaProducerOptions `mapstructure:"producer,omitempty"` Consumer *KafkaConsumerOptions `mapstructure:"consumer,omitempty"` Brokers []string `mapstructure:"brokers"` RackID string `mapstructure:"rack_id"` }
type KafkaConsumerOptions ¶
type KafkaConsumerOptions struct { RebalanceStrategy *KafkaRebalanceStrategy `mapstructure:"rebalance_strategy,omitempty"` Offset *KafkaOffset `mapstructure:"offset,omitempty"` GroupID string `mapstructure:"group_id"` BackoffDuration time.Duration `mapstructure:"backoff_duration"` }
func (*KafkaConsumerOptions) Assign ¶
func (k *KafkaConsumerOptions) Assign(cfg *sarama.Config)
func (*KafkaConsumerOptions) Validate ¶
func (k *KafkaConsumerOptions) Validate() (err error)
type KafkaOffset ¶
type KafkaOffset string
const ( KafkaOffsetNewest KafkaOffset = "newest" KafkaOffsetOldest KafkaOffset = "oldest" )
func (KafkaOffset) String ¶
func (k KafkaOffset) String() string
func (KafkaOffset) Validate ¶
func (k KafkaOffset) Validate() error
func (KafkaOffset) Value ¶
func (k KafkaOffset) Value() int64
type KafkaProducerOptions ¶
type KafkaProducerOptions struct { Timeout time.Duration `mapstructure:"timeout"` BackoffDuration time.Duration `mapstructure:"backoff_duration"` RetryMaximum int `mapstructure:"retry_maximum"` MaxMessageBytes int `mapstructure:"max_message_bytes"` }
func (*KafkaProducerOptions) Assign ¶
func (k *KafkaProducerOptions) Assign(cfg *sarama.Config)
func (*KafkaProducerOptions) Validate ¶
func (k *KafkaProducerOptions) Validate() (err error)
type KafkaRebalanceStrategy ¶
type KafkaRebalanceStrategy string
const ( KafkaRebalanceStrategyRange KafkaRebalanceStrategy = "range" KafkaRebalanceStrategySticky KafkaRebalanceStrategy = "sticky" KafkaRebalanceStrategyRoundRobin KafkaRebalanceStrategy = "roundrobin" )
func (KafkaRebalanceStrategy) String ¶
func (k KafkaRebalanceStrategy) String() string
func (KafkaRebalanceStrategy) Validate ¶
func (k KafkaRebalanceStrategy) Validate() error
func (KafkaRebalanceStrategy) Value ¶
func (k KafkaRebalanceStrategy) Value() sarama.BalanceStrategy
type Logging ¶
type Logging struct { Level string `mapstructure:"level" json:"level"` File FileLogging `mapstructure:"file" json:"file"` }
func (*Logging) ZapWriteSync ¶
func (c *Logging) ZapWriteSync() zapcore.WriteSyncer
type PostgreSQL ¶
type PostgreSQL struct { Hostname string `json:"hostname" mapstructure:"hostname"` Port uint16 `json:"port" mapstructure:"port"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` Name string `json:"name" mapstructure:"name"` Properties map[string]string `json:"properties" mapstructure:"properties"` }
func (PostgreSQL) String ¶
func (d PostgreSQL) String() string
func (PostgreSQL) UnsafeString ¶
func (d PostgreSQL) UnsafeString() string
func (*PostgreSQL) Validate ¶
func (d *PostgreSQL) Validate() (err error)
type Redis ¶
type Redis struct { Addresses []string `json:"addresses" mapstructure:"addresses"` DatabaseNumber int `json:"databaseNumber" mapstructure:"database_number"` MasterName string `json:"masterName" mapstructure:"master_name"` SentinelUsername string `json:"sentinelUsername" mapstructure:"sentinel_username"` SentinelPassword string `json:"sentinelPassword" mapstructure:"sentinel_password"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` WriteTimeout time.Duration `json:"writeDuration" mapstructure:"write_timeout"` ReadTimeout time.Duration `json:"readTimeout" mapstructure:"read_timeout"` }
type S3 ¶
type S3 struct { Name string `json:"name" mapstructure:"name"` Endpoint string `json:"endpoint" mapstructure:"endpoint"` AccessKey string `json:"accessKey" mapstructure:"access_key"` SecretKey string `json:"secretKey" mapstructure:"secret_key"` Bucket string `json:"bucket" mapstructure:"bucket"` Region string `json:"region" mapstructure:"region"` UseSSL bool `json:"useSSL" mapstructure:"use_ssl"` }
type Telemetry ¶
type Telemetry struct { Enable bool `json:"enable" mapstructure:"enable"` Kind TelemetryKind `json:"kind" mapstructure:"kind"` Sampler TelemetrySampling `json:"sampler" mapstructure:"sampler"` Endpoint string `json:"endpoint" mapstructure:"endpoint"` CertFile *string `json:"cert_file" mapstructure:"cert_file"` }
type TelemetryKind ¶
type TelemetryKind string
func (TelemetryKind) Valid ¶
func (k TelemetryKind) Valid() bool
type TelemetrySampling ¶ added in v0.0.2
type TelemetrySampling string
func (TelemetrySampling) Sampler ¶ added in v0.0.2
func (k TelemetrySampling) Sampler() (trace.Sampler, error)
func (TelemetrySampling) Valid ¶ added in v0.0.2
func (k TelemetrySampling) Valid() bool
Click to show internal directories.
Click to hide internal directories.