service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package service is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchImage = errors.New("no such image")
)

Functions

This section is empty.

Types

type Container

type Container struct {
	Env          []string   `json:"Env,omitempty"   yaml:"Env,omitempty"   toml:"Env,omitempty"`
	Cmd          []string   `json:"Cmd"             yaml:"Cmd"             toml:"Cmd"`
	Image        string     `json:"Image,omitempty" yaml:"Image,omitempty" toml:"Image,omitempty"`
	Entrypoint   string     `json:"entrypoint"`
	AttachStdout bool       `json:"AttachStdout"`
	AttachStderr bool       `json:"AttachStderr"`
	HostCfg      HostConfig `json:"HostConfig"`
}

type ContainerResult

type ContainerResult struct {
	Id       string   `json:"Id"`
	Warnings []string `json:"Warnings"`
}

type ContainerSrv

type ContainerSrv interface {
	Create(ctx context.Context, containerID string, container Container) (*ContainerResult, error)
	Upload(ctx context.Context, containerID string, path string, content io.Reader) error
	Fetch(ctx context.Context, containerID string, path string) (io.ReadCloser, error)
	Start(ctx context.Context, containerID string) error
	Stop(ctx context.Context, containerID string, timeout time.Duration) error
	Kill(ctx context.Context, containerID string, signal string) error
	Remove(ctx context.Context, containerID string) error
	Wait(ctx context.Context, containerID string) error
}

ContainerSrv defines functions used to handle user request.

type DockerAuthentication

type DockerAuthentication struct {
	Username      string `json:"username"`
	Password      string `json:"password"`
	Email         string `json:"email"`
	Serveraddress string `json:"serveraddress"`
}

DockerAuthentication define docker auth struct

type HostConfig

type HostConfig struct {
	NetworkMode string `json:"NetworkMode"`
	Memory      int    `json:"Memory"`
}

type ImageSrv

type ImageSrv interface {
	Build(ctx context.Context, dockerfile string, tags []string, content io.Reader) (io.ReadCloser, error)
	Create(ctx context.Context, fromImage string) (io.ReadCloser, error)
	Inspect(ctx context.Context, imageID string) (interface{}, error)
	AddTag(ctx context.Context, image, newTag string) error
	Push(ctx context.Context, imageTag string) (io.ReadCloser, error)
}

ImageSrv define imageSrv

type MockContainerSrv

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

MockContainerSrv is a mock of ContainerSrv interface.

func NewMockContainerSrv

func NewMockContainerSrv(ctrl *gomock.Controller) *MockContainerSrv

NewMockContainerSrv creates a new mock instance.

func (*MockContainerSrv) Create

func (m *MockContainerSrv) Create(arg0 context.Context, arg1 string, arg2 Container) (*ContainerResult, error)

Create mocks base method.

func (*MockContainerSrv) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockContainerSrv) Fetch

func (m *MockContainerSrv) Fetch(arg0 context.Context, arg1, arg2 string) (io.ReadCloser, error)

Fetch mocks base method.

func (*MockContainerSrv) Kill

func (m *MockContainerSrv) Kill(arg0 context.Context, arg1, arg2 string) error

Kill mocks base method.

func (*MockContainerSrv) Remove

func (m *MockContainerSrv) Remove(arg0 context.Context, arg1 string) error

Remove mocks base method.

func (*MockContainerSrv) Start

func (m *MockContainerSrv) Start(arg0 context.Context, arg1 string) error

Start mocks base method.

func (*MockContainerSrv) Stop

func (m *MockContainerSrv) Stop(arg0 context.Context, arg1 string, arg2 time.Duration) error

Stop mocks base method.

func (*MockContainerSrv) Upload

func (m *MockContainerSrv) Upload(arg0 context.Context, arg1, arg2 string, arg3 io.Reader) error

Upload mocks base method.

func (*MockContainerSrv) Wait

func (m *MockContainerSrv) Wait(arg0 context.Context, arg1 string) error

Wait mocks base method.

type MockContainerSrvMockRecorder

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

MockContainerSrvMockRecorder is the mock recorder for MockContainerSrv.

func (*MockContainerSrvMockRecorder) Create

func (mr *MockContainerSrvMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockContainerSrvMockRecorder) Fetch

func (mr *MockContainerSrvMockRecorder) Fetch(arg0, arg1, arg2 interface{}) *gomock.Call

Fetch indicates an expected call of Fetch.

func (*MockContainerSrvMockRecorder) Kill

func (mr *MockContainerSrvMockRecorder) Kill(arg0, arg1, arg2 interface{}) *gomock.Call

Kill indicates an expected call of Kill.

func (*MockContainerSrvMockRecorder) Remove

func (mr *MockContainerSrvMockRecorder) Remove(arg0, arg1 interface{}) *gomock.Call

Remove indicates an expected call of Remove.

func (*MockContainerSrvMockRecorder) Start

func (mr *MockContainerSrvMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call

Start indicates an expected call of Start.

func (*MockContainerSrvMockRecorder) Stop

func (mr *MockContainerSrvMockRecorder) Stop(arg0, arg1, arg2 interface{}) *gomock.Call

Stop indicates an expected call of Stop.

func (*MockContainerSrvMockRecorder) Upload

func (mr *MockContainerSrvMockRecorder) Upload(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Upload indicates an expected call of Upload.

func (*MockContainerSrvMockRecorder) Wait

func (mr *MockContainerSrvMockRecorder) Wait(arg0, arg1 interface{}) *gomock.Call

Wait indicates an expected call of Wait.

type MockImageSrv

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

MockImageSrv is a mock of ImageSrv interface.

func NewMockImageSrv

func NewMockImageSrv(ctrl *gomock.Controller) *MockImageSrv

NewMockImageSrv creates a new mock instance.

func (*MockImageSrv) AddTag

func (m *MockImageSrv) AddTag(arg0 context.Context, arg1, arg2 string) error

AddTag mocks base method.

func (*MockImageSrv) Build

func (m *MockImageSrv) Build(arg0 context.Context, arg1 string, arg2 []string, arg3 io.Reader) (io.ReadCloser, error)

Build mocks base method.

func (*MockImageSrv) Create

func (m *MockImageSrv) Create(arg0 context.Context, arg1 string) (io.ReadCloser, error)

Create mocks base method.

func (*MockImageSrv) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockImageSrv) Inspect

func (m *MockImageSrv) Inspect(arg0 context.Context, arg1 string) (interface{}, error)

Inspect mocks base method.

func (*MockImageSrv) Push

func (m *MockImageSrv) Push(arg0 context.Context, arg1 string) (io.ReadCloser, error)

Push mocks base method.

type MockImageSrvMockRecorder

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

MockImageSrvMockRecorder is the mock recorder for MockImageSrv.

func (*MockImageSrvMockRecorder) AddTag

func (mr *MockImageSrvMockRecorder) AddTag(arg0, arg1, arg2 interface{}) *gomock.Call

AddTag indicates an expected call of AddTag.

func (*MockImageSrvMockRecorder) Build

func (mr *MockImageSrvMockRecorder) Build(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Build indicates an expected call of Build.

func (*MockImageSrvMockRecorder) Create

func (mr *MockImageSrvMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockImageSrvMockRecorder) Inspect

func (mr *MockImageSrvMockRecorder) Inspect(arg0, arg1 interface{}) *gomock.Call

Inspect indicates an expected call of Inspect.

func (*MockImageSrvMockRecorder) Push

func (mr *MockImageSrvMockRecorder) Push(arg0, arg1 interface{}) *gomock.Call

Push indicates an expected call of Push.

type MockService

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

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) Containers

func (m *MockService) Containers() ContainerSrv

Containers mocks base method.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) Images

func (m *MockService) Images() ImageSrv

Images mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) Containers

func (mr *MockServiceMockRecorder) Containers() *gomock.Call

Containers indicates an expected call of Containers.

func (*MockServiceMockRecorder) Images

func (mr *MockServiceMockRecorder) Images() *gomock.Call

Images indicates an expected call of Images.

type Service

type Service interface {
	Containers() ContainerSrv
	Images() ImageSrv
}

Service defines functions used to return resource interface.

var Srv Service

func NewService

func NewService(docker docker.DockerService, k8s k8s.K8sService) Service

NewService returns Service interface.

Jump to

Keyboard shortcuts

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