Documentation ¶
Index ¶
- func NewService() (server.Service, error)
- type Server
- func (s *Server) CheckAndSet(ctx context.Context, request *api.CheckAndSetRequest) (*api.CheckAndSetResponse, error)
- func (s *Server) Close(ctx context.Context, request *api.CloseRequest) (*api.CloseResponse, error)
- func (s *Server) Create(ctx context.Context, request *api.CreateRequest) (*api.CreateResponse, error)
- func (s *Server) Decrement(ctx context.Context, request *api.DecrementRequest) (*api.DecrementResponse, error)
- func (s *Server) Get(ctx context.Context, request *api.GetRequest) (*api.GetResponse, error)
- func (s *Server) Increment(ctx context.Context, request *api.IncrementRequest) (*api.IncrementResponse, error)
- func (s *Server) Set(ctx context.Context, request *api.SetRequest) (*api.SetResponse, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct { api.CounterServiceServer *service.Server }
Server is an implementation of CounterServiceServer for the counter primitive
func (*Server) CheckAndSet ¶
func (s *Server) CheckAndSet(ctx context.Context, request *api.CheckAndSetRequest) (*api.CheckAndSetResponse, error)
CheckAndSet updates the value of the counter conditionally
func (*Server) Close ¶
func (s *Server) Close(ctx context.Context, request *api.CloseRequest) (*api.CloseResponse, error)
Close closes a session
func (*Server) Create ¶
func (s *Server) Create(ctx context.Context, request *api.CreateRequest) (*api.CreateResponse, error)
Create opens a new session
func (*Server) Decrement ¶
func (s *Server) Decrement(ctx context.Context, request *api.DecrementRequest) (*api.DecrementResponse, error)
Decrement decrements the value of the counter by a delta
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, request *api.GetRequest) (*api.GetResponse, error)
Get gets the current value of the counter
func (*Server) Increment ¶
func (s *Server) Increment(ctx context.Context, request *api.IncrementRequest) (*api.IncrementResponse, error)
Increment increments the value of the counter by a delta
func (*Server) Set ¶
func (s *Server) Set(ctx context.Context, request *api.SetRequest) (*api.SetResponse, error)
Set sets the current value of the counter
Click to show internal directories.
Click to hide internal directories.