fullstack

package
Version: v0.0.0-...-821bb50 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSimpleGraph

func BuildSimpleGraph(eventtype, consumerrole string) string

BuildSimpleGraph builds a graph

func Sentry

func Sentry(hub *sentry.Hub, transport sentry.Transport) func(Options) Options

Sentry set the sentry options to use

Types

type Fullstack

type Fullstack struct {
	T *testing.T

	ServerCert []byte

	Server *server.Server

	Client *xbus.Client

	Logger  *testutils.TestLogger
	Model   *model.Model
	DB      *yago.DB
	CloseDB sqldb.CloseFunction
}

Fullstack is the stub we use in our tests

func InitFullstack

func InitFullstack(t *testing.T, autostart bool, options ...func(Options) Options) *Fullstack

InitFullstack is used to produce and kickstart a full stack environment ready for testing

func (*Fullstack) CreateAccount

func (ft *Fullstack) CreateAccount(name string, aType api.Account_Type) *xbus.Client

CreateAccount ...

func (*Fullstack) CreateConsumer

func (ft *Fullstack) CreateConsumer(name string, roles []string) (*xbus.Client, *xbus.Actor)

CreateConsumer ...

func (*Fullstack) CreateEmitter

func (ft *Fullstack) CreateEmitter(name string, roles []string) (*xbus.Client, *xbus.Actor)

CreateEmitter ...

func (*Fullstack) CreateRole

func (ft *Fullstack) CreateRole(actorKind api.Actor_Kind, name string) api.UUID

CreateRole ...

func (*Fullstack) CreateWorker

func (ft *Fullstack) CreateWorker(name string, roles []string) (*xbus.Client, *xbus.Actor)

CreateWorker ...

func (*Fullstack) GetEnvStateChan

func (ft *Fullstack) GetEnvStateChan(emitter *xbus.Actor, envID api.UUID) (
	<-chan api.EmitterEnvelopeState, *nats.Subscription,
)

GetEnvStateChan returns a chan and subscrition to an envelope state updates

func (*Fullstack) InstallGraph

func (ft *Fullstack) InstallGraph(graph string)

InstallGraph save & activate a graph

func (*Fullstack) InstallNamedGraph

func (ft *Fullstack) InstallNamedGraph(name, version, graph string)

InstallNamedGraph saves & activates a graph

func (*Fullstack) ServerStart

func (ft *Fullstack) ServerStart() bool

ServerStart is responsible to start the Xbus server

func (*Fullstack) ServerStop

func (ft *Fullstack) ServerStop()

ServerStop is used during shutdown to properly exit all processes

func (*Fullstack) Shutdown

func (ft *Fullstack) Shutdown()

Shutdown is what you call to teardown the whole fullstack env

func (*Fullstack) SwitchT

func (ft *Fullstack) SwitchT(t *testing.T) func()

SwitchT changes the current t and the logger with a new one based on the given t. Returns a function to undo the switch, meant to be called with defer()

type Options

type Options struct {
	SentryHub       *sentry.Hub
	SentryTransport sentry.Transport
}

Options is the options for creating a InitFullstack

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL