job

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package job is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log logrus.FieldLogger, kube client.Client, cfg Config) *kubeJob

Types

type API

type API interface {
	// Create k8s job
	Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
	// Monitor k8s job return error in case job fails
	Monitor(ctx context.Context, name, namespace string) error
	// Delete k8s job
	Delete(ctx context.Context, name, namespace string) error
}

type Config

type Config struct {
	MonitorLoopInterval time.Duration `envconfig:"JOB_MONITOR_INTERVAL" default:"500ms"`
	RetryInterval       time.Duration `envconfig:"JOB_RETRY_INTERVAL" default:"1s"`
	RetryAttempts       int           `envconfig:"JOB_RETRY_ATTEMPTS" default:"30"`
}

type MockAPI

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

MockAPI is a mock of API interface

func NewMockAPI

func NewMockAPI(ctrl *gomock.Controller) *MockAPI

NewMockAPI creates a new mock instance

func (*MockAPI) Create

func (m *MockAPI) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error

Create mocks base method

func (*MockAPI) Delete

func (m *MockAPI) Delete(ctx context.Context, name, namespace string) error

Delete mocks base method

func (*MockAPI) EXPECT

func (m *MockAPI) EXPECT() *MockAPIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAPI) Monitor

func (m *MockAPI) Monitor(ctx context.Context, name, namespace string) error

Monitor mocks base method

type MockAPIMockRecorder

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

MockAPIMockRecorder is the mock recorder for MockAPI

func (*MockAPIMockRecorder) Create

func (mr *MockAPIMockRecorder) Create(ctx, obj interface{}, opts ...interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockAPIMockRecorder) Delete

func (mr *MockAPIMockRecorder) Delete(ctx, name, namespace interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockAPIMockRecorder) Monitor

func (mr *MockAPIMockRecorder) Monitor(ctx, name, namespace interface{}) *gomock.Call

Monitor indicates an expected call of Monitor

Jump to

Keyboard shortcuts

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