counter

package
v0.0.0-...-bfc3bc0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService() (server.Service, error)

NewService returns a new Service

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

type Service

type Service struct {
	server.Service
}

Service is an implementation of counter api service.

func (Service) Register

func (s Service) Register(r *grpc.Server)

Register registers the counter service

Jump to

Keyboard shortcuts

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