Documentation ¶
Overview ¶
Package services is a generated GoMock package.
Index ¶
- func NewCharmDownloader(cfg CharmDownloaderConfig) (*charmdownloader.Downloader, error)
- type CharmDownloaderConfig
- type CharmRepoFactory
- type CharmRepoFactoryConfig
- type CharmStorage
- type CharmStorageConfig
- type MockModelBackend
- type MockModelBackendMockRecorder
- type MockStateBackend
- func (m *MockStateBackend) ControllerConfig() (controller.Config, error)
- func (m *MockStateBackend) EXPECT() *MockStateBackendMockRecorder
- func (m *MockStateBackend) ModelUUID() string
- func (m *MockStateBackend) PrepareCharmUpload(arg0 *v9.URL) (UploadedCharm, error)
- func (m *MockStateBackend) UpdateUploadedCharm(arg0 state.CharmInfo) (UploadedCharm, error)
- type MockStateBackendMockRecorder
- func (mr *MockStateBackendMockRecorder) ControllerConfig() *gomock.Call
- func (mr *MockStateBackendMockRecorder) ModelUUID() *gomock.Call
- func (mr *MockStateBackendMockRecorder) PrepareCharmUpload(arg0 interface{}) *gomock.Call
- func (mr *MockStateBackendMockRecorder) UpdateUploadedCharm(arg0 interface{}) *gomock.Call
- type MockStorage
- type MockStorageMockRecorder
- type MockUploadedCharm
- type MockUploadedCharmMockRecorder
- type ModelBackend
- type StateBackend
- type Storage
- type UploadedCharm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCharmDownloader ¶
func NewCharmDownloader(cfg CharmDownloaderConfig) (*charmdownloader.Downloader, error)
NewCharmDownloader wires the provided configuration options into a new charmdownloader.Downloader instance.
Types ¶
type CharmDownloaderConfig ¶
type CharmDownloaderConfig struct { // The logger to use. Logger loggo.Logger // A transport that is injected when making charmhub API calls. Transport charmhub.Transport // A factory for accessing model-scoped storage for charm blobs. StorageFactory func(modelUUID string) Storage StateBackend StateBackend ModelBackend ModelBackend }
CharmDownloaderConfig encapsulates the information required for creating a new CharmDownloader instance.
type CharmRepoFactory ¶
type CharmRepoFactory struct {
// contains filtered or unexported fields
}
CharmRepoFactory instantitates charm repositories. It memoizes created repositories allowing them to be reused by subsequent GetCharmRepository calls.
func NewCharmRepoFactory ¶
func NewCharmRepoFactory(cfg CharmRepoFactoryConfig) *CharmRepoFactory
NewCharmRepoFactory returns a new factory instance with the provided configuration.
func (*CharmRepoFactory) GetCharmRepository ¶
func (f *CharmRepoFactory) GetCharmRepository(src corecharm.Source) (corecharm.Repository, error)
GetCharmRepository returns a suitable corecharm.Repository instance for the requested source. Lookups are memoized for future requests.
type CharmRepoFactoryConfig ¶
type CharmRepoFactoryConfig struct { // The logger to use. Logger loggo.Logger // A transport that is injected when making charmhub API calls. Transport charmhub.Transport StateBackend StateBackend ModelBackend ModelBackend }
CharmRepoFactoryConfig encapsulates the information required for creating a new CharmRepoFactory instance.
type CharmStorage ¶
type CharmStorage struct {
// contains filtered or unexported fields
}
CharmStorage provides an abstraction for storing charm blobs.
func NewCharmStorage ¶
func NewCharmStorage(cfg CharmStorageConfig) *CharmStorage
NewCharmStorage creates a new CharmStorage instance with the specified config.
func (*CharmStorage) PrepareToStoreCharm ¶
func (s *CharmStorage) PrepareToStoreCharm(charmURL *charm.URL) error
PrepareToStoreCharm ensures that the store is ready to process the specified charm URL. If the blob for the charm is already stored, the method returns an error to indicate this.
func (*CharmStorage) Store ¶
func (s *CharmStorage) Store(charmURL *charm.URL, downloadedCharm charmdownloader.DownloadedCharm) error
CharmStorage attempts to store the contents of a downloaded charm.
type CharmStorageConfig ¶
type CharmStorageConfig struct { // The logger to use. Logger loggo.Logger // A factory for accessing model-scoped storage for charm blobs. StorageFactory func(modelUUID string) Storage StateBackend StateBackend }
CharmStorageConfig encapsulates the information required for creating a new CharmStorage instance.
type MockModelBackend ¶
type MockModelBackend struct {
// contains filtered or unexported fields
}
MockModelBackend is a mock of ModelBackend interface.
func NewMockModelBackend ¶
func NewMockModelBackend(ctrl *gomock.Controller) *MockModelBackend
NewMockModelBackend creates a new mock instance.
func (*MockModelBackend) Config ¶
func (m *MockModelBackend) Config() (*config.Config, error)
Config mocks base method.
func (*MockModelBackend) EXPECT ¶
func (m *MockModelBackend) EXPECT() *MockModelBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockModelBackendMockRecorder ¶
type MockModelBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockModelBackendMockRecorder is the mock recorder for MockModelBackend.
func (*MockModelBackendMockRecorder) Config ¶
func (mr *MockModelBackendMockRecorder) Config() *gomock.Call
Config indicates an expected call of Config.
type MockStateBackend ¶
type MockStateBackend struct {
// contains filtered or unexported fields
}
MockStateBackend is a mock of StateBackend interface.
func NewMockStateBackend ¶
func NewMockStateBackend(ctrl *gomock.Controller) *MockStateBackend
NewMockStateBackend creates a new mock instance.
func (*MockStateBackend) ControllerConfig ¶
func (m *MockStateBackend) ControllerConfig() (controller.Config, error)
ControllerConfig mocks base method.
func (*MockStateBackend) EXPECT ¶
func (m *MockStateBackend) EXPECT() *MockStateBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStateBackend) ModelUUID ¶
func (m *MockStateBackend) ModelUUID() string
ModelUUID mocks base method.
func (*MockStateBackend) PrepareCharmUpload ¶
func (m *MockStateBackend) PrepareCharmUpload(arg0 *v9.URL) (UploadedCharm, error)
PrepareCharmUpload mocks base method.
func (*MockStateBackend) UpdateUploadedCharm ¶
func (m *MockStateBackend) UpdateUploadedCharm(arg0 state.CharmInfo) (UploadedCharm, error)
UpdateUploadedCharm mocks base method.
type MockStateBackendMockRecorder ¶
type MockStateBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockStateBackendMockRecorder is the mock recorder for MockStateBackend.
func (*MockStateBackendMockRecorder) ControllerConfig ¶
func (mr *MockStateBackendMockRecorder) ControllerConfig() *gomock.Call
ControllerConfig indicates an expected call of ControllerConfig.
func (*MockStateBackendMockRecorder) ModelUUID ¶
func (mr *MockStateBackendMockRecorder) ModelUUID() *gomock.Call
ModelUUID indicates an expected call of ModelUUID.
func (*MockStateBackendMockRecorder) PrepareCharmUpload ¶
func (mr *MockStateBackendMockRecorder) PrepareCharmUpload(arg0 interface{}) *gomock.Call
PrepareCharmUpload indicates an expected call of PrepareCharmUpload.
func (*MockStateBackendMockRecorder) UpdateUploadedCharm ¶
func (mr *MockStateBackendMockRecorder) UpdateUploadedCharm(arg0 interface{}) *gomock.Call
UpdateUploadedCharm indicates an expected call of UpdateUploadedCharm.
type MockStorage ¶
type MockStorage struct {
// contains filtered or unexported fields
}
MockStorage is a mock of Storage interface.
func NewMockStorage ¶
func NewMockStorage(ctrl *gomock.Controller) *MockStorage
NewMockStorage creates a new mock instance.
func (*MockStorage) EXPECT ¶
func (m *MockStorage) EXPECT() *MockStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStorage) Remove ¶
func (m *MockStorage) Remove(arg0 string) error
Remove mocks base method.
type MockStorageMockRecorder ¶
type MockStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockStorageMockRecorder is the mock recorder for MockStorage.
func (*MockStorageMockRecorder) Put ¶
func (mr *MockStorageMockRecorder) Put(arg0, arg1, arg2 interface{}) *gomock.Call
Put indicates an expected call of Put.
func (*MockStorageMockRecorder) Remove ¶
func (mr *MockStorageMockRecorder) Remove(arg0 interface{}) *gomock.Call
Remove indicates an expected call of Remove.
type MockUploadedCharm ¶
type MockUploadedCharm struct {
// contains filtered or unexported fields
}
MockUploadedCharm is a mock of UploadedCharm interface.
func NewMockUploadedCharm ¶
func NewMockUploadedCharm(ctrl *gomock.Controller) *MockUploadedCharm
NewMockUploadedCharm creates a new mock instance.
func (*MockUploadedCharm) EXPECT ¶
func (m *MockUploadedCharm) EXPECT() *MockUploadedCharmMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUploadedCharm) IsUploaded ¶
func (m *MockUploadedCharm) IsUploaded() bool
IsUploaded mocks base method.
type MockUploadedCharmMockRecorder ¶
type MockUploadedCharmMockRecorder struct {
// contains filtered or unexported fields
}
MockUploadedCharmMockRecorder is the mock recorder for MockUploadedCharm.
func (*MockUploadedCharmMockRecorder) IsUploaded ¶
func (mr *MockUploadedCharmMockRecorder) IsUploaded() *gomock.Call
IsUploaded indicates an expected call of IsUploaded.
type ModelBackend ¶
ModelBackend describes an API for accessing model-specific details.
type StateBackend ¶
type StateBackend interface { ControllerConfig() (controller.Config, error) UpdateUploadedCharm(info state.CharmInfo) (UploadedCharm, error) PrepareCharmUpload(curl *charm.URL) (UploadedCharm, error) ModelUUID() string }
StateBackend describes an API for accessing/mutating information in state.
type Storage ¶
type Storage interface { Put(path string, r io.Reader, length int64) error Remove(path string) error }
Storage describes an API for storing and deleting blobs.
type UploadedCharm ¶
type UploadedCharm interface {
IsUploaded() bool
}
UploadedCharm represents a charm whose upload status can be queried.