Documentation ¶
Overview ¶
Package fox MIT License
# Copyright (c) 2024 go-fox Author https://github.com/go-fox/fox
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package fox MIT License
# Copyright (c) 2024 go-fox Author https://github.com/go-fox/fox
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package fox MIT License
# Copyright (c) 2024 go-fox Author https://github.com/go-fox/fox
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- func AppCommit() string
- func AppId() string
- func AppName() string
- func AppRegion() string
- func AppVersion() string
- func AppVersionSting() string
- func AppZone() string
- func BuildTime() string
- func GoVersion() string
- func HostName() string
- func NewContext(ctx context.Context, info AppInfo) context.Context
- func PrintVersion()
- func SetAppRegion(region string)
- func SetAppZone(z string)
- func StartTime() string
- func VersionFox() string
- type AppInfo
- type Application
- type HookFunc
- type HookType
- type Option
- func AddHooks(hookType HookType, hooks ...HookFunc) Option
- func Context(ctx context.Context) Option
- func HideBanner() Option
- func Hooks(hookType HookType, hooks ...HookFunc) Option
- func Id(id string) Option
- func Logger(log *slog.Logger) Option
- func MaxProc(maxProc int64) Option
- func Metadata(metadata map[string]string) Option
- func Name(name string) Option
- func Region(region string) Option
- func RegistrarTimeout(timeout time.Duration) Option
- func Registry(reg registry.Registry) Option
- func Server(servers ...transport.Server) Option
- func StopTimeout(timeout time.Duration) Option
- func Version(version string) Option
- func Zone(zone string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppVersionSting ¶
func AppVersionSting() string
AppVersionSting 获取版本字符串 (format is "Version/CommitHash" or only "Version" if CommitHash is empty)
func NewContext ¶
NewContext 创建附带服务信息的上下文
Types ¶
type AppInfo ¶
type AppInfo interface { ID() string Name() string Version() string Metadata() map[string]string Endpoint() []string }
AppInfo 应用信息
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application application
func (*Application) Endpoint ¶
func (app *Application) Endpoint() []string
Endpoint registry endpoint
func (*Application) Metadata ¶
func (app *Application) Metadata() map[string]string
Metadata app metadata
type Option ¶
type Option func(o *options)
Option app option
func RegistrarTimeout ¶
RegistrarTimeout with registry.Registrar timeout
Directories ¶
Path | Synopsis |
---|---|
api
|
|
protocol
Package protocol MIT License
|
Package protocol MIT License |
Package codec MIT License
|
Package codec MIT License |
json
Package json MIT License
|
Package json MIT License |
proto
Package proto MIT License
|
Package proto MIT License |
toml
Package toml MIT License
|
Package toml MIT License |
xml
Package xml MIT License
|
Package xml MIT License |
yaml
Package yaml MIT License
|
Package yaml MIT License |
Package config MIT License
|
Package config MIT License |
file
Package file MIT License
|
Package file MIT License |
contrib
|
|
auth/token
Module
|
|
cache
Module
|
|
clients/redis
Module
|
|
i18n
Module
|
|
middleware/recovery
Module
|
|
Package errors MIT License
|
Package errors MIT License |
internal
|
|
context
Package context MIT License
|
Package context MIT License |
cycle
Package cycle MIT License
|
Package cycle MIT License |
matcher
Package matcher MIT License
|
Package matcher MIT License |
signals
Package signals MIT License
|
Package signals MIT License |
strings
Package strings MIT License
|
Package strings MIT License |
Package middleware MIT License
|
Package middleware MIT License |
Package selector MIT License
|
Package selector MIT License |
balancer/random
Package random MIT License
|
Package random MIT License |
base
Package base MIT License
|
Package base MIT License |
node/direct
Package direct MIT License
|
Package direct MIT License |
Package transport MIT License
|
Package transport MIT License |
grpc
Package grpc MIT License
|
Package grpc MIT License |
grpc/resolver/direct
Package direct MIT License
|
Package direct MIT License |
grpc/resolver/discovery
Package discovery MIT License
|
Package discovery MIT License |
http
Package http MIT License
|
Package http MIT License |
http/binding
Package binding MIT License
|
Package binding MIT License |
websocket
Package websocket MIT License
|
Package websocket MIT License |