tests

package
v0.0.0-...-037ba61 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RepositoryCheckCalls  int
	RepositoryCreateCalls int
	RepositoryUpdateCalls int
	RepositoryDeleteCalls int
	SecretJSON            = `{"name": "foo", "namespace": "default", "checksum": "xxxxaaaaqqqq", "data": { "foo":"bar" }}`
)

var Mock used in local tests

Functions

func InitMockLogger

func InitMockLogger() appcontext.Component

InitMockLogger func creates a mock logger interface

func InitRepository

func InitRepository() appcontext.Component

InitRepository func returns a RepositoryMock interface

Types

type MockLogger

type MockLogger struct {
	//Logger only supports structured logging (less features more performance)
	Logger *zap.Logger
	//Sugar supports structured and printf-style APIs (less performance more features)
	Sugar *zap.SugaredLogger
}

MockLogger wrapper with two Logger methods

func (MockLogger) DPanic

func (logger MockLogger) DPanic(args ...interface{})

DPanic uses fmt.Sprint to construct and log a message. In development, the logger then panics. (See DPanicLevel for details.)

func (MockLogger) DPanicf

func (logger MockLogger) DPanicf(template string, args ...interface{})

DPanicf uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)

func (MockLogger) Debug

func (logger MockLogger) Debug(args ...interface{})

Debug uses fmt.Sprint to construct and log a message.

func (MockLogger) Debugf

func (logger MockLogger) Debugf(template string, args ...interface{})

Debugf uses fmt.Sprintf to log a templated message.

func (MockLogger) Error

func (logger MockLogger) Error(args ...interface{})

Error uses fmt.Sprint to construct and log a message.

func (MockLogger) Errorf

func (logger MockLogger) Errorf(template string, args ...interface{})

Errorf uses fmt.Sprintf to log a templated message.

func (MockLogger) Fatal

func (logger MockLogger) Fatal(args ...interface{})

Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.

func (MockLogger) Fatalf

func (logger MockLogger) Fatalf(template string, args ...interface{})

Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.

func (MockLogger) Info

func (logger MockLogger) Info(args ...interface{})

Info uses fmt.Sprint to construct and log a message.

func (MockLogger) Infof

func (logger MockLogger) Infof(template string, args ...interface{})

Infof uses fmt.Sprintf to log a templated message.

func (MockLogger) Panic

func (logger MockLogger) Panic(args ...interface{})

Panic uses fmt.Sprint to construct and log a message, then panics.

func (MockLogger) Panicf

func (logger MockLogger) Panicf(template string, args ...interface{})

Panicf uses fmt.Sprintf to log a templated message, then panics.

func (MockLogger) Sync

func (logger MockLogger) Sync()

Sync flushes the log if needed

func (MockLogger) Warn

func (logger MockLogger) Warn(args ...interface{})

Warn uses fmt.Sprint to construct and log a message.

func (MockLogger) Warnf

func (logger MockLogger) Warnf(template string, args ...interface{})

Warnf uses fmt.Sprintf to log a templated message.

type RepositoryMock

type RepositoryMock struct {
}

RepositoryMock struct

func (RepositoryMock) CheckSecretK8S

func (repo RepositoryMock) CheckSecretK8S(name string, namespace string) (string, string, error)

CheckSecretK8S mock func

func (RepositoryMock) CreateSecretK8S

func (repo RepositoryMock) CreateSecretK8S(name, namespace string, data, labels, annotations map[string]string) (string, error)

CreateSecretK8S mock func

func (RepositoryMock) DeleteSecretK8S

func (repo RepositoryMock) DeleteSecretK8S(name string, namespace string) (string, error)

DeleteSecretK8S mock func

func (RepositoryMock) UpdateSecretK8S

func (repo RepositoryMock) UpdateSecretK8S(name, namespace string, data, labels, annotations map[string]string) (string, error)

UpdateSecretK8S mock func

Jump to

Keyboard shortcuts

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