mctest

package module
v0.0.0-...-9fedac7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Documentation

Overview

Package mctest provides standalone instances of memcache suitable for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fatalf

type Fatalf interface {
	Fatalf(format string, args ...interface{})
}

Fatalf is satisfied by testing.T or testing.B.

type Server

type Server struct {
	Port        int
	StopTimeout time.Duration
	T           Fatalf
	// contains filtered or unexported fields
}

Server is a unique instance of a memcached.

func NewStartedServer

func NewStartedServer(t Fatalf) *Server

NewStartedServer creates a new server starts it.

func (*Server) Addr

func (s *Server) Addr() string

Addr for the server.

func (*Server) Client

func (s *Server) Client() *memcache.Client

Client returns a memcache.Client connected to the underlying server.

func (*Server) Start

func (s *Server) Start()

Start the server, this will return once the server has been started.

func (*Server) Stop

func (s *Server) Stop()

Stop the server.

Jump to

Keyboard shortcuts

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