configs

package
v0.0.0-...-f04d356 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*Grpc `yaml:"grpc"`
}

type Config

type Config struct {
	*Server   `yaml:"server"`
	*Client   `yaml:"client"`
	*Database `yaml:"database"`
}

func LoadConfigYaml

func LoadConfigYaml(yamlFiles ...string) (*Config, error)

LoadConfigYaml 从yaml配置文件中读取配置信息

type Database

type Database struct {
	*Mysql         `yaml:"mysql"`
	*ElasticSearch `yaml:"elasticsearch"`
}

type ElasticSearch

type ElasticSearch struct {
	Addresses []string `yaml:"addresses"`
}

type Grpc

type Grpc struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type HTTPServer

type HTTPServer struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type Mysql

type Mysql struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Schema   string `yaml:"schema"`
	URL      string `yaml:"url"`
}

type Server

type Server struct {
	TokenTime       int  `yaml:"tokentimes"`
	DemoMode        bool `yaml:"demomode"`
	AuthorizeSwitch bool `yaml:"authorize"`
	*HTTPServer     `yaml:"httpserver"`
}

Jump to

Keyboard shortcuts

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