types

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVar

type EnvVar struct {
	Text    string
	Key     string
	Value   string
	Mutable bool
}

EnvVar represents a single environement variable for a container.

type PortMapping

type PortMapping struct {
	Text          string
	HostPort      uint16
	ContainerPort uint16
}

PortMapping represents a single port mapping for a container.

type Service

type Service struct {
	Tag          string
	Name         string
	Image        string
	Volumes      []VolumeMount
	PortMappings []PortMapping
	Env          []EnvVar
	Command      []string
}

Service describes the properties and methods for a service like MySQL or Redis. All the available services in tent uses this struct as their type.

func (*Service) CreateContainer

func (service *Service) CreateContainer(connText *context.Context) (containerID string)

CreateContainer method creates a new container with using a given image pulled by PullImage method.

func (*Service) GetContainerName

func (service *Service) GetContainerName() (containerName string)

GetContainerName method generates unique name for each container by combining their image tag and exposed port number.

func (*Service) GetImageName

func (service *Service) GetImageName() (imageName string)

GetImageName method generates full image name for services by combining their image name and tag.

func (*Service) GetVolumeName

func (service *Service) GetVolumeName() (volumeName string)

GetVolumeName method generates unique name for each volume used by different containers by using their container name.

func (*Service) ShowPrompt

func (service *Service) ShowPrompt()

ShowPrompt method presents user with user friendly prompts.

type VolumeMount added in v0.0.4

type VolumeMount struct {
	Text string
	Name string
	Dest string
}

VolumeMount represents a single volume mount for a container.

Jump to

Keyboard shortcuts

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