client

package
v0.0.0-...-b5ceec6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a memcached client.

Please note that this is NOT a full fledged client. It is only meant to be a sample on how one could use the memdproto package to implement a tool that is capable of handling memcached protocol.

func New

func New(servers ...string) *Client

func (*Client) MetaDelete

func (c *Client) MetaDelete(key string) *MetaDeleteCmd

func (*Client) MetaGet

func (c *Client) MetaGet(key string) *MetaGetCmd

func (*Client) MetaSet

func (c *Client) MetaSet(key string, data []byte) *MetaSetCmd

func (*Client) Servers

func (c *Client) Servers() []string

type Command

type Command interface {
	Key() string
}

type MetaDeleteCmd

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

func (*MetaDeleteCmd) Do

func (*MetaDeleteCmd) Key

func (cmd *MetaDeleteCmd) Key() string

type MetaDeleteResult

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

func (*MetaDeleteResult) Deleted

func (cmd *MetaDeleteResult) Deleted() bool

func (*MetaDeleteResult) Exists

func (cmd *MetaDeleteResult) Exists() bool

func (*MetaDeleteResult) NotFound

func (cmd *MetaDeleteResult) NotFound() bool

type MetaGetCmd

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

MetaGetCmd encapsulates the interaction between the server and the client for the MetaGet command.

func (*MetaGetCmd) Cas

func (cmd *MetaGetCmd) Cas(v bool) *MetaGetCmd

func (*MetaGetCmd) Do

func (cmd *MetaGetCmd) Do(ctx context.Context) (*MetaGetResult, error)

func (*MetaGetCmd) Key

func (cmd *MetaGetCmd) Key() string

func (*MetaGetCmd) Opaque

func (cmd *MetaGetCmd) Opaque(v []byte) *MetaGetCmd

type MetaGetResult

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

func (*MetaGetResult) Hit

func (mr *MetaGetResult) Hit() bool

func (*MetaGetResult) Miss

func (mr *MetaGetResult) Miss() bool

func (*MetaGetResult) Value

func (mr *MetaGetResult) Value() []byte

type MetaSetCmd

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

func (*MetaSetCmd) Do

func (cmd *MetaSetCmd) Do(ctx context.Context) (*MetaSetResult, error)

func (*MetaSetCmd) Key

func (cmd *MetaSetCmd) Key() string

type MetaSetResult

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

func (*MetaSetResult) Stored

func (mr *MetaSetResult) Stored() bool

type ModulusSelector

type ModulusSelector struct {
}

func (*ModulusSelector) Select

func (s *ModulusSelector) Select(c *Client, cmd Command) (string, error)

type ServerSelector

type ServerSelector interface {
	Select(*Client, Command) (string, error)
}

Jump to

Keyboard shortcuts

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