Documentation
¶
Overview ¶
doc.go
Index ¶
- func LoadConfig(configStruct interface{}, sources ...ConfigSource) error
- type App
- type Application
- type ConfigSource
- type FileSource
- type Option
- func RegistrarTimeout(t time.Duration) Option
- func StopTimeout(t time.Duration) Option
- func WithConfigName(name string) Option
- func WithContext(ctx context.Context) Option
- func WithEndpoint(endpoints ...*url.URL) Option
- func WithEnv(env string) Option
- func WithID(id string) Option
- func WithLogger(logger log.Logger) Option
- func WithMetadata(metadata map[string]string) Option
- func WithName(name string) Option
- func WithPort(port int) Option
- func WithRegistrar(r registry.Registrar) Option
- func WithServer(servers ...transport.Server) Option
- func WithSignal(sigs ...os.Signal) Option
- func WithVersion(version string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(configStruct interface{}, sources ...ConfigSource) error
LoadConfig 支持多配置源加载 sources: 配置源实例(按优先级排序) configStruct: 目标配置结构体指针
Types ¶
type ConfigSource ¶
ConfigSource 定义配置源接口
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
FileSource 本地文件配置源
func NewFileSource ¶
func NewFileSource(path string) *FileSource
func (*FileSource) Priority ¶
func (s *FileSource) Priority() int
type Option ¶
type Option func(*Options)
Option 定义配置选项函数
func RegistrarTimeout ¶
RegistrarTimeout with registrar timeout.
func WithConfigName ¶
WithConfigName 设置配置文件名称 比如:你的配置文件是config.yaml,这里name=config
func WithEndpoint ¶
WithEndpoint with service endpoint.
func WithMetadata ¶
WithMetadata with service metadata.
func WithRegistrar ¶
WithRegistrar with service registry.
func WithServer ¶
WithServer with transport servers.
Directories
¶
| Path | Synopsis |
|---|---|
|
数组和切片
|
数组和切片 |
|
ai-go
command
ai-go project main.go
|
ai-go project main.go |
|
beego
command
|
|
|
concurrent
concurrent Go 语言并发编程的一些案例...
|
concurrent Go 语言并发编程的一些案例... |
|
json
command
|
|
|
jwt
command
|
|
|
keywords/defer
command
defer_defer.go http://go.jsrun.net/k9yKp
|
defer_defer.go http://go.jsrun.net/k9yKp |
|
others
command
Q: 使用两个goroutine交替打印序列,一个goroutinue打印数字,另一个goroutine打印字母,最终结果如下: 12AB34CD56EF78GH910IJ 参考: https://www.cnblogs.com/zhangjinfu/p/11288472.html 网上答案很多, 这个是比较简洁明了滴
|
Q: 使用两个goroutine交替打印序列,一个goroutinue打印数字,另一个goroutine打印字母,最终结果如下: 12AB34CD56EF78GH910IJ 参考: https://www.cnblogs.com/zhangjinfu/p/11288472.html 网上答案很多, 这个是比较简洁明了滴 |
|
xml
command
|
|
|
api
|
|
|
resolver
Package resolver resolves a http request to an endpoint
|
Package resolver resolves a http request to an endpoint |
|
resolver/grpc
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
|
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service |
|
resolver/host
Package host resolves using http host
|
Package host resolves using http host |
|
resolver/path
Package path resolves using http path
|
Package path resolves using http path |
|
resolver/vpath
Package vpath resolves using http path and recognised versioned urls
|
Package vpath resolves using http path and recognised versioned urls |
|
aikucun-activity-sync
command
|
|
|
clock
command
|
|
|
echo-server
command
|
|
|
filesvr
command
|
|
|
forward
command
|
|
|
generator
command
|
|
|
golb
command
app/golb/main.go
|
app/golb/main.go |
|
golb/vm
register.go
|
register.go |
|
hello
command
app/hello/main.go
|
app/hello/main.go |
|
letgo
command
main.go
|
main.go |
|
rpc/client
command
|
|
|
rpc/server
command
|
|
|
test
command
app/test/main.go
|
app/test/main.go |
|
di
module
|
|
|
gui/chapter03
module
|
|
|
i18n
module
|
|
|
oauthx
module
|
|
|
snaker
module
|
|
|
stdlog
module
|
|
|
toolkit
module
|
|
|
plugin/memory
module
|
|
|
Package errors The error is normally JSON encoded.
|
Package errors The error is normally JSON encoded. |
|
faq
|
|
|
Package gobyexample https://gobyexample.com/ https://gobyexample-cn.github.io/ https://go.dev/play/
|
Package gobyexample https://gobyexample.com/ https://gobyexample-cn.github.io/ https://go.dev/play/ |
|
exit
command
|
|
|
httpclient
command
|
|
|
handler
|
|
|
internal
|
|
|
service
Package service
|
Package service |
|
tests
Package tests 用来提供一些测试示例,基于一下准则 1.不依赖三方库,尽量只用标准库来实现功能示例 2...
|
Package tests 用来提供一些测试示例,基于一下准则 1.不依赖三方库,尽量只用标准库来实现功能示例 2... |
|
math 是对标准包 math 的一些补充, 以便使用.
|
math 是对标准包 math 的一些补充, 以便使用. |
|
Package metadata is a way of defining message headers.
|
Package metadata is a way of defining message headers. |
|
middleware
|
|
|
net
|
|
|
http
http.go
|
http.go |
|
rpc
rpc = Remote Procedure Call 也就是我们熟称的 "远程过程调用"
|
rpc = Remote Procedure Call 也就是我们熟称的 "远程过程调用" |
|
plugin
|
|
|
hello
command
main.go
|
main.go |
|
Package registry is an interface for service registry and discovery.
|
Package registry is an interface for service registry and discovery. |
|
mdns_registry
Package mdns_registry provides a multicast dns registry.
|
Package mdns_registry provides a multicast dns registry. |
|
Package server
|
Package server |
|
util
|
|
Click to show internal directories.
Click to hide internal directories.