mocks

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAuthHeaders

func HandleAuthHeaders(mockAuthCrypt rest.AuthCrypt, request, response string, validators ...func(expected, actual interface{}) bool) func(w http.ResponseWriter, r *http.Request, body string) *string

func Init

func Init()

Types

type FakeCLI

type FakeCLI struct {
	FuncRunCounter, FuncRunWithEnvCounter int
	// contains filtered or unexported fields
}

func NewFakeCLI

func NewFakeCLI(outputBuffer, errorBuffer io.Writer) *FakeCLI

func (*FakeCLI) AddFakeResponse

func (c *FakeCLI) AddFakeResponse(
	inArgs []string,
	inExtraEnvVars []string,
	outResponse string,
	errResponse string,
	err error,
) string

func (*FakeCLI) ApplyFilter

func (c *FakeCLI) ApplyFilter(filter *streams.Filter)

func (*FakeCLI) ExecutablePath

func (c *FakeCLI) ExecutablePath() string

func (*FakeCLI) ExpectFakeRequest

func (c *FakeCLI) ExpectFakeRequest(key string)

func (*FakeCLI) GetPipedErrorBuffer

func (c *FakeCLI) GetPipedErrorBuffer() io.Reader

func (*FakeCLI) GetPipedOutputBuffer

func (c *FakeCLI) GetPipedOutputBuffer() io.Reader

func (*FakeCLI) IsExpectedRequestStackEmpty

func (c *FakeCLI) IsExpectedRequestStackEmpty() bool

func (*FakeCLI) Reset

func (c *FakeCLI) Reset()

func (*FakeCLI) Run

func (c *FakeCLI) Run(
	args []string,
) error

func (*FakeCLI) RunWithEnv

func (c *FakeCLI) RunWithEnv(
	args []string,
	extraEnvVars []string,
) error

func (*FakeCLI) Start

func (c *FakeCLI) Start(args []string) error

func (*FakeCLI) StartWithEnv

func (c *FakeCLI) StartWithEnv(args []string, extraEnvVars []string) error

func (*FakeCLI) Stop

func (c *FakeCLI) Stop(timeout ...time.Duration) error

func (*FakeCLI) Wait

func (c *FakeCLI) Wait(timeout ...time.Duration) error

func (*FakeCLI) WorkingDirectory

func (c *FakeCLI) WorkingDirectory() string

type MockAuthCrypt

type MockAuthCrypt struct {
	// contains filtered or unexported fields
}

func NewMockAuthCrypt

func NewMockAuthCrypt(key string, encryptionKey []byte) (*MockAuthCrypt, error)

func (*MockAuthCrypt) AuthTokenKey

func (a *MockAuthCrypt) AuthTokenKey() string

func (*MockAuthCrypt) Crypt

func (a *MockAuthCrypt) Crypt() (*crypto.Crypt, *sync.Mutex)

func (*MockAuthCrypt) IsAuthenticated

func (a *MockAuthCrypt) IsAuthenticated() bool

func (*MockAuthCrypt) WaitForAuth

func (a *MockAuthCrypt) WaitForAuth() bool

type MockHttpServer

type MockHttpServer struct {
	// contains filtered or unexported fields
}

func NewMockHttpServer

func NewMockHttpServer(port int) *MockHttpServer

func NewMockHttpsServer

func NewMockHttpsServer(port int) (*MockHttpServer, string, error)

func (*MockHttpServer) Done

func (ms *MockHttpServer) Done() bool

func (*MockHttpServer) ExpectCommonHeader

func (ms *MockHttpServer) ExpectCommonHeader(name, value string)

func (*MockHttpServer) PushRequest

func (ms *MockHttpServer) PushRequest() *request

func (*MockHttpServer) Start

func (ms *MockHttpServer) Start()

func (*MockHttpServer) Stop

func (ms *MockHttpServer) Stop()

Jump to

Keyboard shortcuts

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