Merge branch 'master' into k8s/secret-template-fix
This commit is contained in:
commit
dfec1ad6b1
@ -16,14 +16,23 @@ import (
|
|||||||
|
|
||||||
// Server is a simple micro server abstraction
|
// Server is a simple micro server abstraction
|
||||||
type Server interface {
|
type Server interface {
|
||||||
Options() Options
|
// Initialise options
|
||||||
Init(...Option) error
|
Init(...Option) error
|
||||||
|
// Retrieve the options
|
||||||
|
Options() Options
|
||||||
|
// Register a handler
|
||||||
Handle(Handler) error
|
Handle(Handler) error
|
||||||
|
// Create a new handler
|
||||||
NewHandler(interface{}, ...HandlerOption) Handler
|
NewHandler(interface{}, ...HandlerOption) Handler
|
||||||
|
// Create a new subscriber
|
||||||
NewSubscriber(string, interface{}, ...SubscriberOption) Subscriber
|
NewSubscriber(string, interface{}, ...SubscriberOption) Subscriber
|
||||||
|
// Register a subscriber
|
||||||
Subscribe(Subscriber) error
|
Subscribe(Subscriber) error
|
||||||
|
// Start the server
|
||||||
Start() error
|
Start() error
|
||||||
|
// Stop the server
|
||||||
Stop() error
|
Stop() error
|
||||||
|
// Server implementation
|
||||||
String() string
|
String() string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +125,8 @@ type Handler interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Subscriber interface represents a subscription to a given topic using
|
// Subscriber interface represents a subscription to a given topic using
|
||||||
// a specific subscriber function or object with endpoints.
|
// a specific subscriber function or object with endpoints. It mirrors
|
||||||
|
// the handler in its behaviour.
|
||||||
type Subscriber interface {
|
type Subscriber interface {
|
||||||
Topic() string
|
Topic() string
|
||||||
Subscriber() interface{}
|
Subscriber() interface{}
|
||||||
|
@ -115,7 +115,7 @@ func (s *service) Init(opts ...Option) {
|
|||||||
s.opts.Store.Init(store.Table(name))
|
s.opts.Store.Init(store.Table(name))
|
||||||
|
|
||||||
// Set the client for the micro clients
|
// Set the client for the micro clients
|
||||||
s.opts.Auth.Init(auth.WithClient(s.Client()))
|
// s.opts.Auth.Init(auth.WithClient(s.Client()))
|
||||||
s.opts.Runtime.Init(runtime.WithClient(s.Client()))
|
s.opts.Runtime.Init(runtime.WithClient(s.Client()))
|
||||||
s.opts.Store.Init(store.WithClient(s.Client()))
|
s.opts.Store.Init(store.WithClient(s.Client()))
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user