fakes

package
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//VcapServicesFormatter -
	VcapServicesFormatter = `` /* 461-byte string literal not displayed */

	//VcapApplicationFormatter -
	VcapApplicationFormatter = `` /* 507-byte string literal not displayed */

)

Variables

View Source
var (
	//FakeKeyCheck -
	FakeKeyCheck martini.Handler = func(log *log.Logger, res http.ResponseWriter, req *http.Request) {}

	//MockLogger -
	MockLogger = log.New(&buf, "logger: ", log.Lshortfile)
)

Functions

func FakeNewCollectionDialer

func FakeNewCollectionDialer(c taskmanager.Task) func(url, dbname, collectionname string) (col integrations.Collection, err error)

FakeNewCollectionDialer -

Types

type FakeCollection

type FakeCollection struct {
	mgo.Collection
	ControlTask taskmanager.Task
	ErrControl  error
}

FakeCollection -

func (*FakeCollection) Close

func (s *FakeCollection) Close()

Close -

func (*FakeCollection) FindAndModify added in v0.0.62

func (s *FakeCollection) FindAndModify(selector interface{}, update interface{}, result interface{}) (info *mgo.ChangeInfo, err error)

FindAndModify -

func (*FakeCollection) FindOne

func (s *FakeCollection) FindOne(id string, result interface{}) (err error)

FindOne -

func (*FakeCollection) UpsertID

func (s *FakeCollection) UpsertID(id interface{}, result interface{}) (changInfo *mgo.ChangeInfo, err error)

UpsertID -

func (*FakeCollection) Wake added in v0.0.52

func (s *FakeCollection) Wake()

Wake -

type FakeRenderer

type FakeRenderer struct {
	render.Render
	SpyStatus int
	SpyValue  interface{}
}

FakeRenderer -

func (*FakeRenderer) JSON

func (s *FakeRenderer) JSON(status int, v interface{})

JSON -

type FakeResponseBody added in v0.0.52

type FakeResponseBody struct {
	io.Reader
}

FakeResponseBody - a fake response body object

func (FakeResponseBody) Close added in v0.0.52

func (FakeResponseBody) Close() error

Close - close fake body

type FakeSku added in v0.0.60

type FakeSku struct{}

FakeSku -- a fake sku object

func (*FakeSku) New added in v0.0.60

func (s *FakeSku) New(tm skus.TaskManager, procurementMeta map[string]interface{}) skus.Sku

New --

func (*FakeSku) PollForTasks added in v0.0.60

func (s *FakeSku) PollForTasks()

PollForTasks --

func (*FakeSku) Procurement added in v0.0.60

func (s *FakeSku) Procurement() (status string, taskMeta map[string]interface{})

Procurement --

func (*FakeSku) ReStock added in v0.0.60

func (s *FakeSku) ReStock() (status string, taskMeta map[string]interface{})

ReStock --

type FakeTask

type FakeTask struct {
	ID        bson.ObjectId          `bson:"_id"`
	Timestamp time.Time              `bson:"timestamp"`
	Status    string                 `bson:"status"`
	MetaData  map[string]interface{} `bson:"metadata"`
}

FakeTask -

type FakeTaskManager added in v0.0.58

type FakeTaskManager struct {
}

FakeTaskManager - this is a fake representation of the task manager

func (*FakeTaskManager) FindAndStallTaskForCaller added in v0.0.64

func (s *FakeTaskManager) FindAndStallTaskForCaller(callerName string) (t *taskmanager.Task, err error)

FindAndStallTaskForCaller --

func (*FakeTaskManager) FindTask added in v0.0.58

func (s *FakeTaskManager) FindTask(id string) (t *taskmanager.Task, err error)

FindTask --

func (*FakeTaskManager) NewTask added in v0.0.58

func (s *FakeTaskManager) NewTask(callerName string, profile taskmanager.ProfileType, status string) (t *taskmanager.Task)

NewTask --

func (*FakeTaskManager) SaveTask added in v0.0.58

func (s *FakeTaskManager) SaveTask(t *taskmanager.Task) (*taskmanager.Task, error)

SaveTask --

type FakeVCDClient added in v0.0.55

type FakeVCDClient struct {
	FakeVAppTemplateRecord *vcloudclient.VAppTemplateRecord
	FakeVApp               *vcloudclient.VApp
	ErrUnDeployFake        error
	ErrDeployFake          error
	ErrQueryFake           error
	ErrAuthFake            error
}

FakeVCDClient - this is a fake vcdclient object

func (*FakeVCDClient) Auth added in v0.0.55

func (s *FakeVCDClient) Auth(username, password string) (err error)

Auth - fake out making an auth call

func (*FakeVCDClient) DeployVApp added in v0.0.55

func (s *FakeVCDClient) DeployVApp(templateName, templateHref, vcdHref string) (vapp *vcloudclient.VApp, err error)

DeployVApp - fake out calling deploy vapp

func (*FakeVCDClient) QueryTemplate added in v0.0.55

func (s *FakeVCDClient) QueryTemplate(templateName string) (vappTemplate *vcloudclient.VAppTemplateRecord, err error)

QueryTemplate - fake querying for a template

func (*FakeVCDClient) UnDeployVApp added in v0.0.57

func (s *FakeVCDClient) UnDeployVApp(vappID string) (task *vcloudclient.TaskElem, err error)

UnDeployVApp - executes a fake undeploy on a fake client

type MockClientDoer

type MockClientDoer struct {
	Req *http.Request
	Res *http.Response
	Err error
}

MockClientDoer -

func (*MockClientDoer) Do

func (s *MockClientDoer) Do(rq *http.Request) (rs *http.Response, e error)

Do -

type MockHeritageClient

type MockHeritageClient struct {
	*ccclient.Client
	Res *http.Response
}

MockHeritageClient -

func (*MockHeritageClient) CCTarget

func (s *MockHeritageClient) CCTarget() string

CCTarget -

func (*MockHeritageClient) CreateAuthRequest

func (s *MockHeritageClient) CreateAuthRequest(verb, requestURL, path string, args interface{}) (*http.Request, error)

CreateAuthRequest -

func (*MockHeritageClient) HTTPClient added in v0.0.52

func (s *MockHeritageClient) HTTPClient() ccclient.ClientDoer

HTTPClient -

func (*MockHeritageClient) Login

func (s *MockHeritageClient) Login() (c *ccclient.Client, err error)

Login -

type MockMongo

type MockMongo struct {
	Err    error
	Result interface{}
}

MockMongo -

func (*MockMongo) Collection

func (s *MockMongo) Collection() pezdispenser.Persistence

Collection -

func (*MockMongo) Find

func (s *MockMongo) Find(query interface{}) *mgo.Query

Find -

func (*MockMongo) Remove

func (s *MockMongo) Remove(selector interface{}) (err error)

Remove -

func (*MockMongo) Upsert

func (s *MockMongo) Upsert(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error)

Upsert -

type MockPersistence

type MockPersistence struct {
	Result interface{}
	Err    error
}

MockPersistence -

func (*MockPersistence) FindOne

func (s *MockPersistence) FindOne(query interface{}, result interface{}) (err error)

FindOne -

func (*MockPersistence) Remove

func (s *MockPersistence) Remove(selector interface{}) (err error)

Remove -

func (*MockPersistence) Upsert

func (s *MockPersistence) Upsert(selector interface{}, update interface{}) (err error)

Upsert -

Jump to

Keyboard shortcuts

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