mock

package
v0.0.0-...-730bba4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCertUtil

type FakeCertUtil struct {
	Duration time.Duration
	Err      error
}

FakeCertUtil is a mocked CertUtil for testing.

func (FakeCertUtil) GetWaitTime

func (f FakeCertUtil) GetWaitTime(certBytes []byte, now time.Time) (time.Duration, error)

GetWaitTime returns duration if err is nil, otherwise, it returns err.

type FakeFileUtil

type FakeFileUtil struct {
	ReadContent  map[string][]byte
	WriteContent map[string][]byte
}

FakeFileUtil is a mocked FileUtil for testing.

func (FakeFileUtil) Read

func (f FakeFileUtil) Read(filename string) ([]byte, error)

Read returns the filename entry in ReadContent or an error.

func (FakeFileUtil) Write

func (f FakeFileUtil) Write(filename string, content []byte, perm os.FileMode) error

Write writes data to the filename entry in WriteContent.

Jump to

Keyboard shortcuts

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