Documentation ¶
Index ¶
- Variables
- type CmdRunner
- func (r CmdRunner) MustRun(args ...string)
- func (r CmdRunner) Run(args ...string) error
- func (r CmdRunner) RunReadAndFindSubmatch(re *regexp.Regexp, args ...string) ([][]string, error)
- func (r CmdRunner) RunReadLastLine(args ...string) (string, error)
- func (r CmdRunner) RunReadOutput(args ...string) ([]byte, error)
- type Consumer
- type CtlSettings
- type Emitter
- type FileCopyOption
- type FileOption
- type FullEnv
- func (fe *FullEnv) BinPath(name string) string
- func (fe *FullEnv) ClientConfig(name string) (string, error)
- func (fe *FullEnv) Close() error
- func (fe *FullEnv) CreateEnv() error
- func (fe *FullEnv) GetClient(name string) *xbus.Client
- func (fe *FullEnv) GetLogger() xbus.Logger
- func (fe *FullEnv) Init() error
- func (fe *FullEnv) RegisterActorService(name string, init xbus.NewActorServiceFunc)
- func (fe *FullEnv) SetCurrentTest(t *testing.T) func()
- func (fe *FullEnv) SetupCtl() (err error)
- func (fe *FullEnv) SetupDB() error
- func (fe *FullEnv) SetupFiles() error
- func (fe *FullEnv) SetupInternalActors()
- func (fe *FullEnv) SetupServer() error
- func (fe *FullEnv) Shutdown() error
- func (fe *FullEnv) StartClient(name string) error
- func (fe *FullEnv) StartXbusd() error
- func (fe *FullEnv) Startup() error
- func (fe *FullEnv) StopClient(name string) error
- func (fe *FullEnv) StopXbusd() error
- func (fe *FullEnv) WorkDir() string
- type Options
- type ProgramSettings
- type RawSettings
Constants ¶
This section is empty.
Variables ¶
var DefaultBinaryPaths = make(map[string]string)
DefaultBinaryPaths defines the default paths for the various binaries
Functions ¶
This section is empty.
Types ¶
type CmdRunner ¶
CmdRunner can run a command with args
func NewCmdRunner ¶
NewCmdRunner initializes a CmdRunner
func (CmdRunner) RunReadAndFindSubmatch ¶
RunReadAndFindSubmatch runs the command with args, then match each line with the given regex and return the submatches for each
func (CmdRunner) RunReadLastLine ¶
RunReadLastLine runs the command with args and returns the last line of the command combined output
type Consumer ¶
type Consumer struct { Actor *xbus.Actor Envelopes []*api.Envelope // contains filtered or unexported fields }
Consumer is an emitter actor for FullEnv
func NewConsumer ¶
NewConsumer initializes a Consumer
type CtlSettings ¶
CtlSettings hods options of a ctl
type Emitter ¶
Emitter is an emitter actor for FullEnv
type FileCopyOption ¶
FileCopyOption holds options to copy files to the test env
type FileOption ¶
type FileOption struct {
Copy *FileCopyOption
}
FileOption holds options to setup files to the test env
type FullEnv ¶
type FullEnv struct { XbusCtl CmdRunner Xbusd CmdRunner ExtraXbusCtl map[string]CmdRunner Emitter *Emitter Consumer *Consumer // contains filtered or unexported fields }
FullEnv pilots xbusd and clients
func NewFullEnv ¶
NewFullEnv initializes a FullEnv
func NewFullEnvForTest ¶
NewFullEnvForTest returns a FullEnv that sends logs to a *testing.T
func (*FullEnv) ClientConfig ¶
ClientConfig returns the configuration file of a client
func (*FullEnv) CreateEnv ¶
CreateEnv creates the test directories, configuration files, setup the XbusCtl and Xbusd command runners. It does not run any command (see Init)
func (*FullEnv) GetClient ¶
GetClient returns the xbus.Client instance corresponding to the inprocess client
func (*FullEnv) Init ¶
Init setup the server, the clients and load the pipelines Once done only the server is running
func (*FullEnv) RegisterActorService ¶
func (fe *FullEnv) RegisterActorService(name string, init xbus.NewActorServiceFunc)
RegisterActorService registers an actor service for this env only Allow to inject actors that are controlled by the test
func (*FullEnv) SetCurrentTest ¶
SetCurrentTest changes the current test and logger. It returns a function that switch back to the original test and logger
func (*FullEnv) SetupFiles ¶
SetupFiles copy all the files specified in the 'files' section
func (*FullEnv) SetupInternalActors ¶
func (fe *FullEnv) SetupInternalActors()
SetupInternalActors initializes the fullenv actors
func (*FullEnv) SetupServer ¶
SetupServer runs the commands for setting up an operational xbusd
func (*FullEnv) StartClient ¶
StartClient starts a client
func (*FullEnv) StartXbusd ¶
StartXbusd starts the xbusd server
func (*FullEnv) StopClient ¶
StopClient stops a client
type Options ¶
type Options struct { Xbusd RawSettings Clients []RawSettings Ctl []CtlSettings HTTP []RawSettings Graphs map[string]RawSettings Pipelines map[string]RawSettings Dsn string Vars map[string]string // If true, no attempt to prevent concurrent access is done. NoDBLock bool TargetDir string ConfigFilePath string Files []FileOption BinaryPaths map[string]string Logger xbus.Logger }
Options holds all the options necessary to setup a FullEnv
func OptionsFromFile ¶
OptionsFromFile initialize a Options from a yaml configuration file
type ProgramSettings ¶
ProgramSettings defines how and when to start a program
type RawSettings ¶
RawSettings holds the raw configuration of a xbus program (xbus, xbus-client...)