Documentation ¶
Index ¶
- Variables
- type Endpoints
- func (e Endpoints) CreateSession(ctx context.Context, session *pb.Session) (*pb.Session, error)
- func (e Endpoints) DeleteSessionByToken(ctx context.Context, token string) (*pb.Session, error)
- func (e Endpoints) DeleteSessionsByOwnerToken(ctx context.Context, ownerToken string) ([]*pb.Session, error)
- func (e Endpoints) FindSessionByToken(ctx context.Context, token string) (*pb.Session, error)
- type Option
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when the specified resource was not found. ErrNotFound = errors.New("the specified resource was not found or insufficient permissions") // ErrValidation is returned when the model/parameters validation failed. ErrValidation = errors.New("the request validation failed") )
Functions ¶
This section is empty.
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.
func (Endpoints) CreateSession ¶
CreateSession implements Service.
func (Endpoints) DeleteSessionByToken ¶
DeleteSessionByToken implements Service.
type Option ¶
type Option func(*options)
Option sets an optional parameter for the gRPC client.
func LimiterCapacity ¶
LimiterCapacity sets the capacity of the limiter bucket (tokens/sec).
func LimiterRate ¶
LimiterRate sets the filling rate of the limiter bucket (tokens/sec).
type Service ¶
type Service interface { CreateSession(ctx context.Context, session *pb.Session) (*pb.Session, error) FindSessionByToken(ctx context.Context, token string) (*pb.Session, error) DeleteSessionByToken(ctx context.Context, token string) (*pb.Session, error) DeleteSessionsByOwnerToken(ctx context.Context, ownerToken string) ([]*pb.Session, error) }
Service represents the session management service interface.
func New ¶
func New(conn *grpc.ClientConn, tracer stdopentracing.Tracer, logger log.Logger, opts ...Option) Service
New returns a session management service backed by a gRPC client connection. It is the responsibility of the caller to dial, and later close, the connection.