config

package
v0.0.0-...-8b0f75f Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Exchanger *Exchanger `yaml:"exchanger"`
	Storage   *Storage   `yaml:"storage"`
	Server    *Server    `yaml:"server"`
}

Config the envcd config

func NewConfig

func NewConfig(configFile *string) *Config

NewConfig new envcd config

@param configFile the config file
@return *Config current config instance

func (*Config) StartInformation

func (cfg *Config) StartInformation()

StartInformation the envcd config information

@receiver cfg

type ConnMetadata

type ConnMetadata struct {
	Type     string // url schema
	UserName string
	Password string
	Host     string
	Hostname string
	Port     int
}

ConnMetadata with standard Url: etcd://user:123@localhost:123 metadata

type Exchanger

type Exchanger struct {
	// Exchanger with standard Url: etcd://user:123@localhost:123
	// the schema is the kind of the center
	Url          string `yaml:"url"`
	ConnMetadata *ConnMetadata
}

Exchanger the Exchanger config

type Server

type Server struct {
	RunMode      string `yaml:"run-mode"`
	Port         int    `yaml:"port"`
	ReadTimeout  int    `yaml:"read-timeout"`
	WriteTimeout int    `yaml:"write-timeout"`
}

Server the Server config

type Storage

type Storage struct {
	// Url with standard Url: MySQL://user:123@localhost:123
	Url          string `yaml:"url"`
	Database     string `yaml:"database"`
	ConnMetadata *ConnMetadata
}

Storage the Storage config

Jump to

Keyboard shortcuts

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