Documentation
¶
Index ¶
- func GenerateFiles(t *testing.T, files []MockFile) string
- func GenerateRepository(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) (*repository.Repository, *appcontext.AppContext)
- func GenerateRepositoryWithoutConfig(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) (*repository.Repository, *appcontext.AppContext)
- func GenerateSnapshot(t *testing.T, repo *repository.Repository, files []MockFile, ...) *snapshot.Snapshot
- func NewConfiguration(opts ...ConfigurationOptions) *storage.Configuration
- func NewMockImporter(appCtx context.Context, opts *importer.Options, name string, ...) (importer.Importer, error)
- type ConfigurationOptions
- type MockBackend
- func (mb *MockBackend) Close(ctx context.Context) error
- func (mb *MockBackend) Create(ctx context.Context, configuration []byte) error
- func (mb *MockBackend) DeleteLock(ctx context.Context, lockID objects.MAC) error
- func (mb *MockBackend) DeletePackfile(ctx context.Context, MAC objects.MAC) error
- func (mb *MockBackend) DeleteState(ctx context.Context, MAC objects.MAC) error
- func (mb *MockBackend) GetLock(ctx context.Context, lockID objects.MAC) (io.ReadCloser, error)
- func (mb *MockBackend) GetLocks(ctx context.Context) ([]objects.MAC, error)
- func (mb *MockBackend) GetPackfile(ctx context.Context, MAC objects.MAC) (io.ReadCloser, error)
- func (mb *MockBackend) GetPackfileBlob(ctx context.Context, MAC objects.MAC, offset uint64, length uint32) (io.ReadCloser, error)
- func (mb *MockBackend) GetPackfiles(ctx context.Context) ([]objects.MAC, error)
- func (mb *MockBackend) GetState(ctx context.Context, MAC objects.MAC) (io.ReadCloser, error)
- func (mb *MockBackend) GetStates(ctx context.Context) ([]objects.MAC, error)
- func (mb *MockBackend) Location(ctx context.Context) (string, error)
- func (mb *MockBackend) Mode(ctx context.Context) (storage.Mode, error)
- func (mb *MockBackend) Open(ctx context.Context) ([]byte, error)
- func (mb *MockBackend) PutLock(ctx context.Context, lockID objects.MAC, rd io.Reader) (int64, error)
- func (mb *MockBackend) PutPackfile(ctx context.Context, MAC objects.MAC, rd io.Reader) (int64, error)
- func (mb *MockBackend) PutState(ctx context.Context, MAC objects.MAC, rd io.Reader) (int64, error)
- func (mb *MockBackend) Size(ctx context.Context) (int64, error)
- type MockFTPServer
- type MockFile
- type MockImporter
- func (p *MockImporter) Close(ctx context.Context) error
- func (p *MockImporter) Origin(ctx context.Context) (string, error)
- func (p *MockImporter) Root(ctx context.Context) (string, error)
- func (p *MockImporter) Scan(ctx context.Context) (<-chan *importer.ScanResult, error)
- func (p *MockImporter) SetFiles(files []MockFile)
- func (p *MockImporter) SetGenerator(gen func(chan<- *importer.ScanResult))
- func (p *MockImporter) Type(ctx context.Context) (string, error)
- type TestingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRepository ¶
func GenerateRepository(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) (*repository.Repository, *appcontext.AppContext)
func GenerateRepositoryWithoutConfig ¶
func GenerateRepositoryWithoutConfig(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) (*repository.Repository, *appcontext.AppContext)
func GenerateSnapshot ¶
func GenerateSnapshot(t *testing.T, repo *repository.Repository, files []MockFile, opts ...TestingOptions) *snapshot.Snapshot
func NewConfiguration ¶
func NewConfiguration(opts ...ConfigurationOptions) *storage.Configuration
Types ¶
type ConfigurationOptions ¶
type ConfigurationOptions func(o *storage.Configuration)
func WithConfigurationCompression ¶
func WithConfigurationCompression(compression *compression.Configuration) ConfigurationOptions
type MockBackend ¶
type MockBackend struct {
// contains filtered or unexported fields
}
MockBackend implements the Backend interface for testing purposes
func NewMockBackend ¶
func NewMockBackend(storeConfig map[string]string) *MockBackend
func (*MockBackend) Create ¶
func (mb *MockBackend) Create(ctx context.Context, configuration []byte) error
func (*MockBackend) DeleteLock ¶
func (*MockBackend) DeletePackfile ¶
func (*MockBackend) DeleteState ¶
func (*MockBackend) GetLock ¶
func (mb *MockBackend) GetLock(ctx context.Context, lockID objects.MAC) (io.ReadCloser, error)
func (*MockBackend) GetPackfile ¶
func (mb *MockBackend) GetPackfile(ctx context.Context, MAC objects.MAC) (io.ReadCloser, error)
func (*MockBackend) GetPackfileBlob ¶
func (mb *MockBackend) GetPackfileBlob(ctx context.Context, MAC objects.MAC, offset uint64, length uint32) (io.ReadCloser, error)
func (*MockBackend) GetPackfiles ¶
func (*MockBackend) GetState ¶
func (mb *MockBackend) GetState(ctx context.Context, MAC objects.MAC) (io.ReadCloser, error)
func (*MockBackend) PutPackfile ¶
type MockFTPServer ¶ added in v1.0.3
type MockFTPServer struct {
Addr string
Files map[string][]byte
Dirs map[string]bool
// contains filtered or unexported fields
}
func NewMockFTPServer ¶ added in v1.0.3
func NewMockFTPServer() (*MockFTPServer, error)
func (*MockFTPServer) Close ¶ added in v1.0.3
func (s *MockFTPServer) Close()
func (*MockFTPServer) SetAuth ¶ added in v1.0.3
func (s *MockFTPServer) SetAuth(user, pass string)
type MockFile ¶
func NewMockDir ¶
func (*MockFile) ScanResult ¶
func (m *MockFile) ScanResult() *importer.ScanResult
type MockImporter ¶
type MockImporter struct {
// contains filtered or unexported fields
}
func (*MockImporter) Scan ¶
func (p *MockImporter) Scan(ctx context.Context) (<-chan *importer.ScanResult, error)
func (*MockImporter) SetFiles ¶
func (p *MockImporter) SetFiles(files []MockFile)
func (*MockImporter) SetGenerator ¶
func (p *MockImporter) SetGenerator(gen func(chan<- *importer.ScanResult))
type TestingOptions ¶
type TestingOptions func(o *testingOptions)
func WithGenerator ¶
func WithGenerator(gen func(chan<- *importer.ScanResult)) TestingOptions
func WithName ¶
func WithName(name string) TestingOptions
Click to show internal directories.
Click to hide internal directories.