Documentation ¶
Index ¶
- type ClientStream
- type Config
- type ConfigPriority
- type ConfigSource
- type ConfigSourceData
- type ConfigValue
- type ConfigValues
- type ConfigWatchEvent
- type InstanceInfo
- type Level
- type Logger
- type LoggerConstructor
- type Registry
- type RegistryConstructor
- type RegistryInstance
- type Server
- type ServerConstructor
- type ServerInfo
- type ServerKind
- type ServerStream
- type TracerProviderConstructor
- type WatchEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStream ¶
type Config ¶
type Config interface { ConfigValues Close() error LoadSource(...ConfigSource) error AddWatcher(string, func(ConfigWatchEvent)) error DelWatcher(string, func(ConfigWatchEvent)) error }
type ConfigPriority ¶
type ConfigPriority uint8
const ( ConfigPriorityFile ConfigPriority = iota ConfigPriorityEnv ConfigPriorityFlag ConfigPriorityCli ConfigPriorityRemote ConfigPriorityMemory ConfigPriorityMax )
type ConfigSource ¶
type ConfigSource interface { Name() string Read() (ConfigSourceData, error) Changeable() bool Watch() (<-chan ConfigSourceData, error) io.Closer }
Source is the source from which conf is loaded
type ConfigSourceData ¶
type ConfigSourceData interface { Priority() ConfigPriority Data() []byte Unmarshal(v interface{}) error }
type ConfigValue ¶
type ConfigValue interface { Bool(def ...bool) bool Int(def ...int) int Int64(def ...int64) int64 String(def ...string) string Float64(def ...float64) float64 Duration(def ...time.Duration) time.Duration StringSlice(def ...[]string) []string StringMap(def ...map[string]string) map[string]string Map(def ...map[string]interface{}) map[string]interface{} Scan(val interface{}) error Bytes(def ...[]byte) []byte }
type ConfigValues ¶
type ConfigWatchEvent ¶
type ConfigWatchEvent interface { Type() WatchEventType Value() ConfigValue }
type InstanceInfo ¶
type Level ¶
type Level int8
func (Level) MarshalText ¶ added in v0.1.1
MarshalText marshals the Level to text. Note that the text representation drops the -Level suffix (see example).
func (Level) String ¶ added in v0.1.1
String returns a lower-case ASCII representation of the log level.
func (*Level) UnmarshalText ¶ added in v0.1.1
UnmarshalText unmarshals text to a level. Like MarshalText, UnmarshalText expects the text representation of a Level to drop the -Level suffix (see example).
In particular, this makes it easy to configure logging levels using YAML, TOML, or JSON files.
type Logger ¶
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Debugw(msg string, kvs ...interface{}) Infow(msg string, kvs ...interface{}) Warnw(msg string, kvs ...interface{}) Errorw(msg string, kvs ...interface{}) Fatalw(msg string, kvs ...interface{}) SetLevel(Level) GetLevel() Level Enable(Level) bool }
type LoggerConstructor ¶ added in v0.1.1
type LoggerConstructor func() Logger
type Registry ¶
type Registry interface { Register(context.Context, RegistryInstance) error Deregister(context.Context, RegistryInstance) error Name() string }
type RegistryConstructor ¶
type RegistryConstructor func() Registry
type RegistryInstance ¶
type Server ¶
type Server interface { Serve() error Stop() error Info() ServerInfo }
type ServerConstructor ¶
type ServerConstructor func() Server
type ServerInfo ¶
type ServerKind ¶
type ServerKind string
const ( ServerKindRpc ServerKind = "rpc" ServerKindJob ServerKind = "job" ServerKindTask ServerKind = "task" ServerKindGovernor ServerKind = "governor" )
type ServerStream ¶
type TracerProviderConstructor ¶
type TracerProviderConstructor func(name string) trace.TracerProvider
type WatchEventType ¶
type WatchEventType uint32
const ( WatchEventUpd WatchEventType WatchEventAdd WatchEventDel )
Click to show internal directories.
Click to hide internal directories.