Documentation ¶
Index ¶
- func GetSugaredZapLogger(logFile string, errFile string, verbose bool) *zap.SugaredLogger
- func LoadTLSCredentials(certDir string) (credentials.TransportCredentials, error)
- func NewCacheClient(cert_dir string, server_host string, server_port int, enableHTTPS bool) (pb.CacheServiceClient, error)
- type ClientWrapper
- func (c *ClientWrapper) Get(key string) (string, error)
- func (c *ClientWrapper) GetGrpc(key string) (string, error)
- func (c *ClientWrapper) Put(key string, value string) error
- func (c *ClientWrapper) PutGrpc(key string, value string) error
- func (c *ClientWrapper) StartClusterConfigWatcher(shutdownChan <-chan bool)
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSugaredZapLogger ¶
func GetSugaredZapLogger(logFile string, errFile string, verbose bool) *zap.SugaredLogger
Set up logger at the specified verbosity level
func LoadTLSCredentials ¶
func LoadTLSCredentials(certDir string) (credentials.TransportCredentials, error)
Utility function to set up mTLS config and credentials
func NewCacheClient ¶
func NewCacheClient(cert_dir string, server_host string, server_port int, enableHTTPS bool) (pb.CacheServiceClient, error)
Utility funciton to get a new Cache Client which uses gRPC secured with mTLS
Types ¶
type ClientWrapper ¶
type ClientWrapper struct { Config nodelib.NodesConfig Ring *ring.Ring Logger *zap.SugaredLogger CertDir string }
Client wrapper for interacting with Identity Server
func NewClientWrapper ¶
func NewClientWrapper(certDir string, configFile string, insecure bool, verbose bool) *ClientWrapper
Create new Client struct instance and sets up node ring with consistent hashing
func (*ClientWrapper) Get ¶
func (c *ClientWrapper) Get(key string) (string, error)
Get item from cache. Hash the key to find which node has the value stored.
func (*ClientWrapper) Put ¶
func (c *ClientWrapper) Put(key string, value string) error
Put key-value pair into cache. Hash the key to find which node to store it in.
func (*ClientWrapper) StartClusterConfigWatcher ¶
func (c *ClientWrapper) StartClusterConfigWatcher(shutdownChan <-chan bool)
Checks cluster config every 5 seconds and updates ring with any changes. Runs in infinite loop.
Click to show internal directories.
Click to hide internal directories.