bddtests

package module
v0.0.0-...-bf32995 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBytesUUID

func GenerateBytesUUID() []byte

GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes

func GenerateUUID

func GenerateUUID() string

GenerateUUID returns a UUID based on RFC 4122

func GetCASKey

func GetCASKey(content []byte) string

GetCASKey returns the content-addressable key for the given content (sha256 hash + base64 URL encoding).

Types

type AnchorFile

type AnchorFile struct {
	// BatchFileHash is encoded hash of the batch file
	BatchFileHash string `json:"batchFileHash"`

	// UniqueSuffixes is an array of suffixes (the unique portion of the ID string that differentiates
	// one document from another) for all documents that are declared to have operations within the associated batch file.
	UniqueSuffixes []string `json:"uniqueSuffixes"`
}

AnchorFile defines the schema of a Anchor File and its related operations.

type BatchFile

type BatchFile struct {
	// operations included in this batch file, each operation is an encoded string
	Operations []string `json:"operations"`
}

BatchFile defines the schema of a Batch File and its related operations.

type BlockchainSteps

type BlockchainSteps struct {
	// contains filtered or unexported fields
}

BlockchainSteps

func NewBlockchainSteps

func NewBlockchainSteps(context *bddtests.BDDContext) *BlockchainSteps

NewBlockchainSteps

func (*BlockchainSteps) RegisterSteps

func (d *BlockchainSteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers did sidetree steps

type DIDSideSteps

type DIDSideSteps struct {
	// contains filtered or unexported fields
}

DIDSideSteps

func NewDIDSideSteps

func NewDIDSideSteps(context *bddtests.BDDContext) *DIDSideSteps

NewDIDSideSteps

func (*DIDSideSteps) RegisterSteps

func (d *DIDSideSteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers did sidetree steps

type FabricCLI

type FabricCLI struct {
}

FabricCLI invokes the fabric-cli command-line tool

func NewFabricCLI

func NewFabricCLI() *FabricCLI

NewFabricCLI returns a new NewFabricCLI

func (*FabricCLI) Exec

func (cli *FabricCLI) Exec(args ...string) (string, error)

Exec executes fabric-cli with the given args and returns the response

type FabricCLISteps

type FabricCLISteps struct {
	BDDContext *bddtests.BDDContext
}

FabricCLISteps extend the BDD test with Fabric CLI steps

func NewFabricCLISteps

func NewFabricCLISteps(context *bddtests.BDDContext) *FabricCLISteps

NewFabricCLISteps returns fabric-cli BDD steps

func (*FabricCLISteps) RegisterSteps

func (d *FabricCLISteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers transient data steps

type FileHandlerSteps

type FileHandlerSteps struct {
	// contains filtered or unexported fields
}

FileHandlerSteps

func NewFileHandlerSteps

func NewFileHandlerSteps(context *bddtests.BDDContext) *FileHandlerSteps

NewFileHandlerSteps

func (*FileHandlerSteps) RegisterSteps

func (d *FileHandlerSteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers did sidetree steps

type OffLedgerSteps

type OffLedgerSteps struct {
	BDDContext *bddtests.BDDContext
	// contains filtered or unexported fields
}

OffLedgerSteps ...

func NewOffLedgerSteps

func NewOffLedgerSteps(context *bddtests.BDDContext) *OffLedgerSteps

NewOffLedgerSteps ...

func (*OffLedgerSteps) DefineDCASCollectionConfig

func (d *OffLedgerSteps) DefineDCASCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32, timeToLive string)

DefineDCASCollectionConfig defines a new DCAS collection configuration

func (*OffLedgerSteps) DefineOffLedgerCollectionConfig

func (d *OffLedgerSteps) DefineOffLedgerCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32, timeToLive string)

DefineOffLedgerCollectionConfig defines a new off-ledger data collection configuration

func (*OffLedgerSteps) RegisterSteps

func (d *OffLedgerSteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers off-ledger steps

type Operation

type Operation struct {
	//Operation type
	Type string `json:"type"`
	//ID is full ID for this document - includes namespace + unique suffix
	ID string `json:"id"`
}

Operation defines sample operation

type Request

type Request interface {
	Invoke() (interface{}, error)
}

Request is a request that's submitted to the worker pool for processing

type Response

type Response struct {
	Request
	Resp interface{}
	Err  error
}

Response is the response for an individual request

type SidetreeTxnSteps

type SidetreeTxnSteps struct {
	BDDContext *bddtests.BDDContext
	// contains filtered or unexported fields
}

SidetreeTxnSteps ...

func NewSidetreeSteps

func NewSidetreeSteps(context *bddtests.BDDContext) *SidetreeTxnSteps

NewSidetreeSteps define custom steps

func (*SidetreeTxnSteps) RegisterSteps

func (t *SidetreeTxnSteps) RegisterSteps(s *godog.Suite)

RegisterSteps registers sidetree txn steps

type TxnInfo

type TxnInfo struct {
	AnchorString string `json:"anchorString"`
	Namespace    string `json:"namespace"`
}

TxnInfo

type UploadFile

type UploadFile struct {
	ContentType string `json:"contentType"`
	Content     []byte `json:"content"`
}

UploadFile contains the file upload request

type WorkerPool

type WorkerPool 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(num int) *WorkerPool

NewWorkerPool returns a new worker pool with the given number of workers

func (*WorkerPool) Responses

func (p *WorkerPool) Responses() []*Response

Responses contains the responses after the pool is stopped

func (*WorkerPool) Start

func (p *WorkerPool) Start()

Start starts all of the workers and listens for responses

func (*WorkerPool) Stop

func (p *WorkerPool) Stop()

Stop stops the workers in the pool and stops listening for responses

func (*WorkerPool) Submit

func (p *WorkerPool) Submit(req Request)

Submit submits a request for processing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL