memcache

package module
v3.0.0-...-1524b23 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

README

MemCache

Installation

go get -u github.com/gojuukaze/YTask/drives/memcache/v3

Backend

package main

import (
    "github.com/gojuukaze/YTask/drives/memcache/v3"
)

func main() {
	backend := memcache.NewMemCacheBackend([]string{"127.0.0.1:11211"}, 10)
	// ...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Server   []string
	PoolSize int
	// contains filtered or unexported fields
}

func NewMemCacheClient

func NewMemCacheClient(server []string, poolSize int) *Client

NewMemCacheClient

  • server: ["host:port"]

func (*Client) Check

func (c *Client) Check() error

func (*Client) Close

func (c *Client) Close()

func (*Client) Dail

func (c *Client) Dail()

func (*Client) Flush

func (c *Client) Flush() error

func (*Client) Get

func (c *Client) Get(key string) ([]byte, error)

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) Set

func (c *Client) Set(key string, value []byte, exTime int) error

type MemCacheBackend

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

func NewMemCacheBackend

func NewMemCacheBackend(server []string, poolSize int) MemCacheBackend

func (*MemCacheBackend) Activate

func (r *MemCacheBackend) Activate()

func (MemCacheBackend) Clone

func (*MemCacheBackend) GetPoolSize

func (r *MemCacheBackend) GetPoolSize() int

func (*MemCacheBackend) GetResult

func (r *MemCacheBackend) GetResult(key string) (message.Result, error)

func (*MemCacheBackend) SetPoolSize

func (r *MemCacheBackend) SetPoolSize(n int)

func (*MemCacheBackend) SetResult

func (r *MemCacheBackend) SetResult(result message.Result, exTime int) error

Jump to

Keyboard shortcuts

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