client

package module
v0.0.0-...-236754e Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

README

.. SPDX-License-Identifier: BSD-3-Clause
.. Copyright (C) 2025, Shu De Zheng <[email protected]>. All Rights Reserved.

====================
UMEM-CACHE-CLIENT-GO
====================
UMEM-CACHE-CLIENT-GO is an UMEM-CACHE client written in Go. This is also the
test project of UMEM-CACHE.

Multilingual 多语言
==================

- `简体中文 <https://github.com/imchuncai/umem-cache-client-Go/tree/master/Documentation/translations/zh_CN/README.rst>`_

TEST SOURCE CODE
================
::

	make SRC=../umem-cache

TEST EXECUTABLE
===============
::

	make EXE=../umem-cache/umem-cache RAFT=0 TLS=0 DEBUG=0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminChangeCluster

func AdminChangeCluster(deadline time.Time, fromAddresses, toAddresses []string, config *tls.Config) error

Note: change may not really happen, you can check by AdminClusterMatch()

func AdminCluster

func AdminCluster(deadline time.Time, address string, config *tls.Config) (proto.Cluster, error)

func AdminClusterMatch

func AdminClusterMatch(deadline time.Time, addresses []string, config *tls.Config) error

func AdminInitCluster

func AdminInitCluster(deadline time.Time, addresses []string, config *tls.Config) error

func AdminLeader

func AdminLeader(deadline time.Time, address string, config *tls.Config) (string, error)

func AdminLeaderCluster

func AdminLeaderCluster(deadline time.Time, addresses []string, config *tls.Config) (string, proto.Cluster, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
Example
client, err := exampleClient()
if err != nil {
	log.Fatal(err)
}
defer client.Close()

exampleGetOrSet(client)
Output:

umem-cache

func New

func New(address string, config Config) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Del

func (c *Client) Del(key []byte) error
Example
client, err := exampleClient()
if err != nil {
	log.Fatal(err)
}
defer client.Close()

exampleDel(client)
Output:

<nil>

func (*Client) GetOrSet

func (c *Client) GetOrSet(key []byte, get proto.FallbackGetFunc) ([]byte, error)

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster(addresses []string, config Config) (*Cluster, error)

func (*Cluster) Close

func (c *Cluster) Close()

func (*Cluster) Del

func (c *Cluster) Del(key []byte) error
Example
cluster, err := exampleCluster()
if err != nil {
	log.Fatal(err)
}
defer cluster.Close()

exampleDel(cluster)
Output:

<nil>

func (*Cluster) GetOrSet

func (c *Cluster) GetOrSet(key []byte, fallbackGet proto.FallbackGetFunc) (val []byte, err error)
Example
cluster, err := exampleCluster()
if err != nil {
	log.Fatal(err)
}
defer cluster.Close()

exampleGetOrSet(cluster)
Output:

umem-cache

type Config

type Config struct {
	Timeout           time.Duration
	ThreadNR          int
	MaxConnsPerThread int
	TLSConfig         *tls.Config
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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