Documentation
¶
Index ¶
- type Config
- type HandlerProperties
- type LastStatusInformation
- type TestConnectionInfo
- type TestSessionInfo
- type TestWorker
- func (tw *TestWorker) AddClusterWorkerMember(t *testing.T, opts *TestWorkerOpts) *TestWorker
- func (tw *TestWorker) Cancel()
- func (tw *TestWorker) Config() *Config
- func (tw *TestWorker) Context() context.Context
- func (tw *TestWorker) ControllerAddrs() []string
- func (tw *TestWorker) LookupSession(id string) (TestSessionInfo, bool)
- func (tw *TestWorker) Name() string
- func (tw *TestWorker) ProxyAddrs() []string
- func (tw *TestWorker) Shutdown()
- func (tw *TestWorker) Worker() *Worker
- type TestWorkerOpts
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerProperties ¶
type HandlerProperties struct {
ListenerConfig *configutil.Listener
}
type LastStatusInformation ¶
type LastStatusInformation struct { *pbs.StatusResponse StatusTime time.Time }
type TestConnectionInfo ¶ added in v0.4.0
type TestConnectionInfo struct { Id string Status pbs.CONNECTIONSTATUS CloseTime time.Time }
TestConnectionInfo provides detail about a particular connection as a part of TestSessionInfo. See that struct for details about the purpose of this data and how it's gathered.
type TestSessionInfo ¶ added in v0.4.0
type TestSessionInfo struct { Id string Status pbs.SESSIONSTATUS // Connections is indexed by connection ID, which is also included // within TestConnectionInfo for convenience. Connections map[string]TestConnectionInfo }
TestSessionInfo provides detail about a particular session from the worker's local session state. This detail is a point-in-time snapshot of what's in sessionInfoMap for a particular session, and may not contain all of the information that is contained within it, or the underlying connInfoMap. Only details that are really important to testing are passed along.
type TestWorker ¶
type TestWorker struct {
// contains filtered or unexported fields
}
TestWorker wraps a base.Server and Worker to provide a fully-programmatic worker for tests. Error checking (for instance, for valid config) is not stringent at the moment.
func NewTestWorker ¶
func NewTestWorker(t *testing.T, opts *TestWorkerOpts) *TestWorker
func (*TestWorker) AddClusterWorkerMember ¶
func (tw *TestWorker) AddClusterWorkerMember(t *testing.T, opts *TestWorkerOpts) *TestWorker
func (*TestWorker) Cancel ¶
func (tw *TestWorker) Cancel()
func (*TestWorker) Config ¶
func (tw *TestWorker) Config() *Config
func (*TestWorker) Context ¶
func (tw *TestWorker) Context() context.Context
func (*TestWorker) ControllerAddrs ¶
func (tw *TestWorker) ControllerAddrs() []string
func (*TestWorker) LookupSession ¶ added in v0.4.0
func (tw *TestWorker) LookupSession(id string) (TestSessionInfo, bool)
LookupSession returns session info from the worker's local session state.
The return boolean will be true if the session was found, false if it wasn't.
See TestSessionInfo for details on how to use this info.
func (*TestWorker) Name ¶
func (tw *TestWorker) Name() string
func (*TestWorker) ProxyAddrs ¶
func (tw *TestWorker) ProxyAddrs() []string
func (*TestWorker) Shutdown ¶
func (tw *TestWorker) Shutdown()
Shutdown runs any cleanup functions; be sure to run this after your test is done
func (*TestWorker) Worker ¶
func (tw *TestWorker) Worker() *Worker
Worker returns the underlying controller
type TestWorkerOpts ¶
type TestWorkerOpts struct { // Config; if not provided a dev one will be created Config *config.Config // Sets initial controller addresses InitialControllers []string // If true, the worker will not be started DisableAutoStart bool // The worker auth KMS to use, or one will be created WorkerAuthKms wrapping.Wrapper // The name to use for the worker, otherwise one will be randomly // generated, unless provided in a non-nil Config Name string // The logger to use, or one will be created Logger hclog.Logger }
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) LastStatusSuccess ¶
func (w *Worker) LastStatusSuccess() *LastStatusInformation
LastStatusSuccess reports the last time we sent a successful status request.