Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(s bandmaster.Service) *memcache.Client
Client returns the underlying `memcache.Client` of the given service.
It assumes that the service is ready; i.e. it might return nil if it's actually not.
NOTE: This will panic if `s` is not a `memcached.Service`.
func New ¶
func New(c *Config) bandmaster.Service
New creates a new Memcached service using the provided parameters. You may use the helpers for environment-based configuration to get a pre-configured `Config` with sane defaults.
It doesn't open any connection nor does it do any kind of I/O; i.e. it cannot fail.
Types ¶
type Env ¶
type Env struct { Addrs []string `envconfig:"ADDRS" default:"localhost:11211"` TimeoutRW time.Duration `envconfig:"TIMEOUT_RW" default:"2s"` }
Env can be used to configure a Memcached session via the environment.
It comes with sane defaults for a local development set-up.
type Service ¶
type Service struct { *bandmaster.ServiceBase // "inheritance" // contains filtered or unexported fields }
Service implements a Memcached service based on the 'rainycape/memcached' package.
func (*Service) Start ¶
Start opens a connection and PINGs the server: if everything goes smoothly, the service is marked as 'started'; otherwise, an error is returned.
Start is used by BandMaster's internal machinery, it shouldn't ever be called directly by the end-user of the service.