networks

package
v0.0.0-...-5bec9b4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 9 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network interface{}

A marker interface for representing a generic test network. Developers should add their own interface that

extends this interface.

type NetworkContext

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

func NewNetworkContext

func NewNetworkContext(
	client bindings.TestExecutionServiceClient,
	filesArtifactUrls map[services.FilesArtifactID]string) *NetworkContext

Creates a new NetworkContext object with the given parameters.

Args:

client: The Kurtosis API client that the NetworkContext will use for modifying the state of the testnet
filesArtifactUrls: The mapping of filesArtifactId -> URL for the artifacts that the testsuite will use

func (*NetworkContext) AddService

Adds a service to the network in the default partition with the given service ID

NOTE: If the network has been repartitioned and the default partition hasn't been preserved, you should use

AddServiceToPartition instead.

Args:

serviceId: The service ID that will be used to identify this node in the network.
initializer: The Docker container initializer that contains the logic for starting the service

Return:

service: The new service

func (*NetworkContext) AddServiceToPartition

func (networkCtx *NetworkContext) AddServiceToPartition(
	serviceId services.ServiceID,
	partitionId PartitionID,
	initializer services.DockerContainerInitializer) (services.Service, services.AvailabilityChecker, error)

Adds a service to the network with the given service ID, created using the given configuration ID.

NOTE: If the network hasn't been repartitioned yet, the PartitionID should be an empty string to add to the default

partition.

Args:

serviceId: The service ID that will be used to identify this node in the network.
partitionId: The partition ID to add the service to
initializer: The Docker container initializer that contains the logic for starting the service

Return:

service.Service: The new service

func (NetworkContext) GetRepartitionerBuilder

func (networkCtx NetworkContext) GetRepartitionerBuilder(isDefaultPartitionConnectionBlocked bool) *RepartitionerBuilder

Constructs a new repartitioner builder in preparation for a repartition.

Args:

isDefaultPartitionConnectionBlocked: If true, when the connection details between two partitions aren't specified
	during a repartition then traffic between them will be blocked by default

func (*NetworkContext) GetService

func (networkCtx *NetworkContext) GetService(serviceId services.ServiceID) (services.Service, error)

Gets the service with the given ID, or returns an error if no service with that ID exists.

func (*NetworkContext) RemoveService

func (networkCtx *NetworkContext) RemoveService(serviceId services.ServiceID, containerStopTimeoutSeconds uint64) error

Stops the container with the given service ID, and removes it from the network.

func (*NetworkContext) RepartitionNetwork

func (networkCtx *NetworkContext) RepartitionNetwork(repartitioner *Repartitioner) error

Repartitions the network using the given repartitioner. A repartitioner builder can be constructed using the

NewRepartitionerBuilder method of this network context object.

type PartitionID

type PartitionID string

type Repartitioner

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

type RepartitionerBuilder

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

This struct is designed not to throw an error on any of its methods, so that they can be fluently chained together An error will only be thrown on "build"

func (*RepartitionerBuilder) Build

func (builder *RepartitionerBuilder) Build() (*Repartitioner, error)

Builds a Repartitioner by applying the transformations specified on the RepartitionerBuilder

func (*RepartitionerBuilder) WithPartition

func (builder *RepartitionerBuilder) WithPartition(partition PartitionID, services ...services.ServiceID) *RepartitionerBuilder

func (*RepartitionerBuilder) WithPartitionConnection

func (builder *RepartitionerBuilder) WithPartitionConnection(partitionA PartitionID, partitionB PartitionID, isBlocked bool) *RepartitionerBuilder

Jump to

Keyboard shortcuts

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