container

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyRepository  = errors.New("repository cannot be empty")
	ErrEmptyTag         = errors.New("tag cannot be empty")
	ErrEmptyName        = errors.New("name cannot be empty")
	ErrEmptyImageName   = errors.New("image name cannot be empty")
	ErrEmptyHTTPAddress = errors.New("http address cannot be empty")
	ErrEmptyWSAddress   = errors.New("ws address cannot be empty")
)

Errors returned by the localnet package.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Start starts the container.
	Start() error

	// Stop stops the container.
	Stop() error

	// Remove removes the container.
	Remove() error

	// GetEndpoint returns the endpoint for the given id of the container.
	GetEndpoint(string) string

	// GetContainerLogs retrieves the logs out of the container.
	GetContainerLogs() ([]byte, error)
}

Client is an interface for a container client.

func NewClient

func NewClient(cfg Config) (Client, error)

NewClient creates a new ContainerClient which implements Container.

type Config

type Config struct {
	Repository  string
	Tag         string
	Name        string
	HTTPAddress string
	WSAddress   string
	Env         []string
}

Config is a configuration struct for a container.

func (Config) ValidateBasic

func (c Config) ValidateBasic() error

ValidateBasic checks if the Config is valid.

Jump to

Keyboard shortcuts

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