counter

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCounter        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCounter          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCounter = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterCounterServiceServer

func RegisterCounterServiceServer(s *grpc.Server, srv CounterServiceServer)

Types

type CounterServiceClient

type CounterServiceClient interface {
	// Set sets the counter value
	Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
	// Get gets the current counter value
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Increment increments the counter value
	Increment(ctx context.Context, in *IncrementRequest, opts ...grpc.CallOption) (*IncrementResponse, error)
	// Decrement decrements the counter value
	Decrement(ctx context.Context, in *DecrementRequest, opts ...grpc.CallOption) (*DecrementResponse, error)
}

CounterServiceClient is the client API for CounterService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCounterServiceClient

func NewCounterServiceClient(cc *grpc.ClientConn) CounterServiceClient

type CounterServiceServer

type CounterServiceServer interface {
	// Set sets the counter value
	Set(context.Context, *SetRequest) (*SetResponse, error)
	// Get gets the current counter value
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Increment increments the counter value
	Increment(context.Context, *IncrementRequest) (*IncrementResponse, error)
	// Decrement decrements the counter value
	Decrement(context.Context, *DecrementRequest) (*DecrementResponse, error)
}

CounterServiceServer is the server API for CounterService service.

type DecrementRequest

type DecrementRequest struct {
	Headers primitive.RequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Delta   int64                    `protobuf:"varint,2,opt,name=delta,proto3" json:"delta,omitempty"`
}

func (*DecrementRequest) Descriptor

func (*DecrementRequest) Descriptor() ([]byte, []int)

func (*DecrementRequest) GetDelta

func (m *DecrementRequest) GetDelta() int64

func (*DecrementRequest) GetHeaders

func (m *DecrementRequest) GetHeaders() primitive.RequestHeaders

func (*DecrementRequest) Marshal

func (m *DecrementRequest) Marshal() (dAtA []byte, err error)

func (*DecrementRequest) MarshalTo

func (m *DecrementRequest) MarshalTo(dAtA []byte) (int, error)

func (*DecrementRequest) MarshalToSizedBuffer

func (m *DecrementRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DecrementRequest) ProtoMessage

func (*DecrementRequest) ProtoMessage()

func (*DecrementRequest) Reset

func (m *DecrementRequest) Reset()

func (*DecrementRequest) Size

func (m *DecrementRequest) Size() (n int)

func (*DecrementRequest) String

func (m *DecrementRequest) String() string

func (*DecrementRequest) Unmarshal

func (m *DecrementRequest) Unmarshal(dAtA []byte) error

func (*DecrementRequest) XXX_DiscardUnknown

func (m *DecrementRequest) XXX_DiscardUnknown()

func (*DecrementRequest) XXX_Marshal

func (m *DecrementRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DecrementRequest) XXX_Merge

func (m *DecrementRequest) XXX_Merge(src proto.Message)

func (*DecrementRequest) XXX_Size

func (m *DecrementRequest) XXX_Size() int

func (*DecrementRequest) XXX_Unmarshal

func (m *DecrementRequest) XXX_Unmarshal(b []byte) error

type DecrementResponse

type DecrementResponse struct {
	Headers primitive.ResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Value   int64                     `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*DecrementResponse) Descriptor

func (*DecrementResponse) Descriptor() ([]byte, []int)

func (*DecrementResponse) GetHeaders

func (*DecrementResponse) GetValue

func (m *DecrementResponse) GetValue() int64

func (*DecrementResponse) Marshal

func (m *DecrementResponse) Marshal() (dAtA []byte, err error)

func (*DecrementResponse) MarshalTo

func (m *DecrementResponse) MarshalTo(dAtA []byte) (int, error)

func (*DecrementResponse) MarshalToSizedBuffer

func (m *DecrementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DecrementResponse) ProtoMessage

func (*DecrementResponse) ProtoMessage()

func (*DecrementResponse) Reset

func (m *DecrementResponse) Reset()

func (*DecrementResponse) Size

func (m *DecrementResponse) Size() (n int)

func (*DecrementResponse) String

func (m *DecrementResponse) String() string

func (*DecrementResponse) Unmarshal

func (m *DecrementResponse) Unmarshal(dAtA []byte) error

func (*DecrementResponse) XXX_DiscardUnknown

func (m *DecrementResponse) XXX_DiscardUnknown()

func (*DecrementResponse) XXX_Marshal

func (m *DecrementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DecrementResponse) XXX_Merge

func (m *DecrementResponse) XXX_Merge(src proto.Message)

func (*DecrementResponse) XXX_Size

func (m *DecrementResponse) XXX_Size() int

func (*DecrementResponse) XXX_Unmarshal

func (m *DecrementResponse) XXX_Unmarshal(b []byte) error

type GetRequest

type GetRequest struct {
	Headers primitive.RequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
}

func (*GetRequest) Descriptor

func (*GetRequest) Descriptor() ([]byte, []int)

func (*GetRequest) GetHeaders

func (m *GetRequest) GetHeaders() primitive.RequestHeaders

func (*GetRequest) Marshal

func (m *GetRequest) Marshal() (dAtA []byte, err error)

func (*GetRequest) MarshalTo

func (m *GetRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetRequest) MarshalToSizedBuffer

func (m *GetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) Size

func (m *GetRequest) Size() (n int)

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Unmarshal

func (m *GetRequest) Unmarshal(dAtA []byte) error

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (m *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

type GetResponse

type GetResponse struct {
	Headers primitive.ResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Value   int64                     `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*GetResponse) Descriptor

func (*GetResponse) Descriptor() ([]byte, []int)

func (*GetResponse) GetHeaders

func (m *GetResponse) GetHeaders() primitive.ResponseHeaders

func (*GetResponse) GetValue

func (m *GetResponse) GetValue() int64

func (*GetResponse) Marshal

func (m *GetResponse) Marshal() (dAtA []byte, err error)

func (*GetResponse) MarshalTo

func (m *GetResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetResponse) MarshalToSizedBuffer

func (m *GetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) Size

func (m *GetResponse) Size() (n int)

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Unmarshal

func (m *GetResponse) Unmarshal(dAtA []byte) error

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetResponse) XXX_Merge

func (m *GetResponse) XXX_Merge(src proto.Message)

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

func (m *GetResponse) XXX_Unmarshal(b []byte) error

type IncrementRequest

type IncrementRequest struct {
	Headers primitive.RequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Delta   int64                    `protobuf:"varint,2,opt,name=delta,proto3" json:"delta,omitempty"`
}

func (*IncrementRequest) Descriptor

func (*IncrementRequest) Descriptor() ([]byte, []int)

func (*IncrementRequest) GetDelta

func (m *IncrementRequest) GetDelta() int64

func (*IncrementRequest) GetHeaders

func (m *IncrementRequest) GetHeaders() primitive.RequestHeaders

func (*IncrementRequest) Marshal

func (m *IncrementRequest) Marshal() (dAtA []byte, err error)

func (*IncrementRequest) MarshalTo

func (m *IncrementRequest) MarshalTo(dAtA []byte) (int, error)

func (*IncrementRequest) MarshalToSizedBuffer

func (m *IncrementRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IncrementRequest) ProtoMessage

func (*IncrementRequest) ProtoMessage()

func (*IncrementRequest) Reset

func (m *IncrementRequest) Reset()

func (*IncrementRequest) Size

func (m *IncrementRequest) Size() (n int)

func (*IncrementRequest) String

func (m *IncrementRequest) String() string

func (*IncrementRequest) Unmarshal

func (m *IncrementRequest) Unmarshal(dAtA []byte) error

func (*IncrementRequest) XXX_DiscardUnknown

func (m *IncrementRequest) XXX_DiscardUnknown()

func (*IncrementRequest) XXX_Marshal

func (m *IncrementRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IncrementRequest) XXX_Merge

func (m *IncrementRequest) XXX_Merge(src proto.Message)

func (*IncrementRequest) XXX_Size

func (m *IncrementRequest) XXX_Size() int

func (*IncrementRequest) XXX_Unmarshal

func (m *IncrementRequest) XXX_Unmarshal(b []byte) error

type IncrementResponse

type IncrementResponse struct {
	Headers primitive.ResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Value   int64                     `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*IncrementResponse) Descriptor

func (*IncrementResponse) Descriptor() ([]byte, []int)

func (*IncrementResponse) GetHeaders

func (*IncrementResponse) GetValue

func (m *IncrementResponse) GetValue() int64

func (*IncrementResponse) Marshal

func (m *IncrementResponse) Marshal() (dAtA []byte, err error)

func (*IncrementResponse) MarshalTo

func (m *IncrementResponse) MarshalTo(dAtA []byte) (int, error)

func (*IncrementResponse) MarshalToSizedBuffer

func (m *IncrementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IncrementResponse) ProtoMessage

func (*IncrementResponse) ProtoMessage()

func (*IncrementResponse) Reset

func (m *IncrementResponse) Reset()

func (*IncrementResponse) Size

func (m *IncrementResponse) Size() (n int)

func (*IncrementResponse) String

func (m *IncrementResponse) String() string

func (*IncrementResponse) Unmarshal

func (m *IncrementResponse) Unmarshal(dAtA []byte) error

func (*IncrementResponse) XXX_DiscardUnknown

func (m *IncrementResponse) XXX_DiscardUnknown()

func (*IncrementResponse) XXX_Marshal

func (m *IncrementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IncrementResponse) XXX_Merge

func (m *IncrementResponse) XXX_Merge(src proto.Message)

func (*IncrementResponse) XXX_Size

func (m *IncrementResponse) XXX_Size() int

func (*IncrementResponse) XXX_Unmarshal

func (m *IncrementResponse) XXX_Unmarshal(b []byte) error

type Precondition

type Precondition struct {
	// Types that are valid to be assigned to Precondition:
	//	*Precondition_Value
	Precondition isPrecondition_Precondition `protobuf_oneof:"precondition"`
}

func (*Precondition) Descriptor

func (*Precondition) Descriptor() ([]byte, []int)

func (*Precondition) GetPrecondition

func (m *Precondition) GetPrecondition() isPrecondition_Precondition

func (*Precondition) GetValue

func (m *Precondition) GetValue() int64

func (*Precondition) Marshal

func (m *Precondition) Marshal() (dAtA []byte, err error)

func (*Precondition) MarshalTo

func (m *Precondition) MarshalTo(dAtA []byte) (int, error)

func (*Precondition) MarshalToSizedBuffer

func (m *Precondition) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Precondition) ProtoMessage

func (*Precondition) ProtoMessage()

func (*Precondition) Reset

func (m *Precondition) Reset()

func (*Precondition) Size

func (m *Precondition) Size() (n int)

func (*Precondition) String

func (m *Precondition) String() string

func (*Precondition) Unmarshal

func (m *Precondition) Unmarshal(dAtA []byte) error

func (*Precondition) XXX_DiscardUnknown

func (m *Precondition) XXX_DiscardUnknown()

func (*Precondition) XXX_Marshal

func (m *Precondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Precondition) XXX_Merge

func (m *Precondition) XXX_Merge(src proto.Message)

func (*Precondition) XXX_OneofWrappers

func (*Precondition) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Precondition) XXX_Size

func (m *Precondition) XXX_Size() int

func (*Precondition) XXX_Unmarshal

func (m *Precondition) XXX_Unmarshal(b []byte) error

type Precondition_Value

type Precondition_Value struct {
	Value int64 `protobuf:"varint,1,opt,name=value,proto3,oneof" json:"value,omitempty"`
}

func (*Precondition_Value) MarshalTo

func (m *Precondition_Value) MarshalTo(dAtA []byte) (int, error)

func (*Precondition_Value) MarshalToSizedBuffer

func (m *Precondition_Value) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Precondition_Value) Size

func (m *Precondition_Value) Size() (n int)

type SetRequest

type SetRequest struct {
	Headers       primitive.RequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Value         int64                    `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	Preconditions []Precondition           `protobuf:"bytes,3,rep,name=preconditions,proto3" json:"preconditions"`
}

func (*SetRequest) Descriptor

func (*SetRequest) Descriptor() ([]byte, []int)

func (*SetRequest) GetHeaders

func (m *SetRequest) GetHeaders() primitive.RequestHeaders

func (*SetRequest) GetPreconditions

func (m *SetRequest) GetPreconditions() []Precondition

func (*SetRequest) GetValue

func (m *SetRequest) GetValue() int64

func (*SetRequest) Marshal

func (m *SetRequest) Marshal() (dAtA []byte, err error)

func (*SetRequest) MarshalTo

func (m *SetRequest) MarshalTo(dAtA []byte) (int, error)

func (*SetRequest) MarshalToSizedBuffer

func (m *SetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) Reset

func (m *SetRequest) Reset()

func (*SetRequest) Size

func (m *SetRequest) Size() (n int)

func (*SetRequest) String

func (m *SetRequest) String() string

func (*SetRequest) Unmarshal

func (m *SetRequest) Unmarshal(dAtA []byte) error

func (*SetRequest) XXX_DiscardUnknown

func (m *SetRequest) XXX_DiscardUnknown()

func (*SetRequest) XXX_Marshal

func (m *SetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetRequest) XXX_Merge

func (m *SetRequest) XXX_Merge(src proto.Message)

func (*SetRequest) XXX_Size

func (m *SetRequest) XXX_Size() int

func (*SetRequest) XXX_Unmarshal

func (m *SetRequest) XXX_Unmarshal(b []byte) error

type SetResponse

type SetResponse struct {
	Headers primitive.ResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers"`
	Value   int64                     `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*SetResponse) Descriptor

func (*SetResponse) Descriptor() ([]byte, []int)

func (*SetResponse) GetHeaders

func (m *SetResponse) GetHeaders() primitive.ResponseHeaders

func (*SetResponse) GetValue

func (m *SetResponse) GetValue() int64

func (*SetResponse) Marshal

func (m *SetResponse) Marshal() (dAtA []byte, err error)

func (*SetResponse) MarshalTo

func (m *SetResponse) MarshalTo(dAtA []byte) (int, error)

func (*SetResponse) MarshalToSizedBuffer

func (m *SetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) Reset

func (m *SetResponse) Reset()

func (*SetResponse) Size

func (m *SetResponse) Size() (n int)

func (*SetResponse) String

func (m *SetResponse) String() string

func (*SetResponse) Unmarshal

func (m *SetResponse) Unmarshal(dAtA []byte) error

func (*SetResponse) XXX_DiscardUnknown

func (m *SetResponse) XXX_DiscardUnknown()

func (*SetResponse) XXX_Marshal

func (m *SetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetResponse) XXX_Merge

func (m *SetResponse) XXX_Merge(src proto.Message)

func (*SetResponse) XXX_Size

func (m *SetResponse) XXX_Size() int

func (*SetResponse) XXX_Unmarshal

func (m *SetResponse) XXX_Unmarshal(b []byte) error

type UnimplementedCounterServiceServer

type UnimplementedCounterServiceServer struct {
}

UnimplementedCounterServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedCounterServiceServer) Decrement

func (*UnimplementedCounterServiceServer) Get

func (*UnimplementedCounterServiceServer) Increment

func (*UnimplementedCounterServiceServer) Set

type Value

type Value struct {
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Value) Descriptor

func (*Value) Descriptor() ([]byte, []int)

func (*Value) GetValue

func (m *Value) GetValue() int64

func (*Value) Marshal

func (m *Value) Marshal() (dAtA []byte, err error)

func (*Value) MarshalTo

func (m *Value) MarshalTo(dAtA []byte) (int, error)

func (*Value) MarshalToSizedBuffer

func (m *Value) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) Reset

func (m *Value) Reset()

func (*Value) Size

func (m *Value) Size() (n int)

func (*Value) String

func (m *Value) String() string

func (*Value) Unmarshal

func (m *Value) Unmarshal(dAtA []byte) error

func (*Value) XXX_DiscardUnknown

func (m *Value) XXX_DiscardUnknown()

func (*Value) XXX_Marshal

func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value) XXX_Merge

func (m *Value) XXX_Merge(src proto.Message)

func (*Value) XXX_Size

func (m *Value) XXX_Size() int

func (*Value) XXX_Unmarshal

func (m *Value) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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