Documentation ¶
Index ¶
- func DecodeGRPCGetLocationRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCPostLocationBigBrotherRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeGRPCPostLocationTaskerRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
- func DecodeHTTPGetLocationZeroRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeHTTPPostLocationBigBrotherZeroRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeHTTPPostLocationTaskerZeroRequest(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeGRPCGetLocationResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCPostLocationBigBrotherResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCPostLocationTaskerResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeHTTPGenericResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func HTTPDecodeLogger(next httptransport.DecodeRequestFunc, logger log.Logger) httptransport.DecodeRequestFunc
- func MakeGRPCServer(ctx context.Context, endpoints Endpoints) pb.CurrentServer
- func MakeGetLocationEndpoint(s pb.CurrentServer) endpoint.Endpoint
- func MakeHTTPHandler(ctx context.Context, endpoints Endpoints, logger log.Logger) http.Handler
- func MakePostLocationBigBrotherEndpoint(s pb.CurrentServer) endpoint.Endpoint
- func MakePostLocationTaskerEndpoint(s pb.CurrentServer) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) GetLocation(ctx context.Context, in *pb.GetLocationRequest) (*pb.Location, error)
- func (e Endpoints) PostLocationBigBrother(ctx context.Context, in *pb.PostLocationBigBrotherRequest) (*pb.Empty, error)
- func (e Endpoints) PostLocationTasker(ctx context.Context, in *pb.PostLocationTaskerRequest) (*pb.Empty, 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 DecodeGRPCGetLocationRequest ¶
DecodeGRPCGetLocationRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC getlocation request to a user-domain getlocation request. Primarily useful in a server.
func DecodeGRPCPostLocationBigBrotherRequest ¶
func DecodeGRPCPostLocationBigBrotherRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
DecodeGRPCPostLocationBigBrotherRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC postlocationbigbrother request to a user-domain postlocationbigbrother request. Primarily useful in a server.
func DecodeGRPCPostLocationTaskerRequest ¶
func DecodeGRPCPostLocationTaskerRequest(_ context.Context, grpcReq interface{}) (interface{}, error)
DecodeGRPCPostLocationTaskerRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC postlocationtasker request to a user-domain postlocationtasker request. Primarily useful in a server.
func DecodeHTTPGetLocationZeroRequest ¶
DecodeHTTPGetLocationZeroRequest is a transport/http.DecodeRequestFunc that decodes a JSON-encoded getlocation request from the HTTP request body. Primarily useful in a server.
func DecodeHTTPPostLocationBigBrotherZeroRequest ¶
func DecodeHTTPPostLocationBigBrotherZeroRequest(_ context.Context, r *http.Request) (interface{}, error)
DecodeHTTPPostLocationBigBrotherZeroRequest is a transport/http.DecodeRequestFunc that decodes a JSON-encoded postlocationbigbrother request from the HTTP request body. Primarily useful in a server.
func DecodeHTTPPostLocationTaskerZeroRequest ¶
func DecodeHTTPPostLocationTaskerZeroRequest(_ context.Context, r *http.Request) (interface{}, error)
DecodeHTTPPostLocationTaskerZeroRequest is a transport/http.DecodeRequestFunc that decodes a JSON-encoded postlocationtasker request from the HTTP request body. Primarily useful in a server.
func EncodeGRPCGetLocationResponse ¶
EncodeGRPCGetLocationResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain getlocation response to a gRPC getlocation reply. Primarily useful in a server.
func EncodeGRPCPostLocationBigBrotherResponse ¶
func EncodeGRPCPostLocationBigBrotherResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCPostLocationBigBrotherResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain postlocationbigbrother response to a gRPC postlocationbigbrother reply. Primarily useful in a server.
func EncodeGRPCPostLocationTaskerResponse ¶
func EncodeGRPCPostLocationTaskerResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCPostLocationTaskerResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain postlocationtasker response to a gRPC postlocationtasker 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 HTTPDecodeLogger ¶
func HTTPDecodeLogger(next httptransport.DecodeRequestFunc, logger log.Logger) httptransport.DecodeRequestFunc
func MakeGRPCServer ¶
func MakeGRPCServer(ctx context.Context, endpoints Endpoints) pb.CurrentServer
MakeGRPCServer makes a set of endpoints available as a gRPC CurrentServer.
func MakeGetLocationEndpoint ¶
func MakeGetLocationEndpoint(s pb.CurrentServer) endpoint.Endpoint
func MakeHTTPHandler ¶
MakeHTTPHandler returns a handler that makes a set of endpoints available on predefined paths.
func MakePostLocationBigBrotherEndpoint ¶
func MakePostLocationBigBrotherEndpoint(s pb.CurrentServer) endpoint.Endpoint
func MakePostLocationTaskerEndpoint ¶
func MakePostLocationTaskerEndpoint(s pb.CurrentServer) endpoint.Endpoint
Types ¶
type Endpoints ¶
type Endpoints struct { PostLocationBigBrotherEndpoint endpoint.Endpoint PostLocationTaskerEndpoint endpoint.Endpoint GetLocationEndpoint 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) GetLocation ¶
func (Endpoints) PostLocationBigBrother ¶
func (Endpoints) PostLocationTasker ¶
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.