iopool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientClosed = errors.New("memc: client has been closed")
)

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	*bufio.Reader
	*bufio.Writer
	io.Closer
	// contains filtered or unexported fields
}

func (*Buffer) SetHealth

func (b *Buffer) SetHealth(err error)

type Collection

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

func New

func New(instances []string, idle int) *Collection

func (*Collection) Close

func (c *Collection) Close() error

func (*Collection) Get

func (c *Collection) Get(key string) (*Buffer, error)

func (*Collection) Return

func (c *Collection) Return(key string, conn *Buffer)

type Connection

type Connection interface {
	// Read reads data from the connection.
	Read(b []byte) (n int, err error)

	// Write writes data to the connection.
	Write(b []byte) (n int, err error)

	// Close closes the connection.
	Close() error
}

A Connection represents an underlying TCP/Unix socket connection to a single memcached instance.

It may be reused in future requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳