Documentation
¶
Index ¶
- Constants
- type SingletonProvider
- func (sp SingletonProvider) ReadSingleton(ctx context.Context, name string, f singleton.NewReaderFunc, obj interface{}) error
- func (sp SingletonProvider) SetDialer(dialer func(network, addr string, timeout time.Duration) (net.Conn, error))
- func (sp SingletonProvider) WriteSingleton(ctx context.Context, name string, f singleton.NewWriteCloserFunc, ...) error
Constants ¶
View Source
const Chunksize = 950000 // A single memcache item can't be bigger than 1000000 bytes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SingletonProvider ¶
type SingletonProvider struct { *mclib.Client ErrIfNotFound bool // By default, we swallow 'item not found' errors. ShardCount int // defaults to no sharding. Set this if you need to store >Chunksize }
func NewProvider ¶
func NewProvider(servers ...string) SingletonProvider
func (SingletonProvider) ReadSingleton ¶
func (sp SingletonProvider) ReadSingleton(ctx context.Context, name string, f singleton.NewReaderFunc, obj interface{}) error
func (SingletonProvider) WriteSingleton ¶
func (sp SingletonProvider) WriteSingleton(ctx context.Context, name string, f singleton.NewWriteCloserFunc, obj interface{}) error
Click to show internal directories.
Click to hide internal directories.