gclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContainer

func CreateContainer(s Supplier) error

CreateContainer return

func DownloadImage

func DownloadImage(s Supplier, name string) bool

DownloadImage is the main image pull consumer

func ShowContainers

func ShowContainers(s Supplier) ([]string, error)

ShowContainers is the consumer utility

func ShowImagesIDs

func ShowImagesIDs(s Supplier) ([]string, error)

ShowImagesIDs return a slice with all images

Types

type Manager

type Manager struct {
	Cli *client.Client
}

Manager is the client core struct

func NewManager

func NewManager() *Manager

NewManager returns the Manager struct

func (*Manager) BuildClient

func (m *Manager) BuildClient()

BuildClient create new Docker client instance

func (*Manager) BuildContainer

func (m *Manager) BuildContainer() error

BuildContainer create local container from pulled image

func (*Manager) ListContainers

func (m *Manager) ListContainers() ([]string, error)

ListContainers list system containers

func (*Manager) ListImages

func (m *Manager) ListImages() ([]types.ImageSummary, error)

ListImages returns slice of pulled images

func (*Manager) PullImage

func (m *Manager) PullImage(name string) error

PullImage is the image pull wrapper

type MockManager

type MockManager struct {
	Cli *client.Client
}

MockManager mock Repo object

func NewMockManager

func NewMockManager() *MockManager

NewMockManager returns MockManager instance

func (*MockManager) BuildClient

func (m *MockManager) BuildClient()

BuildClient mock

func (*MockManager) BuildContainer

func (m *MockManager) BuildContainer() error

BuildContainer create local container from pulled image

func (*MockManager) ListContainers

func (m *MockManager) ListContainers() ([]string, error)

ListContainers list system containers

func (*MockManager) ListImages

func (m *MockManager) ListImages() ([]types.ImageSummary, error)

ListImages returns slice of pulled images

func (*MockManager) PullImage

func (m *MockManager) PullImage(name string) error

PullImage mocks the docker image pull

type Supplier

type Supplier interface {
	BuildClient()
	ListContainers() ([]string, error)
	PullImage(string) error
	ListImages() ([]types.ImageSummary, error)
	BuildContainer() error
}

Supplier is the client interface

Jump to

Keyboard shortcuts

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