testdatagen

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestScenario

type TestScenario struct {
	L *logrus.Logger

	Upstream catalog.Upstream

	Publisher           *publisher.ContentPublisher
	PublisherPrivateKey ed25519.PrivateKey
	Catalog             catalog.ContentCatalog
	Escrow              *publisher.Escrow
	EscrowID            common.EscrowID

	Params       *TestScenarioParams
	Chunks       [][]byte
	ObjectID     common.ObjectID
	Caches       []*cache.Cache
	CacheConfigs []*cache.ConfigFile
}

func GenerateTestScenario

func GenerateTestScenario(l *logrus.Logger, params *TestScenarioParams) (*TestScenario, error)

func (*TestScenario) ChunkCount

func (ts *TestScenario) ChunkCount() uint64

func (*TestScenario) ObjectData

func (ts *TestScenario) ObjectData() []byte

type TestScenarioParams

type TestScenarioParams struct {
	ChunkSize  uint64
	ObjectSize uint64

	// MockUpstream indicates whether a mock upstream should be generated in place of the default HTTP upstream.  If
	// Upstream is non-nil, no upstream is generated, and this value has no effect.
	MockUpstream bool
	// GenerateObject indicates whether or not a random test object (with path "/foo/bar") should be generated.  If
	// MockUpstream is also true, the object is inserted into the mock upstream.
	GenerateObject bool

	// These are optional.  If provided, they override the default that would have been generated.
	L        *logrus.Logger
	Upstream catalog.Upstream

	PublisherAddr string
}

Jump to

Keyboard shortcuts

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