utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const DEFAULT_DOCKER_ADDRESS = "docker.io"

Variables

This section is empty.

Functions

func ApplySocket

func ApplySocket(runtimeType RuntimeType, opts *types.ContainerConfig) types.ContainerConfig

func ContainsDomain added in v0.5.0

func ContainsDomain(s string) bool

Function to check if a string contains a domain address

func ImageURI

func ImageURI(registry, image, tag string) string

Types

type ChannelReadCloser

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

ChannelReadCloser is a custom type that implements io.ReadCloser.

func NewChannelReadCloser

func NewChannelReadCloser(ch <-chan string) *ChannelReadCloser

NewChannelReadCloser creates a new ChannelReadCloser.

func (*ChannelReadCloser) Close

func (crc *ChannelReadCloser) Close() error

Close closes the ChannelReadCloser.

func (*ChannelReadCloser) Read

func (crc *ChannelReadCloser) Read(p []byte) (n int, err error)

Read reads data from the channel into the provided buffer.

type ContainerSocket

type ContainerSocket struct {
	RuntimeType RuntimeType
	Source      string
	Target      string
}

func DockerSocket

func DockerSocket() (*ContainerSocket, error)

func PodmanSocket

func PodmanSocket() (*ContainerSocket, error)

func Socket

func Socket(runtimeType RuntimeType) (*ContainerSocket, error)

type ImageInfo

type ImageInfo struct {
	Server   string
	Registry string
	Image    string
	Tag      string
}

func ParseDockerImage

func ParseDockerImage(image string) (ImageInfo, error)

type ReadCloser

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

ReadCloser wraps a bytes.Buffer and implements io.ReadCloser

func NewReadCloser

func NewReadCloser(reader io.Reader) *ReadCloser

func (*ReadCloser) Close

func (rc *ReadCloser) Close() error

Close implements the io.Closer interface

func (*ReadCloser) Read

func (rc *ReadCloser) Read(p []byte) (int, error)

Close implements the io.Closer interface

type RuntimeType

type RuntimeType string
const (
	Docker  RuntimeType = "docker"
	Podman  RuntimeType = "podman"
	Test    RuntimeType = "test"
	Unknown RuntimeType = "unknown"
)

Jump to

Keyboard shortcuts

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