Documentation ¶
Index ¶
- Constants
- func GenerateBytesUUID() []byte
- type BDDContext
- type CommonSteps
- type Composition
- func (c *Composition) Decompose() (output string, err error)
- func (c *Composition) GenerateLogs() error
- func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)
- func (c *Composition) GetContainerIDs() (containerIDs []string, err error)
- func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)
- func (c *Composition) Up(names ...string) error
- type DIDOrbSteps
- type DockerHelper
- type DockerSteps
- type DriverSteps
- type Opt
- type Request
- type Response
- type Steps
- type StressSteps
- type WorkerPool
Constants ¶
const ( // P256KeyType EC P-256 key type. P256KeyType = "P256" // Ed25519KeyType ed25519 key type. Ed25519KeyType = "Ed25519" )
Variables ¶
This section is empty.
Functions ¶
func GenerateBytesUUID ¶
func GenerateBytesUUID() []byte
GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes
Types ¶
type BDDContext ¶
type BDDContext struct {
// contains filtered or unexported fields
}
BDDContext bdd context.
func (*BDDContext) AfterScenario ¶
func (b *BDDContext) AfterScenario(*messages.Pickle, error)
AfterScenario execute code after bdd scenario
func (*BDDContext) BeforeScenario ¶
func (b *BDDContext) BeforeScenario(*messages.Pickle)
BeforeScenario execute code before bdd scenario
func (*BDDContext) Composition ¶
func (b *BDDContext) Composition() *Composition
Composition returns the Docker composition
func (*BDDContext) SetComposition ¶
func (b *BDDContext) SetComposition(composition *Composition)
SetComposition sets the Docker composition in the context
type CommonSteps ¶
type CommonSteps struct { BDDContext *BDDContext // contains filtered or unexported fields }
CommonSteps contain BDDContext
func NewCommonSteps ¶
func NewCommonSteps(context *BDDContext, state *state, httpClient *httpClient) *CommonSteps
NewCommonSteps create new CommonSteps struct
func (*CommonSteps) RegisterSteps ¶
func (d *CommonSteps) RegisterSteps(s *godog.Suite)
RegisterSteps register steps
type Composition ¶
type Composition struct {
// contains filtered or unexported fields
}
Composition represents a docker-compose execution and management
func NewComposition ¶
func NewComposition(projectName string, composeFilesYaml string, dir string) (composition *Composition, err error)
NewComposition create a new Composition specifying the project name (for isolation) and the compose files.
func (*Composition) Decompose ¶
func (c *Composition) Decompose() (output string, err error)
Decompose decompose the composition. Will also remove any containers with the same projectName prefix (eg. chaincode containers)
func (*Composition) GetAPIContainerForComposeService ¶
func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)
GetAPIContainerForComposeService return the docker.APIContainers with the supplied composeService name.
func (*Composition) GetContainerIDs ¶
func (c *Composition) GetContainerIDs() (containerIDs []string, err error)
GetContainerIDs returns the container IDs for the composition (NOTE: does NOT include those defined outside composition, eg. chaincode containers)
func (*Composition) GetIPAddressForComposeService ¶
func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)
GetIPAddressForComposeService returns the IPAddress of the container with the supplied composeService name.
func (*Composition) Up ¶
func (c *Composition) Up(names ...string) error
Up brings up all containers
type DIDOrbSteps ¶
type DIDOrbSteps struct {
// contains filtered or unexported fields
}
DIDOrbSteps
func NewDIDSideSteps ¶
func NewDIDSideSteps(context *BDDContext, state *state, httpClient *httpClient, namespace string) *DIDOrbSteps
NewDIDSideSteps
func (*DIDOrbSteps) RegisterSteps ¶
func (d *DIDOrbSteps) RegisterSteps(s *godog.Suite)
RegisterSteps registers orb steps
type DockerHelper ¶
type DockerHelper interface { GetIPAddress(containerID string) (string, error) RemoveContainersWithNamePrefix(namePrefix string) error }
DockerHelper helper for docker specific functions
func NewDockerCmdlineHelper ¶
func NewDockerCmdlineHelper() (DockerHelper, error)
NewDockerCmdlineHelper returns a new command line DockerHelper instance
type DockerSteps ¶
type DockerSteps struct {
BDDContext *BDDContext
}
DockerSteps manages Docker BDD steps
func NewDockerSteps ¶
func NewDockerSteps(context *BDDContext) *DockerSteps
NewDockerSteps returns the Docker steps
func (*DockerSteps) RegisterSteps ¶
func (d *DockerSteps) RegisterSteps(s *godog.Suite)
RegisterSteps register steps
type DriverSteps ¶
type DriverSteps struct {
// contains filtered or unexported fields
}
DriverSteps is steps for driver BDD tests.
func NewDriverSteps ¶
func NewDriverSteps(ctx *BDDContext, state *state) *DriverSteps
NewDriverSteps returns new driver steps.
func (*DriverSteps) RegisterSteps ¶
func (e *DriverSteps) RegisterSteps(s *godog.Suite)
RegisterSteps registers agent steps.
type Steps ¶
type Steps struct {
// contains filtered or unexported fields
}
Steps is steps for cli BDD tests.
func NewCLISteps ¶
func NewCLISteps(ctx *BDDContext, state *state, httpClient *httpClient) *Steps
NewCLISteps returns new agent from client SDK.
func (*Steps) RegisterSteps ¶
RegisterSteps registers agent steps.
type StressSteps ¶
type StressSteps struct {
// contains filtered or unexported fields
}
StressSteps is steps for orb stress BDD tests.
func NewStressSteps ¶
func NewStressSteps(ctx *BDDContext) *StressSteps
NewStressSteps returns new agent from client SDK.
func (*StressSteps) RegisterSteps ¶
func (e *StressSteps) RegisterSteps(s *godog.Suite)
RegisterSteps registers agent steps.
type WorkerPool ¶
type WorkerPool[T any] struct { // contains filtered or unexported fields }
WorkerPool manages a pool of workers that processes requests concurrently and, at the end, gathers the responses
func NewWorkerPool ¶
func NewWorkerPool[T any](num int, opts ...Opt) *WorkerPool[T]
NewWorkerPool returns a new worker pool with the given number of workers
func (*WorkerPool[T]) Responses ¶
func (p *WorkerPool[T]) Responses() []*Response[T]
Responses contains the responses after the pool is stopped
func (*WorkerPool[T]) Start ¶
func (p *WorkerPool[T]) Start()
Start starts all of the workers and listens for responses
func (*WorkerPool[T]) Stop ¶
func (p *WorkerPool[T]) Stop()
Stop stops the workers in the pool and stops listening for responses
func (*WorkerPool[T]) Submit ¶
func (p *WorkerPool[T]) Submit(req Request[T])
Submit submits a request for processing