Documentation ¶
Overview ¶
Package service defines types for the contacts service.
Index ¶
- Variables
- type Config
- type Contact
- type Manager
- type Service
- func (s *Service) AddToGRPCServer(gs *grpc.Server)
- func (s *Service) Config() interface{}
- func (s *Service) Desc() string
- func (s *Service) Expose() interface{}
- func (s *Service) ID() string
- func (s *Service) Name() string
- func (s *Service) Run(ctx context.Context, running, stopping func()) error
- func (s *Service) SetConfig(config interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a contact is not found. ErrNotFound = errors.New("contact not found") )
View Source
var ( // available. ErrUnavailable = errors.New("the service is not available") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Filename is the filename of the contacts file. Filename string `toml:"filename" comment:"The filename of the contacts file."` }
Config contains configuration options for the Contacts service.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages a contact list.
func NewManager ¶
NewManager creates a new contact manager.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Contacts service.
func (*Service) AddToGRPCServer ¶
AddToGRPCServer adds the service to a gRPC server.
func (*Service) Config ¶
func (s *Service) Config() interface{}
Config returns the current service configuration or creates one with good default values.
func (*Service) Expose ¶
func (s *Service) Expose() interface{}
Expose exposes the service to other services.
Click to show internal directories.
Click to hide internal directories.