service

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartGRPCGatewayServer

func StartGRPCGatewayServer(coord *coordinator.Coordinator, grpcAddr string, listenHTTP string)

func StartGRPCServer

func StartGRPCServer(coord *coordinator.Coordinator, storage *stor.Storage, listenAddr string, requestLogging bool)

Types

type CacheService

type CacheService struct {
	pb.UnimplementedCacheServiceServer
	// contains filtered or unexported fields
}

CacheService implements pb.CacheServiceServer.

func NewCacheService

func NewCacheService(coord *coordinator.Coordinator, storage *stor.Storage) *CacheService

NewCacheService creates a new cache service, optionally with clustering support

func (*CacheService) Delete

Delete implementation

func (*CacheService) DeleteIfVersion added in v1.12.0

DeleteIfVersion deletes a key only if its version matches.

func (*CacheService) Get

Streaming Get for large values with byte-range support

func (*CacheService) GetObjectWithVersion added in v1.12.0

func (s *CacheService) GetObjectWithVersion(ctx context.Context, req *pb.GetRequest) (*pb.GetWithVersionResponse, error)

GetObjectWithVersion returns a key's value together with its CAS version.

func (*CacheService) GetStreamWithVersion added in v1.12.0

func (s *CacheService) GetStreamWithVersion(req *pb.GetRequest, stream pb.CacheService_GetStreamWithVersionServer) error

GetStreamWithVersion is the streaming form of GetObjectWithVersion (issue #258): the first message carries version+found, the rest stream the value, so a large object's version and bytes arrive as one atomic snapshot without buffering the whole value server-side.

func (*CacheService) GetTopology

GetTopology returns the current cluster topology (for cluster-aware clients).

func (*CacheService) List

func (s *CacheService) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)

List implements the public List RPC In cluster mode, coordinates K-way merge across all nodes via operations layer Returns a single response with sorted, paginated keys and continuation token

func (*CacheService) ListLocal

func (s *CacheService) ListLocal(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)

ListLocal implements the internal node-local List RPC This is used by the coordinator to query individual nodes in cluster mode Returns sorted, paginated keys from this node's local storage

func (*CacheService) ListLocalWithValues

func (s *CacheService) ListLocalWithValues(ctx context.Context, req *pb.ListRequest) (*pb.ListWithValuesResponse, error)

ListLocalWithValues implements the internal node-local ListWithValues RPC. Returns sorted, paginated key-value pairs from this node's local storage.

func (*CacheService) ListWithValues

func (s *CacheService) ListWithValues(ctx context.Context, req *pb.ListRequest) (*pb.ListWithValuesResponse, error)

ListWithValues implements the public ListWithValues RPC. Returns sorted, paginated key-value pairs with continuation token.

func (*CacheService) Operations

func (s *CacheService) Operations() *operations.Operations

Operations returns the underlying operations layer for embedded use. This allows embedded clients to access the routing logic directly.

func (*CacheService) Put

Streaming Put for large values

func (*CacheService) PutObject

func (s *CacheService) PutObject(ctx context.Context, req *pb.PutRequest) (*pb.PutResponse, error)

PutObject implements the unary REST/HTTP endpoint for cache put

func (*CacheService) PutObjectIfVersion added in v1.12.0

func (s *CacheService) PutObjectIfVersion(ctx context.Context, req *pb.PutIfVersionRequest) (*pb.PutIfVersionResponse, error)

PutObjectIfVersion writes a value only if the key's version matches.

func (*CacheService) PutStreamIfVersion added in v1.12.0

func (s *CacheService) PutStreamIfVersion(stream pb.CacheService_PutStreamIfVersionServer) error

PutStreamIfVersion is the streaming form of PutObjectIfVersion (issue #258): the value is streamed rather than buffered, so it works for objects larger than the unary message cap. Same outcome contract as the unary op — a mismatch is success=false+current_version, a real failure is a gRPC status.

Jump to

Keyboard shortcuts

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