Documentation ¶
Overview ¶
Package storage is a generated GoMock package.
Package storage is a generated GoMock package.
Index ¶
- type Database
- func NewInstalledVMs(db database.Database) *Database[InstallInfo]
- func NewRegistry(db database.Database) *Database[RepoList]
- func NewSourceInfo(db database.Database) *Database[SourceInfo]
- func NewSubnet(db database.Database) *Database[Definition[types.Subnet]]
- func NewVM(db database.Database) *Database[Definition[types.VM]]
- type Definition
- type InstallInfo
- type Iterator
- type MockRepositoryFactory
- type MockRepositoryFactoryMockRecorder
- type MockStorage
- func (m *MockStorage[V]) Delete(key []byte) error
- func (m *MockStorage[V]) EXPECT() *MockStorageMockRecorder[V]
- func (m *MockStorage[V]) Get(key []byte) (V, error)
- func (m *MockStorage[V]) Has(key []byte) (bool, error)
- func (m *MockStorage[V]) Iterator() Iterator[V]
- func (m *MockStorage[V]) Put(key []byte, value V) error
- type MockStorageMockRecorder
- func (mr *MockStorageMockRecorder[V]) Delete(key interface{}) *gomock.Call
- func (mr *MockStorageMockRecorder[V]) Get(key interface{}) *gomock.Call
- func (mr *MockStorageMockRecorder[V]) Has(key interface{}) *gomock.Call
- func (mr *MockStorageMockRecorder[V]) Iterator() *gomock.Call
- func (mr *MockStorageMockRecorder[V]) Put(key, value interface{}) *gomock.Call
- type RepoList
- type Repository
- type RepositoryFactory
- type SourceInfo
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database[V any] struct { // contains filtered or unexported fields }
func NewInstalledVMs ¶
func NewInstalledVMs(db database.Database) *Database[InstallInfo]
func NewSourceInfo ¶
func NewSourceInfo(db database.Database) *Database[SourceInfo]
type Definition ¶
type Definition[T types.Definition] struct { Definition T `yaml:"definition"` Commit plumbing.Hash `yaml:"commit"` }
Definition stores a plugin definition alongside the plugin-repository's commit it was downloaded from. TODO gc plugins
type InstallInfo ¶
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 ¶
func (m *MockRepositoryFactory) EXPECT() *MockRepositoryFactoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepositoryFactory) GetRepository ¶
func (m *MockRepositoryFactory) GetRepository(alias []byte) Repository
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 MockStorage ¶
type MockStorage[V any] struct { // contains filtered or unexported fields }
MockStorage is a mock of Storage interface.
func NewMockStorage ¶
func NewMockStorage[V any](ctrl *gomock.Controller) *MockStorage[V]
NewMockStorage creates a new mock instance.
func (*MockStorage[V]) Delete ¶
func (m *MockStorage[V]) Delete(key []byte) error
Delete mocks base method.
func (*MockStorage[V]) EXPECT ¶
func (m *MockStorage[V]) EXPECT() *MockStorageMockRecorder[V]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStorage[V]) Get ¶
func (m *MockStorage[V]) Get(key []byte) (V, error)
Get mocks base method.
func (*MockStorage[V]) Has ¶
func (m *MockStorage[V]) Has(key []byte) (bool, error)
Has mocks base method.
func (*MockStorage[V]) Iterator ¶
func (m *MockStorage[V]) Iterator() Iterator[V]
Iterator mocks base method.
func (*MockStorage[V]) Put ¶
func (m *MockStorage[V]) Put(key []byte, value V) error
Put mocks base method.
type MockStorageMockRecorder ¶
type MockStorageMockRecorder[V any] struct { // contains filtered or unexported fields }
MockStorageMockRecorder is the mock recorder for MockStorage.
func (*MockStorageMockRecorder[V]) Delete ¶
func (mr *MockStorageMockRecorder[V]) Delete(key interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockStorageMockRecorder[V]) Get ¶
func (mr *MockStorageMockRecorder[V]) Get(key interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockStorageMockRecorder[V]) Has ¶
func (mr *MockStorageMockRecorder[V]) Has(key interface{}) *gomock.Call
Has indicates an expected call of Has.
func (*MockStorageMockRecorder[V]) Iterator ¶
func (mr *MockStorageMockRecorder[V]) Iterator() *gomock.Call
Iterator indicates an expected call of Iterator.
func (*MockStorageMockRecorder[V]) Put ¶
func (mr *MockStorageMockRecorder[V]) Put(key, value interface{}) *gomock.Call
Put indicates an expected call of Put.
type RepoList ¶
type RepoList struct {
Repositories []string `yaml:"repositories"`
}
RepoList is a list of repositories that support a single plugin alias. e.g. foo/plugin, bar/plugin => plugin: [foo, bar]
type Repository ¶
type Repository struct { VMs Storage[Definition[types.VM]] Subnets Storage[Definition[types.Subnet]] }
Repository wraps a plugin repository's VMs and Subnets
type RepositoryFactory ¶
type RepositoryFactory interface {
GetRepository(alias []byte) Repository
}
func NewRepositoryFactory ¶
func NewRepositoryFactory(db database.Database) RepositoryFactory
type SourceInfo ¶
type SourceInfo struct { Alias string `yaml:"alias"` URL string `yaml:"url"` Commit plumbing.Hash `yaml:"commit"` Branch plumbing.ReferenceName `yaml:"branch"` }
SourceInfo represents a repository, its source, and the last synced commit.