Documentation ¶
Index ¶
- func DecodeGRPCCreateActionRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCCreateOccurrenceRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCReadActionRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCReadActionsRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCReadOccurrencesByDateRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCReadOccurrencesRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func EncodeGRPCCreateActionResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCCreateOccurrenceResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCReadActionResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCReadActionsResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCReadOccurrencesByDateResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCReadOccurrencesResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeHTTPGenericResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func MakeCreateActionEndpoint(s pb.ModelServer) endpoint.Endpoint
- func MakeCreateOccurrenceEndpoint(s pb.ModelServer) endpoint.Endpoint
- func MakeGRPCServer(endpoints Endpoints) pb.ModelServer
- func MakeHTTPHandler(endpoints Endpoints) http.Handler
- func MakeReadActionEndpoint(s pb.ModelServer) endpoint.Endpoint
- func MakeReadActionsEndpoint(s pb.ModelServer) endpoint.Endpoint
- func MakeReadOccurrencesByDateEndpoint(s pb.ModelServer) endpoint.Endpoint
- func MakeReadOccurrencesEndpoint(s pb.ModelServer) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) CreateAction(ctx context.Context, in *pb.Action) (*pb.Action, error)
- func (e Endpoints) CreateOccurrence(ctx context.Context, in *pb.CreateOccurrenceRequest) (*pb.Occurrence, error)
- func (e Endpoints) ReadAction(ctx context.Context, in *pb.Action) (*pb.Action, error)
- func (e Endpoints) ReadActions(ctx context.Context, in *pb.User) (*pb.ActionsResponse, error)
- func (e Endpoints) ReadOccurrences(ctx context.Context, in *pb.Action) (*pb.OccurrencesResponse, error)
- func (e Endpoints) ReadOccurrencesByDate(ctx context.Context, in *pb.OccurrencesByDateReq) (*pb.OccurrencesResponse, error)
- func (e *Endpoints) WrapAllExcept(middleware endpoint.Middleware, excluded ...string)
- func (e *Endpoints) WrapAllLabeledExcept(middleware func(string, endpoint.Endpoint) endpoint.Endpoint, ...)
- type LabeledMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGRPCCreateActionRequest ¶
DecodeGRPCCreateActionRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC createaction request to a user-domain createaction request. Primarily useful in a server.
func DecodeGRPCCreateOccurrenceRequest ¶
DecodeGRPCCreateOccurrenceRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC createoccurrence request to a user-domain createoccurrence request. Primarily useful in a server.
func DecodeGRPCReadActionRequest ¶
DecodeGRPCReadActionRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC readaction request to a user-domain readaction request. Primarily useful in a server.
func DecodeGRPCReadActionsRequest ¶
DecodeGRPCReadActionsRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC readactions request to a user-domain readactions request. Primarily useful in a server.
func DecodeGRPCReadOccurrencesByDateRequest ¶
func DecodeGRPCReadOccurrencesByDateRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
DecodeGRPCReadOccurrencesByDateRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC readoccurrencesbydate request to a user-domain readoccurrencesbydate request. Primarily useful in a server.
func DecodeGRPCReadOccurrencesRequest ¶
DecodeGRPCReadOccurrencesRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC readoccurrences request to a user-domain readoccurrences request. Primarily useful in a server.
func EncodeGRPCCreateActionResponse ¶
EncodeGRPCCreateActionResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain createaction response to a gRPC createaction reply. Primarily useful in a server.
func EncodeGRPCCreateOccurrenceResponse ¶
func EncodeGRPCCreateOccurrenceResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCCreateOccurrenceResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain createoccurrence response to a gRPC createoccurrence reply. Primarily useful in a server.
func EncodeGRPCReadActionResponse ¶
EncodeGRPCReadActionResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain readaction response to a gRPC readaction reply. Primarily useful in a server.
func EncodeGRPCReadActionsResponse ¶
EncodeGRPCReadActionsResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain readactions response to a gRPC readactions reply. Primarily useful in a server.
func EncodeGRPCReadOccurrencesByDateResponse ¶
func EncodeGRPCReadOccurrencesByDateResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCReadOccurrencesByDateResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain readoccurrencesbydate response to a gRPC readoccurrencesbydate reply. Primarily useful in a server.
func EncodeGRPCReadOccurrencesResponse ¶
func EncodeGRPCReadOccurrencesResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCReadOccurrencesResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain readoccurrences response to a gRPC readoccurrences reply. Primarily useful in a server.
func EncodeHTTPGenericResponse ¶
func EncodeHTTPGenericResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
EncodeHTTPGenericResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer. Primarily useful in a server.
func MakeCreateActionEndpoint ¶
func MakeCreateActionEndpoint(s pb.ModelServer) endpoint.Endpoint
func MakeCreateOccurrenceEndpoint ¶
func MakeCreateOccurrenceEndpoint(s pb.ModelServer) endpoint.Endpoint
func MakeGRPCServer ¶
func MakeGRPCServer(endpoints Endpoints) pb.ModelServer
MakeGRPCServer makes a set of endpoints available as a gRPC ModelServer.
func MakeHTTPHandler ¶
MakeHTTPHandler returns a handler that makes a set of endpoints available on predefined paths.
func MakeReadActionEndpoint ¶
func MakeReadActionEndpoint(s pb.ModelServer) endpoint.Endpoint
func MakeReadActionsEndpoint ¶
func MakeReadActionsEndpoint(s pb.ModelServer) endpoint.Endpoint
func MakeReadOccurrencesByDateEndpoint ¶
func MakeReadOccurrencesByDateEndpoint(s pb.ModelServer) endpoint.Endpoint
func MakeReadOccurrencesEndpoint ¶
func MakeReadOccurrencesEndpoint(s pb.ModelServer) endpoint.Endpoint
Types ¶
type Endpoints ¶
type Endpoints struct { CreateActionEndpoint endpoint.Endpoint CreateOccurrenceEndpoint endpoint.Endpoint ReadActionEndpoint endpoint.Endpoint ReadActionsEndpoint endpoint.Endpoint ReadOccurrencesByDateEndpoint endpoint.Endpoint ReadOccurrencesEndpoint endpoint.Endpoint }
Endpoints collects all of the endpoints that compose an add service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
In a server, it's useful for functions that need to operate on a per-endpoint basis. For example, you might pass an Endpoints to a function that produces an http.Handler, with each method (endpoint) wired up to a specific path. (It is probably a mistake in design to invoke the Service methods on the Endpoints struct in a server.)
In a client, it's useful to collect individually constructed endpoints into a single type that implements the Service interface. For example, you might construct individual endpoints using transport/http.NewClient, combine them into an Endpoints, and return it to the caller as a Service.
func (Endpoints) CreateAction ¶
func (Endpoints) CreateOccurrence ¶
func (e Endpoints) CreateOccurrence(ctx context.Context, in *pb.CreateOccurrenceRequest) (*pb.Occurrence, error)
func (Endpoints) ReadAction ¶
func (Endpoints) ReadActions ¶
func (Endpoints) ReadOccurrences ¶
func (Endpoints) ReadOccurrencesByDate ¶
func (e Endpoints) ReadOccurrencesByDate(ctx context.Context, in *pb.OccurrencesByDateReq) (*pb.OccurrencesResponse, error)
func (*Endpoints) WrapAllExcept ¶
func (e *Endpoints) WrapAllExcept(middleware endpoint.Middleware, excluded ...string)
WrapAllExcept wraps each Endpoint field of struct Endpoints with a go-kit/kit/endpoint.Middleware. Use this for applying a set of middlewares to every endpoint in the service. Optionally, endpoints can be passed in by name to be excluded from being wrapped. WrapAllExcept(middleware, "Status", "Ping")
func (*Endpoints) WrapAllLabeledExcept ¶
func (e *Endpoints) WrapAllLabeledExcept(middleware func(string, endpoint.Endpoint) endpoint.Endpoint, excluded ...string)
WrapAllLabeledExcept wraps each Endpoint field of struct Endpoints with a LabeledMiddleware, which will receive the name of the endpoint. See LabeldMiddleware. See method WrapAllExept for details on excluded functionality.
type LabeledMiddleware ¶
LabeledMiddleware will get passed the endpoint name when passed to WrapAllLabeledExcept, this can be used to write a generic metrics middleware which can send the endpoint name to the metrics collector.