option

package
v0.0.0-...-82ffc00 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingOptions

type LoggingOptions struct {
	Level     string `properties:"logging.level,default=info"`
	FilePath  string `properties:"logging.file.path,default=."`
	File      bool   `properties:"logging.file,default=false"`
	FileName  string `properties:"logging.file.name,default=app.log"`
	FileLevel bool   `properties:"logging.file.level,default=false"`
	FileLimit string `properties:"logging.file.limit,default=100MB"`
	FileRate  uint64 `properties:"logging.file.rate,default=30"`
}

日志配置

var LoggingOptionsInstance *LoggingOptions

type LoggingOptionsFun

type LoggingOptionsFun interface {
	Apply(*LoggingOptions)
}

func WithFilePath

func WithFilePath(s string) LoggingOptionsFun

type RegistryOptions

type RegistryOptions struct {
	ServerHost           []string          `properties:"discovery.server.host,default=127.0.0.1:2379"`
	ServerNameSpace      string            `properties:"discovery.server.namespace,default=haodoings.com"`
	ServerRegion         string            `properties:"discovery.server.region,default=default"`
	ServerZone           string            `properties:"discovery.server.zone,default=default"`
	InstanceIntervalTime uint64            `properties:"discovery.server.instance.interval.time,default=1"`
	InstanceName         string            `properties:"discovery.server.instance.name,default=haze"`
	InstanceWeight       float64           `properties:"discovery.server.instance.weight,default=10"`
	InstanceMetadata     map[string]string `properties:"discovery.server.instance.metadata,default="`
}

RegistryOptions 注册中心配置

var RegistryOptionsInstance *RegistryOptions

type RegistryOptionsFun

type RegistryOptionsFun interface {
	Apply(*RegistryOptions)
}

func WithInstanceName

func WithInstanceName(s string) RegistryOptionsFun

type ServerOptions

type ServerOptions struct {
	Host string `properties:"server.host,default=127.0.0.1"`
	Port uint64 `properties:"server.port,default=80"`
	Name string `properties:"server.name,default=haze"`
}

服务配置

var ServerOptionsInstance *ServerOptions

Jump to

Keyboard shortcuts

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