storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package storage is a generated GoMock package.

Package storage is a generated GoMock package.

Index

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 NewRegistry

func NewRegistry(db database.Database) *Database[RepoList]

func NewSourceInfo

func NewSourceInfo(db database.Database) *Database[SourceInfo]

func NewVM

func (*Database[V]) Delete

func (c *Database[V]) Delete(key []byte) error

func (*Database[V]) Get

func (c *Database[V]) Get(key []byte) (V, error)

func (*Database[V]) Has

func (c *Database[V]) Has(key []byte) (bool, error)

func (*Database[V]) Iterator

func (c *Database[V]) Iterator() Iterator[V]

func (*Database[V]) Put

func (c *Database[V]) Put(key []byte, value V) error

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 InstallInfo struct {
	ID      string           `yaml:"id"`
	Version version.Semantic `yaml:"version"`
}

type Iterator

type Iterator[V any] struct {
	// contains filtered or unexported fields
}

func NewIterator

func NewIterator[V any](itr database.Iterator) *Iterator[V]

func (*Iterator[V]) Error

func (i *Iterator[V]) Error() error

func (*Iterator[V]) Key

func (i *Iterator[V]) Key() []byte

func (*Iterator[V]) Next

func (i *Iterator[V]) Next() bool

func (*Iterator[V]) Release

func (i *Iterator[V]) Release()

func (*Iterator[V]) Value

func (i *Iterator[V]) Value() (V, error)

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 []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.

type Storage

type Storage[V any] interface {
	Has(key []byte) (bool, error)
	Put(key []byte, value V) error
	Get(key []byte) (V, error)
	Delete(key []byte) error
	Iterator() Iterator[V]
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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