sessionmanagement

package
v0.0.0-...-bb13912 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGRPCCreateSessionRequest

func DecodeGRPCCreateSessionRequest(_ context.Context, request interface{}) (interface{}, error)

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

func DecodeHTTPCreateSessionRequest(_ context.Context, r *http.Request) (interface{}, error)

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

func DecodeHTTPFindSessionByTokenRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeHTTPFindSessionByTokenRequest is a transport/http.DecodeRequestFunc that decodes the JSON-encoded request from the HTTP request body.

func EncodeGRPCCreateSessionResponse

func EncodeGRPCCreateSessionResponse(_ context.Context, response interface{}) (interface{}, error)

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

func MakeCreateSessionEndpoint(s Service) endpoint.Endpoint

MakeCreateSessionEndpoint returns an endpoint that invokes CreateSession on the service.

func MakeDeleteSessionByTokenEndpoint

func MakeDeleteSessionByTokenEndpoint(s Service) endpoint.Endpoint

MakeDeleteSessionByTokenEndpoint returns an endpoint that invokes DeleteSessionByToken on the service.

func MakeDeleteSessionsByOwnerTokenEndpoint

func MakeDeleteSessionsByOwnerTokenEndpoint(s Service) endpoint.Endpoint

MakeDeleteSessionsByOwnerTokenEndpoint returns an endpoint that invokes DeleteSessionsByOwnerToken on the service.

func MakeFindSessionByTokenEndpoint

func MakeFindSessionByTokenEndpoint(s Service) endpoint.Endpoint

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.

func MakeHTTPHandler

func MakeHTTPHandler(ctx context.Context, endpoints Endpoints, tracer stdopentracing.Tracer, logger log.Logger) http.Handler

MakeHTTPHandler returns a handler that makes a set of endpoints available on predefined paths.

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.

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL