Documentation ¶
Overview ¶
Copyright 2021 Molecula Corp. All rights reserved.
Index ¶
- func DefaultConfig() *server.Config
- type ManagedCommand
- func (mc *ManagedCommand) Address() dax.Address
- func (mc *ManagedCommand) Close() error
- func (mc *ManagedCommand) Healthy(key dax.ServiceKey) bool
- func (mc *ManagedCommand) Manage() *dax.ServiceManager
- func (mc *ManagedCommand) NewComputer() dax.ServiceKey
- func (mc *ManagedCommand) NewController(cfg controller.Config) dax.ServiceKey
- func (mc *ManagedCommand) NewQueryer(cfg queryer.Config) dax.ServiceKey
- func (mc *ManagedCommand) Start() error
- func (mc *ManagedCommand) WaitForApplied(t *testing.T, key dax.ServiceKey, n int, sleep time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
DefaultConfig includes a single instance of each service type.
Types ¶
type ManagedCommand ¶
ManagedCommand represents a test wrapper for server.Command.
func MustRunManagedCommand ¶
func MustRunManagedCommand(tb testing.TB, opts ...server.CommandOption) *ManagedCommand
MustRunManagedCommand starts an in-process set of Services based on the provided configuration. If no configuration is provided, it will use the DefaultConfig which consists of one instance of each service type.
func NewManagedCommand ¶
func NewManagedCommand(tb fbtest.DirCleaner, opts ...server.CommandOption) *ManagedCommand
NewManagedCommand returns a new instance of Command.
func (*ManagedCommand) Address ¶
func (mc *ManagedCommand) Address() dax.Address
Address returns the advertise address at which the command can be reached.
func (*ManagedCommand) Close ¶
func (mc *ManagedCommand) Close() error
Close closes the embedded command.
func (*ManagedCommand) Healthy ¶
func (mc *ManagedCommand) Healthy(key dax.ServiceKey) bool
Healthy returns true if the provided service's /health endpoint returns 200 OK. This means that the service has been added to the ServiceManager and started, and that its http handler has been dynamically added.
func (*ManagedCommand) Manage ¶
func (mc *ManagedCommand) Manage() *dax.ServiceManager
Manage returns the ServiceManager for the ManagedCommand.
func (*ManagedCommand) NewComputer ¶
func (mc *ManagedCommand) NewComputer() dax.ServiceKey
NewComputer adds a new ComputerService to the ManagedCommands ServiceManager.
func (*ManagedCommand) NewController ¶ added in v3.30.0
func (mc *ManagedCommand) NewController(cfg controller.Config) dax.ServiceKey
NewController adds a new ControllerService to the ManagedCommands ServiceManager.
func (*ManagedCommand) NewQueryer ¶
func (mc *ManagedCommand) NewQueryer(cfg queryer.Config) dax.ServiceKey
NewQueryer adds a new QueryerService to the ManagedCommands ServiceManager.
func (*ManagedCommand) Start ¶
func (mc *ManagedCommand) Start() error
Start starts the embedded command.
func (*ManagedCommand) WaitForApplied ¶
func (mc *ManagedCommand) WaitForApplied(t *testing.T, key dax.ServiceKey, n int, sleep time.Duration)
WaitForApplied is a test helper function which retries a computer's /directive endpoint a specified number of times, along with a sleep time in between tries, until the computer returns applied=true.