fakes

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2015 License: GPL-2.0 Imports: 14 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 pezdispenser.Task) func(url, dbname, collectionname string) (col integrations.Collection, err error)

FakeNewCollectionDialer -

Types

type FakeCollection

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

FakeCollection -

func (*FakeCollection) Close

func (s *FakeCollection) Close()

Close -

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 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 FakeVCDClient added in v0.0.55

type FakeVCDClient struct {
	FakeVAppTemplateRecord *vcloudclient.VAppTemplateRecord
	FakeVApp               *vcloudclient.VApp
	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