Documentation ¶
Index ¶
- Variables
- 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(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
- type 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
- type Profile
- type Service
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 ¶
func MakeGetAddressEndpoint ¶
func MakeGetProfileEndpoint ¶
func MakePostAddressEndpoint ¶
func MakePostProfileEndpoint ¶
func MakePutProfileEndpoint ¶
Types ¶
type Endpoints ¶
type Endpoints struct { PostProfileEndpoint endpoint.Endpoint GetProfileEndpoint endpoint.Endpoint PutProfileEndpoint endpoint.Endpoint PatchProfileEndpoint endpoint.Endpoint DeleteProfileEndpoint endpoint.Endpoint GetAddressesEndpoint endpoint.Endpoint GetAddressEndpoint endpoint.Endpoint PostAddressEndpoint endpoint.Endpoint DeleteAddressEndpoint endpoint.Endpoint }
func MakeClientEndpoint ¶
func MakeServerEndpoints ¶
func (Endpoints) DeleteAddress ¶
func (Endpoints) DeleteProfile ¶
func (Endpoints) GetAddress ¶
func (Endpoints) GetAddresses ¶
func (Endpoints) GetProfile ¶
func (Endpoints) PatchProfile ¶
func (Endpoints) PostAddress ¶
type Middleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
type Service ¶
type Service interface { PostProfile(ctx context.Context, p Profile) error GetProfile(ctx context.Context, id string) (Profile, error) PutProfile(ctx context.Context, id string, p Profile) error PatchProfile(ctx context.Context, id string, p Profile) error DeleteProfile(ctx context.Context, id string) error GetAddresses(ctx context.Context, profileID string) ([]Address, error) GetAddress(ctx context.Context, profileID string, addressID string) (Address, error) PostAddress(ctx context.Context, profileID string, a Address) error DeleteAddress(ctx context.Context, profileID string, addressID string) error }
func NewInmemService ¶
func NewInmemService() Service
Click to show internal directories.
Click to hide internal directories.