mirror of
https://github.com/coder/coder.git
synced 2026-06-04 21:48:22 +00:00
6ccd20d45f
Completes the final piece of the puzzle. Support the pre-creation flow from the agent side.
288 lines
10 KiB
Go
Generated
288 lines
10 KiB
Go
Generated
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: .. (interfaces: ContainerCLI,DevcontainerCLI,SubAgentClient)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -destination ./acmock.go -package acmock .. ContainerCLI,DevcontainerCLI,SubAgentClient
|
|
//
|
|
|
|
// Package acmock is a generated GoMock package.
|
|
package acmock
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
agentcontainers "github.com/coder/coder/v2/agent/agentcontainers"
|
|
codersdk "github.com/coder/coder/v2/codersdk"
|
|
uuid "github.com/google/uuid"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockContainerCLI is a mock of ContainerCLI interface.
|
|
type MockContainerCLI struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockContainerCLIMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockContainerCLIMockRecorder is the mock recorder for MockContainerCLI.
|
|
type MockContainerCLIMockRecorder struct {
|
|
mock *MockContainerCLI
|
|
}
|
|
|
|
// NewMockContainerCLI creates a new mock instance.
|
|
func NewMockContainerCLI(ctrl *gomock.Controller) *MockContainerCLI {
|
|
mock := &MockContainerCLI{ctrl: ctrl}
|
|
mock.recorder = &MockContainerCLIMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockContainerCLI) EXPECT() *MockContainerCLIMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Copy mocks base method.
|
|
func (m *MockContainerCLI) Copy(ctx context.Context, containerName, src, dst string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Copy", ctx, containerName, src, dst)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Copy indicates an expected call of Copy.
|
|
func (mr *MockContainerCLIMockRecorder) Copy(ctx, containerName, src, dst any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Copy", reflect.TypeOf((*MockContainerCLI)(nil).Copy), ctx, containerName, src, dst)
|
|
}
|
|
|
|
// DetectArchitecture mocks base method.
|
|
func (m *MockContainerCLI) DetectArchitecture(ctx context.Context, containerName string) (string, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DetectArchitecture", ctx, containerName)
|
|
ret0, _ := ret[0].(string)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// DetectArchitecture indicates an expected call of DetectArchitecture.
|
|
func (mr *MockContainerCLIMockRecorder) DetectArchitecture(ctx, containerName any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DetectArchitecture", reflect.TypeOf((*MockContainerCLI)(nil).DetectArchitecture), ctx, containerName)
|
|
}
|
|
|
|
// ExecAs mocks base method.
|
|
func (m *MockContainerCLI) ExecAs(ctx context.Context, containerName, user string, args ...string) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, containerName, user}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ExecAs", varargs...)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ExecAs indicates an expected call of ExecAs.
|
|
func (mr *MockContainerCLIMockRecorder) ExecAs(ctx, containerName, user any, args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, containerName, user}, args...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecAs", reflect.TypeOf((*MockContainerCLI)(nil).ExecAs), varargs...)
|
|
}
|
|
|
|
// List mocks base method.
|
|
func (m *MockContainerCLI) List(ctx context.Context) (codersdk.WorkspaceAgentListContainersResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "List", ctx)
|
|
ret0, _ := ret[0].(codersdk.WorkspaceAgentListContainersResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// List indicates an expected call of List.
|
|
func (mr *MockContainerCLIMockRecorder) List(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockContainerCLI)(nil).List), ctx)
|
|
}
|
|
|
|
// Remove mocks base method.
|
|
func (m *MockContainerCLI) Remove(ctx context.Context, containerName string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Remove", ctx, containerName)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Remove indicates an expected call of Remove.
|
|
func (mr *MockContainerCLIMockRecorder) Remove(ctx, containerName any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockContainerCLI)(nil).Remove), ctx, containerName)
|
|
}
|
|
|
|
// Stop mocks base method.
|
|
func (m *MockContainerCLI) Stop(ctx context.Context, containerName string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Stop", ctx, containerName)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Stop indicates an expected call of Stop.
|
|
func (mr *MockContainerCLIMockRecorder) Stop(ctx, containerName any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockContainerCLI)(nil).Stop), ctx, containerName)
|
|
}
|
|
|
|
// MockDevcontainerCLI is a mock of DevcontainerCLI interface.
|
|
type MockDevcontainerCLI struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockDevcontainerCLIMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockDevcontainerCLIMockRecorder is the mock recorder for MockDevcontainerCLI.
|
|
type MockDevcontainerCLIMockRecorder struct {
|
|
mock *MockDevcontainerCLI
|
|
}
|
|
|
|
// NewMockDevcontainerCLI creates a new mock instance.
|
|
func NewMockDevcontainerCLI(ctrl *gomock.Controller) *MockDevcontainerCLI {
|
|
mock := &MockDevcontainerCLI{ctrl: ctrl}
|
|
mock.recorder = &MockDevcontainerCLIMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockDevcontainerCLI) EXPECT() *MockDevcontainerCLIMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Exec mocks base method.
|
|
func (m *MockDevcontainerCLI) Exec(ctx context.Context, workspaceFolder, configPath, cmd string, cmdArgs []string, opts ...agentcontainers.DevcontainerCLIExecOptions) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, workspaceFolder, configPath, cmd, cmdArgs}
|
|
for _, a := range opts {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "Exec", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Exec indicates an expected call of Exec.
|
|
func (mr *MockDevcontainerCLIMockRecorder) Exec(ctx, workspaceFolder, configPath, cmd, cmdArgs any, opts ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, workspaceFolder, configPath, cmd, cmdArgs}, opts...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockDevcontainerCLI)(nil).Exec), varargs...)
|
|
}
|
|
|
|
// ReadConfig mocks base method.
|
|
func (m *MockDevcontainerCLI) ReadConfig(ctx context.Context, workspaceFolder, configPath string, env []string, opts ...agentcontainers.DevcontainerCLIReadConfigOptions) (agentcontainers.DevcontainerConfig, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, workspaceFolder, configPath, env}
|
|
for _, a := range opts {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReadConfig", varargs...)
|
|
ret0, _ := ret[0].(agentcontainers.DevcontainerConfig)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ReadConfig indicates an expected call of ReadConfig.
|
|
func (mr *MockDevcontainerCLIMockRecorder) ReadConfig(ctx, workspaceFolder, configPath, env any, opts ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, workspaceFolder, configPath, env}, opts...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadConfig", reflect.TypeOf((*MockDevcontainerCLI)(nil).ReadConfig), varargs...)
|
|
}
|
|
|
|
// Up mocks base method.
|
|
func (m *MockDevcontainerCLI) Up(ctx context.Context, workspaceFolder, configPath string, opts ...agentcontainers.DevcontainerCLIUpOptions) (string, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, workspaceFolder, configPath}
|
|
for _, a := range opts {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "Up", varargs...)
|
|
ret0, _ := ret[0].(string)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Up indicates an expected call of Up.
|
|
func (mr *MockDevcontainerCLIMockRecorder) Up(ctx, workspaceFolder, configPath any, opts ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, workspaceFolder, configPath}, opts...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Up", reflect.TypeOf((*MockDevcontainerCLI)(nil).Up), varargs...)
|
|
}
|
|
|
|
// MockSubAgentClient is a mock of SubAgentClient interface.
|
|
type MockSubAgentClient struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockSubAgentClientMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockSubAgentClientMockRecorder is the mock recorder for MockSubAgentClient.
|
|
type MockSubAgentClientMockRecorder struct {
|
|
mock *MockSubAgentClient
|
|
}
|
|
|
|
// NewMockSubAgentClient creates a new mock instance.
|
|
func NewMockSubAgentClient(ctrl *gomock.Controller) *MockSubAgentClient {
|
|
mock := &MockSubAgentClient{ctrl: ctrl}
|
|
mock.recorder = &MockSubAgentClientMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockSubAgentClient) EXPECT() *MockSubAgentClientMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Create mocks base method.
|
|
func (m *MockSubAgentClient) Create(ctx context.Context, agent agentcontainers.SubAgent) (agentcontainers.SubAgent, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Create", ctx, agent)
|
|
ret0, _ := ret[0].(agentcontainers.SubAgent)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Create indicates an expected call of Create.
|
|
func (mr *MockSubAgentClientMockRecorder) Create(ctx, agent any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockSubAgentClient)(nil).Create), ctx, agent)
|
|
}
|
|
|
|
// Delete mocks base method.
|
|
func (m *MockSubAgentClient) Delete(ctx context.Context, id uuid.UUID) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Delete", ctx, id)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Delete indicates an expected call of Delete.
|
|
func (mr *MockSubAgentClientMockRecorder) Delete(ctx, id any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSubAgentClient)(nil).Delete), ctx, id)
|
|
}
|
|
|
|
// List mocks base method.
|
|
func (m *MockSubAgentClient) List(ctx context.Context) ([]agentcontainers.SubAgent, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "List", ctx)
|
|
ret0, _ := ret[0].([]agentcontainers.SubAgent)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// List indicates an expected call of List.
|
|
func (mr *MockSubAgentClientMockRecorder) List(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockSubAgentClient)(nil).List), ctx)
|
|
}
|