config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load[T any](path string) (*T, error)

func LoadEnv

func LoadEnv(filenames ...string)

Types

type Database

type Database struct {
	Driver          string
	Dsn             string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime string // time.Duration
	ConnMaxIdleTime string // time.Duration
}

type ElasticSearch

type ElasticSearch struct {
	Hosts    string
	UserName string
	Password string
	Sniff    string
}

type Email

type Email struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	From     string `yaml:"from"`
}

type Kafka

type Kafka struct {
	Addrs    string `yaml:"addrs"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

func (Kafka) GetAddr

func (r Kafka) GetAddr() []string

type KafkaConsumerGroup

type KafkaConsumerGroup struct {
	GroupID string   `yaml:"groupId"`
	Topics  []string `yaml:"topics"`
}

type Log

type Log struct {
	Dir          string
	Level        string
	MaxAge       int
	RotationTime int
}

type Redis

type Redis struct {
	Addr     string
	DB       string
	Password string
	Prefix   string
}

type Server

type Server struct {
	Network  string
	Addr     string
	Timeout  string
	Metadata map[string]string
}

func (Server) GrpcOptions

func (s Server) GrpcOptions(logger log.Logger, opts ...grpc.ServerOption) []grpc.ServerOption

func (Server) HttpOptions

func (s Server) HttpOptions(logger log.Logger, opts ...http.ServerOption) []http.ServerOption

Jump to

Keyboard shortcuts

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