cache

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_cache_proto protoreflect.FileDescriptor

Functions

func NewCacheEndpoints

func NewCacheEndpoints() []*api.Endpoint

func RegisterCacheHandler

func RegisterCacheHandler(s server.Server, hdlr CacheHandler, opts ...server.HandlerOption) error

Types

type CacheService

type CacheService interface {
	Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error)
	Set(ctx context.Context, in *SetRequest, opts ...client.CallOption) (*SetResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
	Increment(ctx context.Context, in *IncrementRequest, opts ...client.CallOption) (*IncrementResponse, error)
	Decrement(ctx context.Context, in *DecrementRequest, opts ...client.CallOption) (*DecrementResponse, error)
}

func NewCacheService

func NewCacheService(name string, c client.Client) CacheService

type DecrementRequest

type DecrementRequest struct {

	// The key to decrement
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The delta value to decrement
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Decrement a value (if its a number)

func (*DecrementRequest) Descriptor deprecated

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

Deprecated: Use DecrementRequest.ProtoReflect.Descriptor instead.

func (*DecrementRequest) GetKey

func (x *DecrementRequest) GetKey() string

func (*DecrementRequest) GetValue

func (x *DecrementRequest) GetValue() int64

func (*DecrementRequest) ProtoMessage

func (*DecrementRequest) ProtoMessage()

func (*DecrementRequest) ProtoReflect

func (x *DecrementRequest) ProtoReflect() protoreflect.Message

func (*DecrementRequest) Reset

func (x *DecrementRequest) Reset()

func (*DecrementRequest) String

func (x *DecrementRequest) String() string

type DecrementResponse

type DecrementResponse struct {

	// The key of the item
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The result value of the item
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*DecrementResponse) Descriptor deprecated

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

Deprecated: Use DecrementResponse.ProtoReflect.Descriptor instead.

func (*DecrementResponse) GetKey

func (x *DecrementResponse) GetKey() string

func (*DecrementResponse) GetValue

func (x *DecrementResponse) GetValue() int64

func (*DecrementResponse) ProtoMessage

func (*DecrementResponse) ProtoMessage()

func (*DecrementResponse) ProtoReflect

func (x *DecrementResponse) ProtoReflect() protoreflect.Message

func (*DecrementResponse) Reset

func (x *DecrementResponse) Reset()

func (*DecrementResponse) String

func (x *DecrementResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// The key to delete
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

Delete a value from the cache

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetKey

func (x *DeleteRequest) GetKey() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {

	// Returns "ok" if successful
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetStatus

func (x *DeleteResponse) GetStatus() string

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type GetRequest

type GetRequest struct {

	// The key to retrieve
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

Get an item from the cache by key

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {

	// The key
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The value
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Time to live in seconds
	Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetKey

func (x *GetResponse) GetKey() string

func (*GetResponse) GetTtl

func (x *GetResponse) GetTtl() int64

func (*GetResponse) GetValue

func (x *GetResponse) GetValue() string

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

func (x *GetResponse) ProtoReflect() protoreflect.Message

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type IncrementRequest

type IncrementRequest struct {

	// The key to increment
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The value to add
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Increment a value (if its a number)

func (*IncrementRequest) Descriptor deprecated

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

Deprecated: Use IncrementRequest.ProtoReflect.Descriptor instead.

func (*IncrementRequest) GetKey

func (x *IncrementRequest) GetKey() string

func (*IncrementRequest) GetValue

func (x *IncrementRequest) GetValue() int64

func (*IncrementRequest) ProtoMessage

func (*IncrementRequest) ProtoMessage()

func (*IncrementRequest) ProtoReflect

func (x *IncrementRequest) ProtoReflect() protoreflect.Message

func (*IncrementRequest) Reset

func (x *IncrementRequest) Reset()

func (*IncrementRequest) String

func (x *IncrementRequest) String() string

type IncrementResponse

type IncrementResponse struct {

	// The key incremented
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The result value
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*IncrementResponse) Descriptor deprecated

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

Deprecated: Use IncrementResponse.ProtoReflect.Descriptor instead.

func (*IncrementResponse) GetKey

func (x *IncrementResponse) GetKey() string

func (*IncrementResponse) GetValue

func (x *IncrementResponse) GetValue() int64

func (*IncrementResponse) ProtoMessage

func (*IncrementResponse) ProtoMessage()

func (*IncrementResponse) ProtoReflect

func (x *IncrementResponse) ProtoReflect() protoreflect.Message

func (*IncrementResponse) Reset

func (x *IncrementResponse) Reset()

func (*IncrementResponse) String

func (x *IncrementResponse) String() string

type SetRequest

type SetRequest struct {

	// The key to update
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The value to set
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Time to live in seconds
	Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

Set an item in the cache

func (*SetRequest) Descriptor deprecated

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

Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.

func (*SetRequest) GetKey

func (x *SetRequest) GetKey() string

func (*SetRequest) GetTtl

func (x *SetRequest) GetTtl() int64

func (*SetRequest) GetValue

func (x *SetRequest) GetValue() string

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) ProtoReflect

func (x *SetRequest) ProtoReflect() protoreflect.Message

func (*SetRequest) Reset

func (x *SetRequest) Reset()

func (*SetRequest) String

func (x *SetRequest) String() string

type SetResponse

type SetResponse struct {

	// Returns "ok" if successful
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*SetResponse) Descriptor deprecated

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

Deprecated: Use SetResponse.ProtoReflect.Descriptor instead.

func (*SetResponse) GetStatus

func (x *SetResponse) GetStatus() string

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) ProtoReflect

func (x *SetResponse) ProtoReflect() protoreflect.Message

func (*SetResponse) Reset

func (x *SetResponse) Reset()

func (*SetResponse) String

func (x *SetResponse) String() string

Jump to

Keyboard shortcuts

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