Documentation
¶
Index ¶
- Variables
- func MakeDeleteServiceInfoEndpoint(s Service) endpoint.Endpoint
- func MakeGetServiceInfoEndpoint(s Service) endpoint.Endpoint
- func MakeHTTPHandler(s Service, logger log.Logger) http.Handler
- func MakePostServiceInfoEndpoint(s Service) endpoint.Endpoint
- func MakePutServiceInfoEndpoint(s Service) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) DeleteServiceInfo(ctx context.Context, id string) error
- func (e Endpoints) GetServiceInfo(ctx context.Context, id string) (ServiceInfo, error)
- func (e Endpoints) PostServiceInfo(ctx context.Context, h ServiceInfo) error
- func (e Endpoints) PutServiceInfo(ctx context.Context, id string, h ServiceInfo) error
- type Middleware
- type MiddlewareService
- type Service
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInconsistentIDs = errors.New("inconsistent IDs") ErrAlreadyExists = errors.New("already exists") ErrNotFound = errors.New("not found") )
View Source
var (
ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)")
)
Functions ¶
Types ¶
type Endpoints ¶
type Endpoints struct {
PostServiceInfoEndpoint endpoint.Endpoint
GetServiceInfoEndpoint endpoint.Endpoint
PutServiceInfoEndpoint endpoint.Endpoint
DeleteServiceInfoEndpoint endpoint.Endpoint
}
func MakeClientEndpoints ¶
func MakeServerEndpoints ¶
func (Endpoints) DeleteServiceInfo ¶
func (Endpoints) GetServiceInfo ¶
func (Endpoints) PostServiceInfo ¶
func (e Endpoints) PostServiceInfo(ctx context.Context, h ServiceInfo) error
func (Endpoints) PutServiceInfo ¶
type Middleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
type MiddlewareService ¶
func HostMiddleware ¶
func HostMiddleware(hostInfo host.Host) MiddlewareService
type Service ¶
type Service interface {
PostServiceInfo(ctx context.Context, h ServiceInfo) error
GetServiceInfo(ctx context.Context, id string) (ServiceInfo, error)
PutServiceInfo(ctx context.Context, id string, h ServiceInfo) error
DeleteServiceInfo(ctx context.Context, id string) error
}
func NewInmemService ¶
func NewInmemService() Service
Click to show internal directories.
Click to hide internal directories.