Documentation ¶
Index ¶
- Variables
- func MakeEndpointOfDeleteAddress(s Service) endpoint.Endpoint
- func MakeEndpointOfDeleteProfile(s Service) endpoint.Endpoint
- func MakeEndpointOfGetAddress(s Service) endpoint.Endpoint
- func MakeEndpointOfGetAddresses(s Service) endpoint.Endpoint
- func MakeEndpointOfGetProfile(s Service) endpoint.Endpoint
- func MakeEndpointOfPatchProfile(s Service) endpoint.Endpoint
- func MakeEndpointOfPostAddress(s Service) endpoint.Endpoint
- func MakeEndpointOfPostProfile(s Service) endpoint.Endpoint
- func MakeEndpointOfPutProfile(s Service) endpoint.Endpoint
- func NewGRPCServer(svc Service, codecs grpccodec.Codecs) pb.ServiceServer
- func ValidateDeleteAddressRequest(newSchema func(*DeleteAddressRequest) validating.Schema) httpoption.Validator
- func ValidateDeleteProfileRequest(newSchema func(*DeleteProfileRequest) validating.Schema) httpoption.Validator
- func ValidateGetAddressRequest(newSchema func(*GetAddressRequest) validating.Schema) httpoption.Validator
- func ValidateGetAddressesRequest(newSchema func(*GetAddressesRequest) validating.Schema) httpoption.Validator
- func ValidateGetProfileRequest(newSchema func(*GetProfileRequest) validating.Schema) httpoption.Validator
- func ValidatePatchProfileRequest(newSchema func(*PatchProfileRequest) validating.Schema) httpoption.Validator
- func ValidatePostAddressRequest(newSchema func(*PostAddressRequest) validating.Schema) httpoption.Validator
- func ValidatePostProfileRequest(newSchema func(*PostProfileRequest) validating.Schema) httpoption.Validator
- func ValidatePutProfileRequest(newSchema func(*PutProfileRequest) validating.Schema) httpoption.Validator
- type Address
- type DeleteAddressRequest
- type DeleteAddressResponse
- type DeleteProfileRequest
- type DeleteProfileResponse
- type GetAddressRequest
- type GetAddressResponse
- type GetAddressesRequest
- type GetAddressesResponse
- type GetProfileRequest
- type GetProfileResponse
- type PatchProfileRequest
- type PatchProfileResponse
- type PostAddressRequest
- type PostAddressResponse
- type PostProfileRequest
- type PostProfileResponse
- type Profile
- type PutProfileRequest
- type PutProfileResponse
- type Service
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MakeEndpointOfDeleteAddress ¶
MakeEndpointOfDeleteAddress creates the endpoint for s.DeleteAddress.
func MakeEndpointOfDeleteProfile ¶
MakeEndpointOfDeleteProfile creates the endpoint for s.DeleteProfile.
func MakeEndpointOfGetAddress ¶
MakeEndpointOfGetAddress creates the endpoint for s.GetAddress.
func MakeEndpointOfGetAddresses ¶
MakeEndpointOfGetAddresses creates the endpoint for s.GetAddresses.
func MakeEndpointOfGetProfile ¶
MakeEndpointOfGetProfile creates the endpoint for s.GetProfile.
func MakeEndpointOfPatchProfile ¶
MakeEndpointOfPatchProfile creates the endpoint for s.PatchProfile.
func MakeEndpointOfPostAddress ¶
MakeEndpointOfPostAddress creates the endpoint for s.PostAddress.
func MakeEndpointOfPostProfile ¶
MakeEndpointOfPostProfile creates the endpoint for s.PostProfile.
func MakeEndpointOfPutProfile ¶
MakeEndpointOfPutProfile creates the endpoint for s.PutProfile.
func NewGRPCServer ¶
func NewGRPCServer(svc Service, codecs grpccodec.Codecs) pb.ServiceServer
func ValidateDeleteAddressRequest ¶
func ValidateDeleteAddressRequest(newSchema func(*DeleteAddressRequest) validating.Schema) httpoption.Validator
ValidateDeleteAddressRequest creates a validator for DeleteAddressRequest.
func ValidateDeleteProfileRequest ¶
func ValidateDeleteProfileRequest(newSchema func(*DeleteProfileRequest) validating.Schema) httpoption.Validator
ValidateDeleteProfileRequest creates a validator for DeleteProfileRequest.
func ValidateGetAddressRequest ¶
func ValidateGetAddressRequest(newSchema func(*GetAddressRequest) validating.Schema) httpoption.Validator
ValidateGetAddressRequest creates a validator for GetAddressRequest.
func ValidateGetAddressesRequest ¶
func ValidateGetAddressesRequest(newSchema func(*GetAddressesRequest) validating.Schema) httpoption.Validator
ValidateGetAddressesRequest creates a validator for GetAddressesRequest.
func ValidateGetProfileRequest ¶
func ValidateGetProfileRequest(newSchema func(*GetProfileRequest) validating.Schema) httpoption.Validator
ValidateGetProfileRequest creates a validator for GetProfileRequest.
func ValidatePatchProfileRequest ¶
func ValidatePatchProfileRequest(newSchema func(*PatchProfileRequest) validating.Schema) httpoption.Validator
ValidatePatchProfileRequest creates a validator for PatchProfileRequest.
func ValidatePostAddressRequest ¶
func ValidatePostAddressRequest(newSchema func(*PostAddressRequest) validating.Schema) httpoption.Validator
ValidatePostAddressRequest creates a validator for PostAddressRequest.
func ValidatePostProfileRequest ¶
func ValidatePostProfileRequest(newSchema func(*PostProfileRequest) validating.Schema) httpoption.Validator
ValidatePostProfileRequest creates a validator for PostProfileRequest.
func ValidatePutProfileRequest ¶
func ValidatePutProfileRequest(newSchema func(*PutProfileRequest) validating.Schema) httpoption.Validator
ValidatePutProfileRequest creates a validator for PutProfileRequest.
Types ¶
type Address ¶
Address is a field of a user profile. ID should be unique within the profile (at a minimum).
type DeleteAddressRequest ¶
type DeleteAddressResponse ¶
type DeleteAddressResponse struct {
Err error `json:"-"`
}
func (*DeleteAddressResponse) Body ¶
func (r *DeleteAddressResponse) Body() interface{}
func (*DeleteAddressResponse) Failed ¶
func (r *DeleteAddressResponse) Failed() error
Failed implements endpoint.Failer.
type DeleteProfileRequest ¶
type DeleteProfileRequest struct {
Id string `json:"id"`
}
type DeleteProfileResponse ¶
type DeleteProfileResponse struct {
Err error `json:"-"`
}
func (*DeleteProfileResponse) Body ¶
func (r *DeleteProfileResponse) Body() interface{}
func (*DeleteProfileResponse) Failed ¶
func (r *DeleteProfileResponse) Failed() error
Failed implements endpoint.Failer.
type GetAddressRequest ¶
type GetAddressResponse ¶
func (*GetAddressResponse) Body ¶
func (r *GetAddressResponse) Body() interface{}
func (*GetAddressResponse) Failed ¶
func (r *GetAddressResponse) Failed() error
Failed implements endpoint.Failer.
type GetAddressesRequest ¶
type GetAddressesRequest struct {
Id string `json:"id"`
}
type GetAddressesResponse ¶
func (*GetAddressesResponse) Body ¶
func (r *GetAddressesResponse) Body() interface{}
func (*GetAddressesResponse) Failed ¶
func (r *GetAddressesResponse) Failed() error
Failed implements endpoint.Failer.
type GetProfileRequest ¶
type GetProfileRequest struct {
Id string `json:"id"`
}
type GetProfileResponse ¶
func (*GetProfileResponse) Body ¶
func (r *GetProfileResponse) Body() interface{}
func (*GetProfileResponse) Failed ¶
func (r *GetProfileResponse) Failed() error
Failed implements endpoint.Failer.
type PatchProfileRequest ¶
type PatchProfileResponse ¶
type PatchProfileResponse struct {
Err error `json:"-"`
}
func (*PatchProfileResponse) Body ¶
func (r *PatchProfileResponse) Body() interface{}
func (*PatchProfileResponse) Failed ¶
func (r *PatchProfileResponse) Failed() error
Failed implements endpoint.Failer.
type PostAddressRequest ¶
type PostAddressResponse ¶
type PostAddressResponse struct {
Err error `json:"-"`
}
func (*PostAddressResponse) Body ¶
func (r *PostAddressResponse) Body() interface{}
func (*PostAddressResponse) Failed ¶
func (r *PostAddressResponse) Failed() error
Failed implements endpoint.Failer.
type PostProfileRequest ¶
type PostProfileRequest struct {
Profile Profile `json:"profile"`
}
type PostProfileResponse ¶
type PostProfileResponse struct {
Err error `json:"-"`
}
func (*PostProfileResponse) Body ¶
func (r *PostProfileResponse) Body() interface{}
func (*PostProfileResponse) Failed ¶
func (r *PostProfileResponse) Failed() error
Failed implements endpoint.Failer.
type Profile ¶
type Profile struct { ID string `json:"id"` Name string `json:"name,omitempty"` Addresses []Address `json:"addresses,omitempty"` }
Profile represents a single user profile. ID should be globally unique.
type PutProfileRequest ¶
type PutProfileResponse ¶
type PutProfileResponse struct {
Err error `json:"-"`
}
func (*PutProfileResponse) Body ¶
func (r *PutProfileResponse) Body() interface{}
func (*PutProfileResponse) Failed ¶
func (r *PutProfileResponse) Failed() error
Failed implements endpoint.Failer.
type Service ¶
type Service interface { //kun:grpc PostProfile(ctx context.Context, profile Profile) (err error) //kun:grpc GetProfile(ctx context.Context, id string) (profile Profile, err error) //kun:grpc PutProfile(ctx context.Context, id string, profile Profile) (err error) //kun:grpc PatchProfile(ctx context.Context, id string, profile Profile) (err error) //kun:grpc DeleteProfile(ctx context.Context, id string) (err error) //kun:grpc GetAddresses(ctx context.Context, id string) (addresses []Address, err error) //kun:grpc GetAddress(ctx context.Context, id string, addressID string) (address Address, err error) //kun:grpc PostAddress(ctx context.Context, id string, address Address) (err error) //kun:grpc DeleteAddress(ctx context.Context, id string, addressID string) (err error) }
Service is a simple CRUD interface for user profiles.
func NewInmemService ¶
func NewInmemService() Service