Documentation ¶
Index ¶
- func DecodeGRPCCreateSessionRequest(_ context.Context, request interface{}) (interface{}, error)
- func DecodeGRPCDeleteSessionByTokenRequest(_ context.Context, request interface{}) (interface{}, error)
- func DecodeGRPCDeleteSessionsByOwnerTokenRequest(_ context.Context, request interface{}) (interface{}, error)
- func DecodeGRPCFindSessionByTokenRequest(_ context.Context, request interface{}) (interface{}, error)
- func DecodeHTTPCreateSessionRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeHTTPDeleteSessionByTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeHTTPDeleteSessionsByOwnerTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeHTTPFindSessionByTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func EncodeGRPCCreateSessionResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCDeleteSessionByTokenResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCDeleteSessionsByOwnerTokenResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeGRPCFindSessionByTokenResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeHTTPCreateSessionResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
- func EncodeHTTPDeleteSessionByTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
- func EncodeHTTPDeleteSessionsByOwnerTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
- func EncodeHTTPFindSessionByTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
- func MakeCreateSessionEndpoint(s Service) endpoint.Endpoint
- func MakeDeleteSessionByTokenEndpoint(s Service) endpoint.Endpoint
- func MakeDeleteSessionsByOwnerTokenEndpoint(s Service) endpoint.Endpoint
- func MakeFindSessionByTokenEndpoint(s Service) endpoint.Endpoint
- func MakeGRPCServer(ctx context.Context, endpoints Endpoints, tracer stdopentracing.Tracer, ...) pb.SessionManagementServer
- func MakeHTTPHandler(ctx context.Context, endpoints Endpoints, tracer stdopentracing.Tracer, ...) http.Handler
- type Endpoints
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGRPCCreateSessionRequest ¶
DecodeGRPCCreateSessionRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC request to a user-domain request.
func DecodeGRPCDeleteSessionByTokenRequest ¶
func DecodeGRPCDeleteSessionByTokenRequest(_ context.Context, request interface{}) (interface{}, error)
DecodeGRPCDeleteSessionByTokenRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC request to a user-domain request.
func DecodeGRPCDeleteSessionsByOwnerTokenRequest ¶
func DecodeGRPCDeleteSessionsByOwnerTokenRequest(_ context.Context, request interface{}) (interface{}, error)
DecodeGRPCDeleteSessionsByOwnerTokenRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC request to a user-domain request.
func DecodeGRPCFindSessionByTokenRequest ¶
func DecodeGRPCFindSessionByTokenRequest(_ context.Context, request interface{}) (interface{}, error)
DecodeGRPCFindSessionByTokenRequest is a transport/grpc.DecodeRequestFunc that converts a gRPC request to a user-domain request.
func DecodeHTTPCreateSessionRequest ¶
DecodeHTTPCreateSessionRequest is a transport/http.DecodeRequestFunc that decodes the JSON-encoded request from the HTTP request body.
func DecodeHTTPDeleteSessionByTokenRequest ¶
func DecodeHTTPDeleteSessionByTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)
DecodeHTTPDeleteSessionByTokenRequest is a transport/http.DecodeRequestFunc that decodes the JSON-encoded request from the HTTP request body.
func DecodeHTTPDeleteSessionsByOwnerTokenRequest ¶
func DecodeHTTPDeleteSessionsByOwnerTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)
DecodeHTTPDeleteSessionsByOwnerTokenRequest is a transport/http.DecodeRequestFunc that decodes the JSON-encoded request from the HTTP request body.
func DecodeHTTPFindSessionByTokenRequest ¶
DecodeHTTPFindSessionByTokenRequest is a transport/http.DecodeRequestFunc that decodes the JSON-encoded request from the HTTP request body.
func EncodeGRPCCreateSessionResponse ¶
EncodeGRPCCreateSessionResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain response to a gRPC reply.
func EncodeGRPCDeleteSessionByTokenResponse ¶
func EncodeGRPCDeleteSessionByTokenResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCDeleteSessionByTokenResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain response to a gRPC reply.
func EncodeGRPCDeleteSessionsByOwnerTokenResponse ¶
func EncodeGRPCDeleteSessionsByOwnerTokenResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCDeleteSessionsByOwnerTokenResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain response to a gRPC reply.
func EncodeGRPCFindSessionByTokenResponse ¶
func EncodeGRPCFindSessionByTokenResponse(_ context.Context, response interface{}) (interface{}, error)
EncodeGRPCFindSessionByTokenResponse is a transport/grpc.EncodeResponseFunc that converts a user-domain response to a gRPC reply.
func EncodeHTTPCreateSessionResponse ¶
func EncodeHTTPCreateSessionResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
EncodeHTTPCreateSessionResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer.
func EncodeHTTPDeleteSessionByTokenResponse ¶
func EncodeHTTPDeleteSessionByTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
EncodeHTTPDeleteSessionByTokenResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer.
func EncodeHTTPDeleteSessionsByOwnerTokenResponse ¶
func EncodeHTTPDeleteSessionsByOwnerTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
EncodeHTTPDeleteSessionsByOwnerTokenResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer.
func EncodeHTTPFindSessionByTokenResponse ¶
func EncodeHTTPFindSessionByTokenResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
EncodeHTTPFindSessionByTokenResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer.
func MakeCreateSessionEndpoint ¶
MakeCreateSessionEndpoint returns an endpoint that invokes CreateSession on the service.
func MakeDeleteSessionByTokenEndpoint ¶
MakeDeleteSessionByTokenEndpoint returns an endpoint that invokes DeleteSessionByToken on the service.
func MakeDeleteSessionsByOwnerTokenEndpoint ¶
MakeDeleteSessionsByOwnerTokenEndpoint returns an endpoint that invokes DeleteSessionsByOwnerToken on the service.
func MakeFindSessionByTokenEndpoint ¶
MakeFindSessionByTokenEndpoint returns an endpoint that invokes FindSessionByToken on the service.
func MakeGRPCServer ¶
func MakeGRPCServer(ctx context.Context, endpoints Endpoints, tracer stdopentracing.Tracer, logger log.Logger) pb.SessionManagementServer
MakeGRPCServer makes a set of endpoints available as a gRPC server.
Types ¶
type Endpoints ¶
type Endpoints struct { CreateSessionEndpoint endpoint.Endpoint FindSessionByTokenEndpoint endpoint.Endpoint DeleteSessionByTokenEndpoint endpoint.Endpoint DeleteSessionsByOwnerTokenEndpoint endpoint.Endpoint }
Endpoints collects all of the endpoints that compose a session management service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
type Service ¶
type Service interface { CreateSession(ctx context.Context, session *sessions.Session) (*sessions.Session, error) FindSessionByToken(ctx context.Context, token string) (*sessions.Session, error) DeleteSessionByToken(ctx context.Context, token string) (*sessions.Session, error) DeleteSessionsByOwnerToken(ctx context.Context, ownerToken string) ([]sessions.Session, error) }
Service represents the session management service interface.
func NewService ¶
func NewService(sessionRepo sessions.Repository) Service
NewService returns a new instance of the session management service.