Versions in this module Expand all Collapse all v0 v0.2.0 Jul 27, 2016 v0.1.0 Jun 7, 2016 Changes in this version + var ErrAlreadyExists = errors.New("already exists") + var ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)") + var ErrInconsistentIDs = errors.New("inconsistent IDs") + var ErrNotFound = errors.New("not found") + func MakeDeleteAddressEndpoint(s Service) endpoint.Endpoint + func MakeDeleteProfileEndpoint(s Service) endpoint.Endpoint + func MakeGetAddressEndpoint(s Service) endpoint.Endpoint + func MakeGetAddressesEndpoint(s Service) endpoint.Endpoint + func MakeGetProfileEndpoint(s Service) endpoint.Endpoint + func MakeHTTPHandler(ctx context.Context, s Service, logger log.Logger) http.Handler + func MakePatchProfileEndpoint(s Service) endpoint.Endpoint + func MakePostAddressEndpoint(s Service) endpoint.Endpoint + func MakePostProfileEndpoint(s Service) endpoint.Endpoint + func MakePutProfileEndpoint(s Service) endpoint.Endpoint + type Address struct + ID string + Location string + type Endpoints struct + DeleteAddressEndpoint endpoint.Endpoint + DeleteProfileEndpoint endpoint.Endpoint + GetAddressEndpoint endpoint.Endpoint + GetAddressesEndpoint endpoint.Endpoint + GetProfileEndpoint endpoint.Endpoint + PatchProfileEndpoint endpoint.Endpoint + PostAddressEndpoint endpoint.Endpoint + PostProfileEndpoint endpoint.Endpoint + PutProfileEndpoint endpoint.Endpoint + func MakeClientEndpoints(instance string) (Endpoints, error) + func MakeServerEndpoints(s Service) Endpoints + func (e Endpoints) DeleteAddress(ctx context.Context, profileID string, addressID string) error + func (e Endpoints) DeleteProfile(ctx context.Context, id string) error + func (e Endpoints) GetAddress(ctx context.Context, profileID string, addressID string) (Address, error) + func (e Endpoints) GetAddresses(ctx context.Context, profileID string) ([]Address, error) + func (e Endpoints) GetProfile(ctx context.Context, id string) (Profile, error) + func (e Endpoints) PatchProfile(ctx context.Context, id string, p Profile) error + func (e Endpoints) PostAddress(ctx context.Context, profileID string, a Address) error + func (e Endpoints) PostProfile(ctx context.Context, p Profile) error + func (e Endpoints) PutProfile(ctx context.Context, id string, p Profile) error + type Middleware func(Service) Service + func LoggingMiddleware(logger log.Logger) Middleware + type Profile struct + Addresses []Address + ID string + Name string + type Service interface + DeleteAddress func(ctx context.Context, profileID string, addressID string) error + DeleteProfile func(ctx context.Context, id string) error + GetAddress func(ctx context.Context, profileID string, addressID string) (Address, error) + GetAddresses func(ctx context.Context, profileID string) ([]Address, error) + GetProfile func(ctx context.Context, id string) (Profile, error) + PatchProfile func(ctx context.Context, id string, p Profile) error + PostAddress func(ctx context.Context, profileID string, a Address) error + PostProfile func(ctx context.Context, p Profile) error + PutProfile func(ctx context.Context, id string, p Profile) error + func NewInmemService() Service