conf

package
v0.0.0-...-69995ca Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFailoverRedis

func InitFailoverRedis(masterName string, sentinelAddrs []string, password string, timeout time.Duration) (*redis.Client, error)

InitFailoverRedis init redis with sentinels

func InitRedis

func InitRedis(addr string, pass string) (*redis.Client, error)

func MakeAccessLog

func MakeAccessLog() *accesslog.AccessLog

Types

type Config

type Config struct {
	ServiceID     string
	NodeID        int64
	Listen        string `default:":8080"`
	PublicAddress string
	PublicPort    int `default:"8080"`
	Tags          []string
	ConsulURL     string
	RedisAddrs    string
	Driver        string `default:"mysql"`
	BaseDb        string
	MessageDb     string
	LogLevel      string `default:"INFO"`
}

Config Config

func Init

func Init(file string) (*Config, error)

Init InitConfig

func (Config) String

func (c Config) String() string

Jump to

Keyboard shortcuts

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