conf

package
v0.0.0-...-d15be54 Latest Latest
Warning

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

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

README

Conf配置

Documentation

Index

Constants

View Source
const (
	AppName = "Conf"
)

Variables

View Source
var Conf = &Config{}

Functions

func Load

func Load(projectRoot string) error

Types

type Config

type Config struct {
	GrpcServer  *GrpcServer
	MongoClient *mongo.Client
	EtcdClient  *clientv3.Client
	RedisClient *redis.Client
}

func (Config) Destroy

func (c Config) Destroy() error

func (Config) Init

func (c Config) Init() error

func (*Config) String

func (c *Config) String() string

type Etcd

type Etcd struct {
	Endpoints []string `toml:"endpoints"`
}

func (*Etcd) Load

func (e *Etcd) Load(projectRoot string) (*clientv3.Client, error)

type GrpcServer

type GrpcServer struct {
	MetricManageSvc  *MetricManageSvc  `toml:"MetricManageSvc"`
	ServiceManageSvc *ServiceManageSvc `toml:"ServiceManageSvc"`
}

func (*GrpcServer) Load

func (g *GrpcServer) Load(projectRoot string) (*GrpcServer, error)

type MetricManageSvc

type MetricManageSvc struct {
	Ipaddr string `toml:"ipaddr"`
	Port   string `toml:"port"`
}

type MongoDB

type MongoDB struct {
	Username string `toml:"username"`
	Password string `toml:"password"`
	Ipaddr   string `toml:"ipaddr"`
	Port     string `toml:"port"`
}

func (*MongoDB) Load

func (m *MongoDB) Load(projectRoot string) (*mongo.Client, error)

type Redis

type Redis struct {
	Ipaddr string `toml:"ipaddr"`
	Port   string `toml:"port"`
}

func (*Redis) Load

func (r *Redis) Load(projectRoot string) *redis.Client

type ServiceManageSvc

type ServiceManageSvc struct {
	Ipaddr string `toml:"ipaddr"`
	Port   string `toml:"port"`
}

Jump to

Keyboard shortcuts

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