utils

package
v0.0.0-...-7ed5e79 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParameter = errors.New("invalid parameter")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Server *ServerConfig `json:"server,omitempty" yaml:"server"`
	Redis  *RedisConfig  `json:"redis,omitempty" yaml:"redis"`
}

func NewConfig

func NewConfig(ctx context.Context, path string) (*Config, error)

func NewTestConfig

func NewTestConfig() *Config

func (*Config) Check

func (c *Config) Check() bool

type RedisConfig

type RedisConfig struct {
	Network   string `json:"network,omitempty" yaml:"network"`
	Addr      string `json:"addr,omitempty" yaml:"addr"`
	Username  string `json:"username,omitempty" yaml:"username"`
	Password  string `json:"password,omitempty" yaml:"password"`
	Database  int    `json:"database,omitempty" yaml:"database"`
	KeyPrefix string `json:"key_prefix,omitempty" yaml:"key_prefix"`
	KeyExpire int    `json:"key_expire,omitempty" yaml:"key_expire"`
}

type ServerConfig

type ServerConfig struct {
	Addr     string `json:"addr,omitempty" yaml:"addr"`
	Name     string `json:"name,omitempty" yaml:"name"`
	LogLevel string `json:"log_level,omitempty" yaml:"log_level"`
}

Jump to

Keyboard shortcuts

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