tc

package
v44.23.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FakeSecretsCreateSecret

func FakeSecretsCreateSecret(name string, response *tcsecrets.Secret)

Create a new secret with the given content; if this is nil then the secret is inaccessible (403 / InsufficientScopes)

func FakeSecretsReset

func FakeSecretsReset()

Reset fake secrets

func FakeWorkerManagerRegistration

func FakeWorkerManagerRegistration() (*tcworkermanager.RegisterWorkerRequest, error)

Get the single registration that has occurred, or an error if there are not exactly one. This resets the list of registrations in the process.

func FakeWorkerManagerReregistration

func FakeWorkerManagerReregistration() (*tcworkermanager.ReregisterWorkerRequest, error)

Get the single reregistration that has occurred, or an error if there are not exactly one. This resets the list of registrations in the process.

func FakeWorkerManagerWorkerErrorReports

func FakeWorkerManagerWorkerErrorReports() ([]*tcworkermanager.WorkerErrorReport, error)

func FakeWorkerManagerWorkerRemovals

func FakeWorkerManagerWorkerRemovals() []*removedWorker

Get the worker removals that have occurred.

func GetFakeWorkerManagerWorkerSecret

func GetFakeWorkerManagerWorkerSecret() string

func SetFakeWorkerManagerWorkerExpires

func SetFakeWorkerManagerWorkerExpires(expires tcclient.Time)

func SetFakeWorkerManagerWorkerSecret

func SetFakeWorkerManagerWorkerSecret(secret string)

Types

type FakeSecrets

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

func (*FakeSecrets) Get

func (cli *FakeSecrets) Get(name string) (*tcsecrets.Secret, error)

type FakeWorkerManager

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

func (*FakeWorkerManager) RegisterWorker

func (*FakeWorkerManager) RemoveWorker

func (wm *FakeWorkerManager) RemoveWorker(workerPoolID, workerGroup, workerID string) error

func (*FakeWorkerManager) ReportWorkerError

func (wm *FakeWorkerManager) ReportWorkerError(workerPoolID string, payload *tcworkermanager.WorkerErrorReport) (*tcworkermanager.WorkerPoolError, error)

type Secrets

type Secrets interface {
	Get(name string) (*tcsecrets.Secret, error)
}

An interface containing the functions required of Secrets, allowing use of fakes that also match this interface.

func FakeSecretsClientFactory

func FakeSecretsClientFactory(rootURL string, credentials *tcclient.Credentials) (Secrets, error)

A function matching SecretsClientFactory that can be used in testing

type SecretsClientFactory

type SecretsClientFactory func(rootURL string, credentials *tcclient.Credentials) (Secrets, error)

A factory type that can create new instances of the Secrets interface.

type WorkerManager

type WorkerManager interface {
	RegisterWorker(payload *tcworkermanager.RegisterWorkerRequest) (*tcworkermanager.RegisterWorkerResponse, error)
	ReportWorkerError(workerPoolID string, payload *tcworkermanager.WorkerErrorReport) (*tcworkermanager.WorkerPoolError, error)
	ReregisterWorker(payload *tcworkermanager.ReregisterWorkerRequest) (*tcworkermanager.ReregisterWorkerResponse, error)
	RemoveWorker(workerPoolID, workerGroup, workerID string) error
}

An interface containing the functions required of WorkerManager, allowing use of fakes that also match this interface.

func FakeWorkerManagerClientFactory

func FakeWorkerManagerClientFactory(rootURL string, credentials *tcclient.Credentials) (WorkerManager, error)

A function matching WorkerManagerClientFactory that can be used in testing

type WorkerManagerClientFactory

type WorkerManagerClientFactory func(rootURL string, credentials *tcclient.Credentials) (WorkerManager, error)

A factory type that can create new instances of the WorkerManager interface.

Jump to

Keyboard shortcuts

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