configmodels

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TelemetryKindJaeger   = "jaeger"
	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"`
}

func (*Kafka) Validate

func (k *Kafka) Validate() (err error)

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"`
}

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

type Logging

type Logging struct {
	Level string      `mapstructure:"level" json:"level"`
	File  FileLogging `mapstructure:"file" json:"file"`
}

func (*Logging) Validate

func (c *Logging) Validate() (err error)

func (*Logging) ZapLevel

func (c *Logging) ZapLevel() zapcore.Level

func (*Logging) ZapWriteSync

func (c *Logging) ZapWriteSync() zapcore.WriteSyncer

type NATSQueue

type NATSQueue struct {
	RetentionPolicy string `mapstructure:"retention_policy"`
}

func (*NATSQueue) Validate

func (q *NATSQueue) Validate() (err error)

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"`
}

func (*Redis) Instance

func (r *Redis) Instance() redis.UniversalClient

func (*Redis) Validate

func (r *Redis) Validate() (err error)

type S3

type S3 struct {
	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"`
}

func (*S3) Validate

func (s *S3) Validate() (err error)

type Telemetry

type Telemetry struct {
	Enable   bool          `json:"enable" mapstructure:"enable"`
	Kind     TelemetryKind `json:"kind,default=jaeger,options=jaeger|zipkin|otlp_grpc|otlp_http" mapstructure:"kind"`
	Endpoint string        `json:"endpoint" mapstructure:"endpoint"`
	CertFile *string       `json:"cert_file" mapstructure:"cert_file"`
}

func (*Telemetry) Validate

func (c *Telemetry) Validate() (err error)

type TelemetryKind

type TelemetryKind string

func (TelemetryKind) Valid

func (k TelemetryKind) Valid() bool

Jump to

Keyboard shortcuts

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