test

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureResponse

type CaptureResponse struct {
	Status int

	Body *bytes.Buffer
	// contains filtered or unexported fields
}

func MakeCaptureResponse

func MakeCaptureResponse() *CaptureResponse

func (*CaptureResponse) Header

func (w *CaptureResponse) Header() http.Header

func (*CaptureResponse) Write

func (w *CaptureResponse) Write(b []byte) (int, error)

func (*CaptureResponse) WriteHeader

func (w *CaptureResponse) WriteHeader(status int)

type FakeMemcacheRing

type FakeMemcacheRing struct {
	MockIncrResults   []int64
	MockIncrKeys      []string
	MockSetValues     []interface{}
	MockGetStructured map[string][]byte
}

Fake MemcacheRing

func (*FakeMemcacheRing) Decr

func (mr *FakeMemcacheRing) Decr(key string, delta int64, timeout int) (int64, error)

func (*FakeMemcacheRing) Delete

func (mr *FakeMemcacheRing) Delete(key string) error

func (*FakeMemcacheRing) Get

func (mr *FakeMemcacheRing) Get(key string) (interface{}, error)

func (*FakeMemcacheRing) GetMulti

func (mr *FakeMemcacheRing) GetMulti(serverKey string, keys []string) (map[string]interface{}, error)

func (*FakeMemcacheRing) GetStructured

func (mr *FakeMemcacheRing) GetStructured(key string, val interface{}) error

func (*FakeMemcacheRing) Incr

func (mr *FakeMemcacheRing) Incr(key string, delta int64, timeout int) (int64, error)

func (*FakeMemcacheRing) Set

func (mr *FakeMemcacheRing) Set(key string, value interface{}, timeout int) error

func (*FakeMemcacheRing) SetMulti

func (mr *FakeMemcacheRing) SetMulti(serverKey string, values map[string]interface{}, timeout int) error

type FakeRing

type FakeRing struct {
	// Overrides for function returns
	MockLocalDevices       []*ring.Device
	MockGetJobNodes        []*ring.Device
	MockGetJobNodesHandoff bool
	MockGetMoreNodes       ring.MoreNodes

	// Used for probe
	MockMoreNodes *ring.Device
	MockDevices   []*ring.Device
}

FakeRing

func (*FakeRing) AllDevices

func (r *FakeRing) AllDevices() (devs []*ring.Device)

func (*FakeRing) GetJobNodes

func (r *FakeRing) GetJobNodes(partition uint64, localDevice int) (response []*ring.Device, handoff bool)

func (*FakeRing) GetMoreNodes

func (r *FakeRing) GetMoreNodes(partition uint64) ring.MoreNodes

func (*FakeRing) GetNodes

func (r *FakeRing) GetNodes(partition uint64) (response []*ring.Device)

func (*FakeRing) GetPartition

func (r *FakeRing) GetPartition(account string, container string, object string) uint64

func (*FakeRing) LocalDevices

func (r *FakeRing) LocalDevices(localPort int) (devs []*ring.Device, err error)

func (*FakeRing) PartitionCount

func (r *FakeRing) PartitionCount() uint64

func (*FakeRing) PartitionForHash added in v1.2.0

func (r *FakeRing) PartitionForHash(hsh uint64) uint64

func (*FakeRing) ReplicaCount

func (r *FakeRing) ReplicaCount() uint64

type MockResponseWriter

type MockResponseWriter struct {
	SaveHeader *http.Header
	StatusMap  map[string]int
}

func (MockResponseWriter) Header

func (m MockResponseWriter) Header() (h http.Header)

func (MockResponseWriter) Write

func (m MockResponseWriter) Write(p []byte) (n int, err error)

func (MockResponseWriter) WriteHeader

func (m MockResponseWriter) WriteHeader(s int)

func (MockResponseWriter) WriteString

func (m MockResponseWriter) WriteString(s string) (n int, err error)

Jump to

Keyboard shortcuts

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