state

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package state is a generated GoMock package.

Package state is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition[T types.Definition] struct {
	Definition T      `yaml:"definition"`
	Commit     string `yaml:"commit"`
}

Definition stores a plugin definition alongside the plugin-repository's commit it was downloaded from.

type DiskRepository

type DiskRepository struct {
	Git  git.Factory
	Path string
}

func (DiskRepository) GetPath

func (d DiskRepository) GetPath() string

func (DiskRepository) GetSubnet

func (d DiskRepository) GetSubnet(name string) (Definition[types.Subnet], error)

func (DiskRepository) GetVM

func (d DiskRepository) GetVM(name string) (Definition[types.VM], error)

type File

type File struct {
	// Mapping of each tracked repository's alias to its metadata
	Sources map[string]*SourceInfo `yaml:"sources"`
	// Mapping of each installed vm's alias to the version installed
	InstallationRegistry map[string]*InstallInfo `yaml:"installation-registry"`
	// contains filtered or unexported fields
}

File is the representation of the current APM state. Not safe for concurrent use.

func New

func New(path string) (File, error)

func (*File) Commit

func (s *File) Commit() error

type InstallInfo

type InstallInfo struct {
	ID     string `yaml:"id"`
	Commit string `yaml:"commit"`
}

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) EXPECT

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

func (*MockRepository) GetPath

func (m *MockRepository) GetPath() string

GetPath mocks base method.

func (*MockRepository) GetSubnet

func (m *MockRepository) GetSubnet(name string) (Definition[types.Subnet], error)

GetSubnet mocks base method.

func (*MockRepository) GetVM

func (m *MockRepository) GetVM(name string) (Definition[types.VM], error)

GetVM mocks base method.

type MockRepositoryFactory

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

MockRepositoryFactory is a mock of RepositoryFactory interface.

func NewMockRepositoryFactory

func NewMockRepositoryFactory(ctrl *gomock.Controller) *MockRepositoryFactory

NewMockRepositoryFactory creates a new mock instance.

func (*MockRepositoryFactory) EXPECT

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

func (*MockRepositoryFactory) GetRepository

func (m *MockRepositoryFactory) GetRepository(alias string) (Repository, error)

GetRepository mocks base method.

type MockRepositoryFactoryMockRecorder

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

MockRepositoryFactoryMockRecorder is the mock recorder for MockRepositoryFactory.

func (*MockRepositoryFactoryMockRecorder) GetRepository

func (mr *MockRepositoryFactoryMockRecorder) GetRepository(alias interface{}) *gomock.Call

GetRepository indicates an expected call of GetRepository.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) GetPath

func (mr *MockRepositoryMockRecorder) GetPath() *gomock.Call

GetPath indicates an expected call of GetPath.

func (*MockRepositoryMockRecorder) GetSubnet

func (mr *MockRepositoryMockRecorder) GetSubnet(name interface{}) *gomock.Call

GetSubnet indicates an expected call of GetSubnet.

func (*MockRepositoryMockRecorder) GetVM

func (mr *MockRepositoryMockRecorder) GetVM(name interface{}) *gomock.Call

GetVM indicates an expected call of GetVM.

type Repository

type Repository interface {
	GetPath() string
	GetVM(name string) (Definition[types.VM], error)
	GetSubnet(name string) (Definition[types.Subnet], error)
}

Repository wraps a plugin repository's VMs and Subnets

type RepositoryFactory

type RepositoryFactory interface {
	GetRepository(alias string) (Repository, error)
}

func NewRepositoryFactory

func NewRepositoryFactory(reposPath string) RepositoryFactory

type SourceInfo

type SourceInfo struct {
	URL    string                 `yaml:"url"`
	Commit string                 `yaml:"commit"`
	Branch plumbing.ReferenceName `yaml:"branch"`
}

SourceInfo represents a repository, its source, and the last synced commit.

Jump to

Keyboard shortcuts

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