Documentation
¶
Index ¶
- func NewContext(ctx context.Context, s AppInfo) context.Context
- type App
- type AppInfo
- type Option
- func Context(ctx context.Context) Option
- func Endpoint(endpoints ...*url.URL) Option
- func ID(id string) Option
- func Logger(logger log.Logger) Option
- func Metadata(md map[string]string) Option
- func Name(name string) Option
- func RegistrarTimeout(t time.Duration) Option
- func Server(srv ...transport.Server) Option
- func Signal(sigs ...os.Signal) Option
- func StopTimeout(t time.Duration) Option
- func Version(version string) Option
- type ServiceInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an application components lifecycle manager.
type AppInfo ¶
type AppInfo interface { Name() string Version() string Metadata() map[string]string Endpoint() []string }
AppInfo is application context value.
type Option ¶
type Option func(o *options)
Option is an application option.
func RegistrarTimeout ¶
RegistrarTimeout with registrar timeout.
type ServiceInstance ¶
type ServiceInstance struct { // Version is the version of the compiled. Version string `json:"version"` // Metadata is the kv pair metadata associated with the service instance. Metadata map[string]string `json:"metadata"` // Endpoints is endpoint addresses of the service instance. // schema: // http://127.0.0.1:4401?isSecure=false // grpc://127.0.0.1:9000?isSecure=false Endpoints []string `json:"endpoints"` }
ServiceInstance is an instance of a service in a discovery system.
Click to show internal directories.
Click to hide internal directories.