mock

package
v0.0.0-...-1402089 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package mock provides a mock environment for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapCredentialsCollection

func BootstrapCredentialsCollection(ctx context.Context, client *mongo.Client, dbURL, dbName, domainName string) (certdepot.Depot, error)

BootstrapCredentialsCollection initializes the credentials collection with the required CA configuration and returns the credentials depot.

Types

type Environment

type Environment struct {
	Remote               amboy.Queue
	Local                amboy.Queue
	JasperProcessManager jasper.Manager
	RemoteGroup          amboy.QueueGroup
	Depot                certdepot.Depot
	ParamManager         *parameterstore.ParameterManager
	Closers              map[string]func(context.Context) error
	DBSession            db.Session
	EvergreenSettings    *evergreen.Settings
	MongoClient          *mongo.Client

	DatabaseName   string
	EnvContext     context.Context
	InternalSender *send.InternalSender

	Clients evergreen.ClientConfig
	// contains filtered or unexported fields
}

func (*Environment) BuildVersion

func (e *Environment) BuildVersion() string

BuildVersion returns the ID of the Evergreen version that built the binary. Returns an empty string if the version ID isn't set.

func (*Environment) CertificateDepot

func (e *Environment) CertificateDepot() certdepot.Depot

func (*Environment) Client

func (e *Environment) Client() *mongo.Client

func (*Environment) ClientConfig

func (e *Environment) ClientConfig() *evergreen.ClientConfig

func (*Environment) Close

func (e *Environment) Close(ctx context.Context) error

func (*Environment) Configure

func (e *Environment) Configure(ctx context.Context) error

Configure sets default values on the Environment, except for the user manager and user manager info, which must be explicitly set.

func (*Environment) Context

func (e *Environment) Context() (context.Context, context.CancelFunc)

func (*Environment) ContextSession

func (e *Environment) ContextSession(_ context.Context) db.Session

func (*Environment) DB

func (e *Environment) DB() *mongo.Database

func (*Environment) GetGitHubSender

func (*Environment) GetSender

func (e *Environment) GetSender(key evergreen.SenderKey) (send.Sender, error)

func (*Environment) JasperManager

func (e *Environment) JasperManager() jasper.Manager

func (*Environment) LocalQueue

func (e *Environment) LocalQueue() amboy.Queue

func (*Environment) ParameterManager

func (e *Environment) ParameterManager() *parameterstore.ParameterManager

func (*Environment) RegisterCloser

func (e *Environment) RegisterCloser(name string, background bool, closer func(context.Context) error)

func (*Environment) RemoteQueue

func (e *Environment) RemoteQueue() amboy.Queue

func (*Environment) RemoteQueueGroup

func (e *Environment) RemoteQueueGroup() amboy.QueueGroup

func (*Environment) RoleManager

func (e *Environment) RoleManager() gimlet.RoleManager

func (*Environment) SaveConfig

func (e *Environment) SaveConfig(context.Context) error

func (*Environment) Session

func (e *Environment) Session() db.Session

func (*Environment) SetParameterManager

func (e *Environment) SetParameterManager(pm *parameterstore.ParameterManager)

func (*Environment) SetSender

func (e *Environment) SetSender(key evergreen.SenderKey, s send.Sender) error

func (*Environment) SetShutdown

func (e *Environment) SetShutdown()

func (*Environment) SetUserManager

func (e *Environment) SetUserManager(um gimlet.UserManager)

func (*Environment) SetUserManagerInfo

func (e *Environment) SetUserManagerInfo(umi evergreen.UserManagerInfo)

func (*Environment) Settings

func (e *Environment) Settings() *evergreen.Settings

func (*Environment) SharedDB

func (e *Environment) SharedDB() *mongo.Database

func (*Environment) ShutdownSequenceStarted

func (e *Environment) ShutdownSequenceStarted() bool

func (*Environment) UserManager

func (e *Environment) UserManager() gimlet.UserManager

func (*Environment) UserManagerInfo

func (e *Environment) UserManagerInfo() evergreen.UserManagerInfo

Jump to

Keyboard shortcuts

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