Documentation ¶
Index ¶
- Variables
- func NewClientError(msg string) error
- func NewServerError(msg string) error
- type Client
- type ErrBrokenPipe
- type ErrClientError
- type ErrServerError
- type FlushWriter
- type MDelOptions
- type MDelResponse
- type MDelResponseType
- type MGetFlags
- type MGetOptions
- type MGetResponse
- type MGetResponseType
- type MSetOptions
- type MSetResponse
- type MSetResponseType
- type Option
- type Pipeline
- func (p *Pipeline) Execute()
- func (p *Pipeline) Finish()
- func (p *Pipeline) FlushAll() func() error
- func (p *Pipeline) MDel(key string, opts MDelOptions) func() (MDelResponse, error)
- func (p *Pipeline) MGet(key string, opts MGetOptions) func() (MGetResponse, error)
- func (p *Pipeline) MSet(key string, value []byte, opts MSetOptions) func() (MSetResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyGotten = errors.New("pipeline error: already gotten")
ErrAlreadyGotten ...
var ErrConnClosed = errors.New("memcache: connection closed")
ErrConnClosed ...
var ErrInvalidKeyFormat = errors.New("memcached: invalid key format")
ErrInvalidKeyFormat ...
var ErrInvalidMDel = ErrBrokenPipe{/* contains filtered or unexported fields */}
ErrInvalidMDel ...
var ErrInvalidMGet = ErrBrokenPipe{/* contains filtered or unexported fields */}
ErrInvalidMGet ...
var ErrInvalidMSet = ErrBrokenPipe{/* contains filtered or unexported fields */}
ErrInvalidMSet ...
var ErrInvalidResponse = ErrBrokenPipe{/* contains filtered or unexported fields */}
ErrInvalidResponse ...
Functions ¶
Types ¶
type ErrBrokenPipe ¶
type ErrBrokenPipe struct {
// contains filtered or unexported fields
}
ErrBrokenPipe ...
func (ErrBrokenPipe) Error ¶
func (e ErrBrokenPipe) Error() string
type ErrClientError ¶
type ErrClientError struct {
Message string
}
ErrClientError ...
func (ErrClientError) Error ¶
func (e ErrClientError) Error() string
type ErrServerError ¶
type ErrServerError struct {
Message string
}
ErrServerError ...
func (ErrServerError) Error ¶
func (e ErrServerError) Error() string
type FlushWriter ¶
FlushWriter ...
type MDelOptions ¶
type MDelOptions struct { CAS uint64 I bool // set as stale instead of delete completely TTL uint32 // only apply if I = true }
MDelOptions ...
type MDelResponseType ¶
type MDelResponseType int
MDelResponseType ...
const ( // MDelResponseTypeHD ... MDelResponseTypeHD MDelResponseType = iota + 1 // DELETED // MDelResponseTypeNF ... MDelResponseTypeNF // NOT FOUND // MDelResponseTypeEX ... MDelResponseTypeEX // EXISTS, cas not match )
type MGetOptions ¶
MGetOptions ...
type MGetResponse ¶
type MGetResponse struct { Type MGetResponseType Data []byte Flags MGetFlags CAS uint64 }
MGetResponse ...
type MGetResponseType ¶
type MGetResponseType int
MGetResponseType ...
const ( // MGetResponseTypeVA ... MGetResponseTypeVA MGetResponseType = iota + 1 // MGetResponseTypeHD ... MGetResponseTypeHD // MGetResponseTypeEN ... MGetResponseTypeEN )
type MSetResponseType ¶
type MSetResponseType int
MSetResponseType ...
const ( // MSetResponseTypeHD ... MSetResponseTypeHD MSetResponseType = iota + 1 // STORED // MSetResponseTypeNS ... MSetResponseTypeNS // NOT STORED // MSetResponseTypeEX ... MSetResponseTypeEX // EXISTS, cas modified // MSetResponseTypeNF ... MSetResponseTypeNF // NOT FOUND, cas not found )
type Option ¶
type Option func(opts *memcacheOptions)
Option ...
func WithBufferSize ¶ added in v0.3.2
WithBufferSize change receiving & sending buffer size
func WithDialErrorLogger ¶ added in v0.3.5
WithDialErrorLogger set the dial error logger
func WithDialFunc ¶ added in v0.4.0
WithDialFunc ...
func WithRetryDuration ¶
WithRetryDuration duration between TCP connection retry
func WithTCPKeepAliveDuration ¶ added in v0.3.4
WithTCPKeepAliveDuration sets the tcp keep alive duration
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline should NOT be used concurrently
func (*Pipeline) Execute ¶ added in v0.3.0
func (p *Pipeline) Execute()
Execute flush operations to memcached (interrupts pipelining)
func (*Pipeline) MDel ¶
func (p *Pipeline) MDel(key string, opts MDelOptions) func() (MDelResponse, error)
MDel ...
func (*Pipeline) MGet ¶
func (p *Pipeline) MGet(key string, opts MGetOptions) func() (MGetResponse, error)
MGet ...
func (*Pipeline) MSet ¶
func (p *Pipeline) MSet(key string, value []byte, opts MSetOptions) func() (MSetResponse, error)
MSet ...