fakes

package
v2.0.42+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//SuccessString --
	SuccessString = `{"state":"done"}`
	//FailureString --
	FailureString = `{"state":"notdone"}`
)
View Source
var (
	NfsSuccessString = "success nfs"
	NfsFailureString = "failed nfs"
)

Exported status strings

View Source
var (
	//ErrMockNfsCommand ---
	ErrMockNfsCommand = errors.New("error occurred")
)
View Source
var GetNfs = func(lf io.Writer, cmdexec command.Executer) *cfbackup.NFSBackup {
	return &cfbackup.NFSBackup{
		Caller: cmdexec,
		RemoteOps: &mockRemoteOps{
			Writer: lf,
		},
	}
}

GetNfs ---

View Source
var MockMultiPartBodyFunc = func(string, string, io.Reader, map[string]string) (io.Reader, error) {
	return &ClosingBuffer{bytes.NewBufferString("success")}, nil
}

MockMultiPartBodyFunc --

View Source
var MockMultiPartUploadFunc = func(ghttp.ConnAuth, string, string, int64, io.Reader, map[string]string) (*http.Response, error) {
	return &http.Response{
		StatusCode: 200,
	}, nil
}

MockMultiPartUploadFunc ---

Functions

func Logger

func Logger() log.Logger

Logger ---

func NewFakeBackupContext

func NewFakeBackupContext(target string, env map[string]string, storageProvider cfbackup.StorageProvider) (backupContext cfbackup.BackupContext)

NewFakeBackupContext --

func NewFakeDirector

func NewFakeDirector(ip, username, password string, port int) bosh.Bosh

NewFakeDirector ---

func NewLocalMockExecuter

func NewLocalMockExecuter() command.Executer

NewLocalMockExecuter ---

Types

type ClosingBuffer

type ClosingBuffer struct {
	*bytes.Buffer
}

ClosingBuffer ---

func (*ClosingBuffer) Close

func (cb *ClosingBuffer) Close() (err error)

Close --

type FailExecuter

type FailExecuter struct{}

FailExecuter ---

func (*FailExecuter) Execute

func (s *FailExecuter) Execute(dest io.Writer, src string) (err error)

Execute --

type FailureMockNFSExecuter

type FailureMockNFSExecuter struct{}

FailureMockNFSExecuter --

func (*FailureMockNFSExecuter) Execute

func (s *FailureMockNFSExecuter) Execute(dest io.Writer, cmd string) (err error)

Execute --

type FakeStorageProvider

type FakeStorageProvider struct {
}

FakeStorageProvider --

func (*FakeStorageProvider) Reader

func (d *FakeStorageProvider) Reader(path ...string) (io.ReadCloser, error)

Reader ---

func (*FakeStorageProvider) Writer

func (d *FakeStorageProvider) Writer(path ...string) (closer io.WriteCloser, err error)

Writer --

type MockHTTPGateway

type MockHTTPGateway struct {
	CheckFailureCondition bool
	StatusCode            int
	State                 string
}

MockHTTPGateway --

func (*MockHTTPGateway) Get

Get --

func (*MockHTTPGateway) Post

func (gateway *MockHTTPGateway) Post(entity ghttp.HttpRequestEntity, body io.Reader) ghttp.RequestAdaptor

Post ---

func (*MockHTTPGateway) Put

Put --

type SuccessExecuter

type SuccessExecuter struct{}

SuccessExecuter ---

func (*SuccessExecuter) Execute

func (s *SuccessExecuter) Execute(dest io.Writer, src string) (err error)

Execute --

type SuccessMockNFSExecuter

type SuccessMockNFSExecuter struct{}

SuccessMockNFSExecuter ---

func (*SuccessMockNFSExecuter) Execute

func (s *SuccessMockNFSExecuter) Execute(dest io.Writer, cmd string) (err error)

Execute --

Jump to

Keyboard shortcuts

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