client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyRouter

type KeyRouter[T comparable] interface {
	// Target returns the remote cache server service address of
	// the cache key. If the cache do not exist in any node, it
	// returns empty string.
	Target(k T) string

	// AddItem pushes a item into a queue with a local
	// cache server service address in the item. Gossip will take
	// all the items and send them to other nodes in gossip cluster.
	AddItem(item gossip.CommonItem)
}

KeyRouter is an interface manages the remote cache information.

type QueryClient

type QueryClient interface {
	ServiceID() string
	// SendMessage send message to a cache server.
	SendMessage(ctx context.Context, address string, req *pb.Request) (*pb.Response, error)
	// NewRequest creates a new request by cmd method.
	NewRequest(pb.CmdMethod) *pb.Request
	// Release releases the response.
	Release(*pb.Response)
	// Close closes the cache client.
	Close() error
}

func NewQueryClient

func NewQueryClient(sid string, cfg morpc.Config) (QueryClient, error)

Jump to

Keyboard shortcuts

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