Documentation ¶
Overview ¶
Package mock provides a mock environment for testing.
Index ¶
- func BootstrapCredentialsCollection(ctx context.Context, client *mongo.Client, dbURL, dbName, domainName string) (certdepot.Depot, error)
- type Environment
- func (e *Environment) BuildVersion() string
- func (e *Environment) CertificateDepot() certdepot.Depot
- func (e *Environment) Client() *mongo.Client
- func (e *Environment) ClientConfig() *evergreen.ClientConfig
- func (e *Environment) Close(ctx context.Context) error
- func (e *Environment) Configure(ctx context.Context) error
- func (e *Environment) Context() (context.Context, context.CancelFunc)
- func (e *Environment) ContextSession(_ context.Context) db.Session
- func (e *Environment) DB() *mongo.Database
- func (e *Environment) GetGitHubSender(string, string, evergreen.CreateInstallationTokenFunc) (send.Sender, error)
- func (e *Environment) GetSender(key evergreen.SenderKey) (send.Sender, error)
- func (e *Environment) JasperManager() jasper.Manager
- func (e *Environment) LocalQueue() amboy.Queue
- func (e *Environment) ParameterManager() *parameterstore.ParameterManager
- func (e *Environment) RegisterCloser(name string, background bool, closer func(context.Context) error)
- func (e *Environment) RemoteQueue() amboy.Queue
- func (e *Environment) RemoteQueueGroup() amboy.QueueGroup
- func (e *Environment) RoleManager() gimlet.RoleManager
- func (e *Environment) SaveConfig(context.Context) error
- func (e *Environment) Session() db.Session
- func (e *Environment) SetParameterManager(pm *parameterstore.ParameterManager)
- func (e *Environment) SetSender(key evergreen.SenderKey, s send.Sender) error
- func (e *Environment) SetShutdown()
- func (e *Environment) SetUserManager(um gimlet.UserManager)
- func (e *Environment) SetUserManagerInfo(umi evergreen.UserManagerInfo)
- func (e *Environment) Settings() *evergreen.Settings
- func (e *Environment) SharedDB() *mongo.Database
- func (e *Environment) ShutdownSequenceStarted() bool
- func (e *Environment) UserManager() gimlet.UserManager
- func (e *Environment) UserManagerInfo() evergreen.UserManagerInfo
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) 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 (e *Environment) GetGitHubSender(string, string, evergreen.CreateInstallationTokenFunc) (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 (*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) 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
Click to show internal directories.
Click to hide internal directories.