container

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerBuilder

type ContainerBuilder struct {
	*dockertest.Pool
	// contains filtered or unexported fields
}

func NewContainerBuilder

func NewContainerBuilder(endpoint string) (*ContainerBuilder, error)

NewContainerBuilder creates a new ContainerBuilder instance. The endpoint parameter specifies the Docker endpoint to connect to. can be empty to use the default.

func (*ContainerBuilder) AddContainer

func (builder *ContainerBuilder) AddContainer(id string, containerInfo ContainerInfo)

func (*ContainerBuilder) AllContainerIDs

func (builder *ContainerBuilder) AllContainerIDs() []string

func (*ContainerBuilder) FindContainer

func (builder *ContainerBuilder) FindContainer(containerName string) (*docker.APIContainers, error)

func (*ContainerBuilder) GetContainerInfo

func (builder *ContainerBuilder) GetContainerInfo(id string) (ContainerInfo, bool)

func (*ContainerBuilder) PruneAll

func (builder *ContainerBuilder) PruneAll() error

func (*ContainerBuilder) RemoveByID

func (builder *ContainerBuilder) RemoveByID(containerID string) error

type ContainerInfo

type ContainerInfo struct {
	Name string
	Type ContainerType
}

type ContainerType

type ContainerType string
const (
	ContainerTypeMongoDB ContainerType = "mongodb"
)

type MongoContainerConnection

type MongoContainerConnection struct {
	Host     string
	Port     string
	Username string
	Password string
	Database string
}

func RunMongoContainer

func RunMongoContainer(builder *ContainerBuilder, name string, options MongoContainerConnection) (MongoContainerConnection, error)

RunMongoContainer runs a MongoDB container with the specified options and returns the connection details.

type MongoContainerOptions

type MongoContainerOptions struct {
	Username string
	Password string
	Database string
	Port     string
}

Jump to

Keyboard shortcuts

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