Documentation ¶
Index ¶
- Variables
- func NewCacheEndpoints() []*api.Endpoint
- func RegisterCacheHandler(s server.Server, hdlr CacheHandler, opts ...server.HandlerOption) error
- type CacheHandler
- type CacheService
- type DeleteRequest
- type DeleteResponse
- type GetRequest
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetResponse) GetExpiration() string
- func (x *GetResponse) GetValue() string
- func (*GetResponse) ProtoMessage()
- func (x *GetResponse) ProtoReflect() protoreflect.Message
- func (x *GetResponse) Reset()
- func (x *GetResponse) String() string
- type PutRequest
- func (*PutRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PutRequest) GetDuration() string
- func (x *PutRequest) GetKey() string
- func (x *PutRequest) GetValue() string
- func (*PutRequest) ProtoMessage()
- func (x *PutRequest) ProtoReflect() protoreflect.Message
- func (x *PutRequest) Reset()
- func (x *PutRequest) String() string
- type PutResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_cache_proto protoreflect.FileDescriptor
Functions ¶
func NewCacheEndpoints ¶
func RegisterCacheHandler ¶
func RegisterCacheHandler(s server.Server, hdlr CacheHandler, opts ...server.HandlerOption) error
Types ¶
type CacheHandler ¶
type CacheHandler interface { // Get receives a value and its time to live by key from the cache. Get(context.Context, *GetRequest, *GetResponse) error // Put stores a value and its time to live in the cache. Put(context.Context, *PutRequest, *PutResponse) error // Delete removes a key from the cache. Delete(context.Context, *DeleteRequest, *DeleteResponse) error }
type CacheService ¶
type CacheService interface { // Get receives a value and its time to live by key from the cache. Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) // Put stores a value and its time to live in the cache. Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error) // Delete removes a key from the cache. Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) }
func NewCacheService ¶
func NewCacheService(name string, c client.Client) CacheService
type DeleteRequest ¶
type DeleteRequest struct { // The key to remove from the cache. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
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 {
// contains filtered or unexported fields
}
func (*DeleteResponse) Descriptor
deprecated
func (*DeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
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 fetch from the cache. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
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 value retrieved from the cache. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // The value's expiration datetime. Expiration string `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetExpiration ¶
func (x *GetResponse) GetExpiration() string
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 PutRequest ¶
type PutRequest struct { // The key to store in the cache. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The value to store in the cache. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // The value's time to live. Parsed using time.ParseDuration. 0 means // it doesn't expire. Duration string `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` // contains filtered or unexported fields }
func (*PutRequest) Descriptor
deprecated
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetDuration ¶
func (x *PutRequest) GetDuration() string
func (*PutRequest) GetKey ¶
func (x *PutRequest) GetKey() string
func (*PutRequest) GetValue ¶
func (x *PutRequest) GetValue() string
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶
func (x *PutRequest) ProtoReflect() protoreflect.Message
func (*PutRequest) Reset ¶
func (x *PutRequest) Reset()
func (*PutRequest) String ¶
func (x *PutRequest) String() string
type PutResponse ¶
type PutResponse struct {
// contains filtered or unexported fields
}
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
Click to show internal directories.
Click to hide internal directories.