Documentation ¶
Index ¶
- Variables
- func App() *cobra.Command
- func Init(opts ...Option) error
- type Cmd
- type Option
- func Broker(b *broker.Broker) Option
- func Cache(c *cache.Cache) Option
- func Client(c *client.Client) Option
- func Command(app *cobra.Command) Option
- func Config(c *config.Config) Option
- func Description(d string) Option
- func Name(n string) Option
- func NewApp(app *cobra.Command) Option
- func NewBroker(name string, b func(...broker.Option) broker.Broker) Option
- func NewClient(name string, b func(...client.Option) client.Client) Option
- func NewRegistry(name string, r func(...registry.Option) registry.Registry) Option
- func NewSelector(name string, s func(...selector.Option) selector.Selector) Option
- func NewServer(name string, s func(...server.Option) server.Server) Option
- func NewTracer(name string, t func(...trace.Option) trace.Tracer) Option
- func Registry(r *registry.Registry) Option
- func Selector(s *selector.Selector) Option
- func Server(s *server.Server) Option
- func Tracer(t *trace.Tracer) Option
- func Version(v string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultCmd = newCmd() DefaultBrokers = map[string]func(...broker.Option) broker.Broker{ "memory": memory.NewBroker, "http": brokerHttp.NewBroker, } DefaultClients = map[string]func(...client.Option) client.Client{ "grpc": grpcClient.NewClient, } DefaultRegistries = map[string]func(...registry.Option) registry.Registry{ "mdns": mdns.NewRegistry, "memory": regMemory.NewRegistry, } DefaultSelectors = map[string]func(...selector.Option) selector.Selector{ "dns": dns.NewSelector, "static": static.NewSelector, } DefaultServers = map[string]func(...server.Option) server.Server{ "grpc": grpcServer.NewServer, } DefaultCaches = map[string]func(...cache.Option) cache.Cache{ "memory": memCache.NewCache, "noop": nopCache.NewCache, } DefaultTracers = map[string]func(...trace.Option) trace.Tracer{ "memory": memTracer.NewTracer, } DefaultConfigs = map[string]func(...config.Option) config.Config{ "memory": configMemory.NewConfig, } )
Functions ¶
Types ¶
type Cmd ¶
type Option ¶
type Option func(o *Options)
func NewRegistry ¶
NewRegistry new registry func
func NewSelector ¶
NewSelector new selector func
type Options ¶
type Options struct { // For the Command Line itself Name string Description string Version string // We need pointers to things, so we can swap them out if needed. Broker *broker.Broker Registry *registry.Registry Selector *selector.Selector Config *config.Config Client *client.Client Server *server.Server Cache *cache.Cache Tracer *trace.Tracer Brokers map[string]func(...broker.Option) broker.Broker Configs map[string]func(...config.Option) config.Config Clients map[string]func(...client.Option) client.Client Registries map[string]func(...registry.Option) registry.Registry Selectors map[string]func(...selector.Option) selector.Selector Servers map[string]func(...server.Option) server.Server Caches map[string]func(...cache.Option) cache.Cache Tracers map[string]func(...trace.Option) trace.Tracer // Other options for implementations of the interfaces // can be stored in a context Context context.Context // contains filtered or unexported fields }
func DefaultOptions ¶
func DefaultOptions() Options
Click to show internal directories.
Click to hide internal directories.