handler

package
v0.0.0-...-96d424b Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Addr    string
	Ch      chan bool
	Storage StorageEngine
}

func NewServer

func NewServer() Cache

NewServer.

func (*Cache) Delete

func (cache *Cache) Delete(body []byte, cli *Client)

Delete 删除操作.

func (*Cache) NewClient

func (c *Cache) NewClient(conn net.Conn) *Client

func (*Cache) Read

func (cache *Cache) Read(body []byte, cli *Client)

Read 读操作.

func (*Cache) Start

func (cache *Cache) Start()

Start.

func (*Cache) Write

func (cache *Cache) Write(body []byte, cli *Client)

Write 写操作

type Client

type Client struct {
	Conn net.Conn
	IP   string
}

func (*Client) Write

func (cli *Client) Write(msg string, num errcode.BigcacheError)

Write.

type Storage

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

func (*Storage) Delete

func (s *Storage) Delete(key string) error

Delete 删除.

func (*Storage) Read

func (s *Storage) Read(key string) (str string, err error)

Read 读取操作.

func (*Storage) Write

func (s *Storage) Write(key, value string) error

Write 写操作.

type StorageEngine

type StorageEngine interface {
	Write(key, val string) error
	Read(key string) (string, error)
	Delete(key string) error
}

func NewStorage

func NewStorage(path string) StorageEngine

Jump to

Keyboard shortcuts

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