Documentation
¶
Index ¶
- Variables
- func FromContextAny(ctx context.Context, key string) interface{}
- func WithContextAny(ctx context.Context, key string, val interface{}) context.Context
- type Config
- type HookFunc
- type Option
- func Clients(clt *client.Client) Option
- func Description(d string) Option
- func Discovery(d discovery.Discovery) Option
- func HealthAddr(a string) Option
- func HookAfterStart(fn ...HookFunc) Option
- func ID(id string) Option
- func Logger(l zerolog.Logger) Option
- func Name(n string) Option
- func Servers(srv *server.Server) Option
- type Service
- func (s *Service) Client(name string) (clt *client.Client, ok bool)
- func (s *Service) Health() *healthpb.HealthCheckResponse
- func (s *Service) ID() string
- func (s *Service) Logger() zerolog.Logger
- func (s *Service) Name() string
- func (s *Service) Push(opts ...Option)
- func (s *Service) Run() error
- func (s *Service) Server(name string) (srv *server.Server, ok bool)
- func (s *Service) Stop()
- func (s *Service) WaitUntilFinish()
- func (s *Service) WithContext(ctx context.Context) context.Context
- func (s *Service) WithOptions(opts ...Option) *Service
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDatastoreNotInitialized = errors.New("datastore not initialized")
)
View Source
var ( // PlutoContextKey is a context key. It can be used in HTTP / GRPC // handlers with context.WithValue to access the server that // started the handler. The associated value will be of type *Server. PlutoContextKey = &contextKey{"pluto-server"} )
Functions ¶
func FromContextAny ¶
FromContextAny returns from context the interface value to which the key is associated.
Types ¶
type Config ¶
type Config struct { ID string Name string Description string Discovery discovery.Discovery HealthAddr string // TCP address (e.g. localhost:8000) to listen on, ":http" if empty Servers map[string]*server.Server Clients map[string]*client.Client Hooks map[string][]HookFunc // contains filtered or unexported fields }
Config pluto service config
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to set options for the service.
func HookAfterStart ¶
HookAfterStart execute functions after service starts
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service representacion of a pluto service
func FromContext ¶
FromContext returns pluto service pointer from a context
func (*Service) WaitUntilFinish ¶
func (s *Service) WaitUntilFinish()
WaitUntilFinish returns service name
func (*Service) WithContext ¶
WithContext returns a copy of parent ctx with pluto service associated.
func (*Service) WithOptions ¶
WithOptions clones the current Service, applies the supplied Options, and returns the resulting Service. It's safe to use concurrently.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
jws
Package jws copied from https://github.com/golang/oauth2/blob/master/jws/jws.go
|
Package jws copied from https://github.com/golang/oauth2/blob/master/jws/jws.go |
Package common contains helper functions to be used around
|
Package common contains helper functions to be used around |
examples
|
|
router
Package router trie based on a 256-way trie expressed on the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne A string symbol table for extended ASCII strings, implemented using a 256-way trie.
|
Package router trie based on a 256-way trie expressed on the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne A string symbol table for extended ASCII strings, implemented using a 256-way trie. |
test
|
|
Click to show internal directories.
Click to hide internal directories.