Documentation
¶
Index ¶
- func GenerateContext(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer) *kcontext.KContext
- func GenerateFiles(t *testing.T, files []MockFile) string
- func GenerateRepository(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) *repository.Repository
- func GenerateSnapshot(t *testing.T, repo *repository.Repository, files []MockFile, ...) *snapshot.Snapshot
- func NewConfiguration(opts ...ConfigurationOptions) *storage.Configuration
- func NewMockExporter(appCtx context.Context, opt *connectors.Options, name string, ...) (exporter.Exporter, error)
- func NewMockImporter(appCtx context.Context, opts *connectors.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) Delete(ctx context.Context, res storage.StorageResource, mac objects.MAC) error
- func (mb *MockBackend) Flags() location.Flags
- func (mb *MockBackend) Get(ctx context.Context, res storage.StorageResource, mac objects.MAC, ...) (io.ReadCloser, error)
- func (mb *MockBackend) List(ctx context.Context, res storage.StorageResource) ([]objects.MAC, error)
- func (mb *MockBackend) Mode(context.Context) (storage.Mode, error)
- func (mb *MockBackend) Open(ctx context.Context) ([]byte, error)
- func (mb *MockBackend) Origin() string
- func (mb *MockBackend) Ping(ctx context.Context) error
- func (mb *MockBackend) Put(ctx context.Context, res storage.StorageResource, mac objects.MAC, ...) (int64, error)
- func (mb *MockBackend) Root() string
- func (mb *MockBackend) Size(ctx context.Context) (int64, error)
- func (mb *MockBackend) Type() string
- type MockClassifierBackend
- type MockExporter
- func (e *MockExporter) Close(ctx context.Context) error
- func (e *MockExporter) Export(ctx context.Context, records <-chan *connectors.Record, ...) error
- func (e *MockExporter) Files() map[string][]byte
- func (p *MockExporter) Flags() location.Flags
- func (e *MockExporter) Origin() string
- func (e *MockExporter) Ping(ctx context.Context) error
- func (e *MockExporter) Root() string
- func (e *MockExporter) Type() string
- type MockFile
- type MockImporter
- func (p *MockImporter) Close(ctx context.Context) error
- func (p *MockImporter) Flags() location.Flags
- func (p *MockImporter) Import(ctx context.Context, records chan<- *connectors.Record, ...) error
- func (p *MockImporter) Origin() string
- func (p *MockImporter) Ping(ctx context.Context) error
- func (p *MockImporter) Root() string
- func (p *MockImporter) SetFiles(files []MockFile)
- func (p *MockImporter) SetGenerator(gen func(chan<- *connectors.Record))
- func (p *MockImporter) Type() string
- type MockProcessorBackend
- type TestingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateContext ¶
func GenerateRepository ¶
func GenerateRepository(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) *repository.Repository
func GenerateSnapshot ¶
func GenerateSnapshot(t *testing.T, repo *repository.Repository, files []MockFile, opts ...TestingOptions) *snapshot.Snapshot
func NewConfiguration ¶
func NewConfiguration(opts ...ConfigurationOptions) *storage.Configuration
func NewMockExporter ¶
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) Delete ¶
func (mb *MockBackend) Delete(ctx context.Context, res storage.StorageResource, mac objects.MAC) error
func (*MockBackend) Flags ¶
func (mb *MockBackend) Flags() location.Flags
func (*MockBackend) Get ¶
func (mb *MockBackend) Get(ctx context.Context, res storage.StorageResource, mac objects.MAC, rg *storage.Range) (io.ReadCloser, error)
func (*MockBackend) List ¶
func (mb *MockBackend) List(ctx context.Context, res storage.StorageResource) ([]objects.MAC, error)
func (*MockBackend) Origin ¶
func (mb *MockBackend) Origin() string
func (*MockBackend) Root ¶
func (mb *MockBackend) Root() string
func (*MockBackend) Type ¶
func (mb *MockBackend) Type() string
type MockClassifierBackend ¶
type MockClassifierBackend struct {
// contains filtered or unexported fields
}
func (*MockClassifierBackend) Close ¶
func (m *MockClassifierBackend) Close() error
func (*MockClassifierBackend) Processor ¶
func (m *MockClassifierBackend) Processor(backend classifier.Backend, pathname string) classifier.ProcessorBackend
type MockExporter ¶
type MockExporter struct {
// contains filtered or unexported fields
}
func (*MockExporter) Export ¶
func (e *MockExporter) Export(ctx context.Context, records <-chan *connectors.Record, results chan<- *connectors.Result) error
func (*MockExporter) Files ¶
func (e *MockExporter) Files() map[string][]byte
func (*MockExporter) Flags ¶
func (p *MockExporter) Flags() location.Flags
func (*MockExporter) Origin ¶
func (e *MockExporter) Origin() string
func (*MockExporter) Root ¶
func (e *MockExporter) Root() string
func (*MockExporter) Type ¶
func (e *MockExporter) Type() string
type MockFile ¶
func NewMockDir ¶
func (*MockFile) ScanResult ¶
func (m *MockFile) ScanResult() *connectors.Record
type MockImporter ¶
type MockImporter struct {
FakeRoot string
// contains filtered or unexported fields
}
func (*MockImporter) Flags ¶
func (p *MockImporter) Flags() location.Flags
func (*MockImporter) Import ¶
func (p *MockImporter) Import(ctx context.Context, records chan<- *connectors.Record, results <-chan *connectors.Result) error
func (*MockImporter) Origin ¶
func (p *MockImporter) Origin() string
func (*MockImporter) Root ¶
func (p *MockImporter) Root() string
func (*MockImporter) SetFiles ¶
func (p *MockImporter) SetFiles(files []MockFile)
func (*MockImporter) SetGenerator ¶
func (p *MockImporter) SetGenerator(gen func(chan<- *connectors.Record))
func (*MockImporter) Type ¶
func (p *MockImporter) Type() string
type MockProcessorBackend ¶
type MockProcessorBackend struct {
// contains filtered or unexported fields
}
func (*MockProcessorBackend) Directory ¶
func (m *MockProcessorBackend) Directory(dirEntry *vfs.Entry) []string
func (*MockProcessorBackend) File ¶
func (m *MockProcessorBackend) File(fileEntry *vfs.Entry) []string
func (*MockProcessorBackend) Finalize ¶
func (m *MockProcessorBackend) Finalize() []string
func (*MockProcessorBackend) Name ¶
func (m *MockProcessorBackend) Name() string
func (*MockProcessorBackend) Write ¶
func (m *MockProcessorBackend) Write(buf []byte) bool
type TestingOptions ¶
type TestingOptions func(o *testingOptions)
func WithExcludes ¶
func WithExcludes(excludes []string) TestingOptions
func WithGenerator ¶
func WithGenerator(gen func(chan<- *connectors.Record)) TestingOptions
func WithName ¶
func WithName(name string) TestingOptions
Source Files
¶
Click to show internal directories.
Click to hide internal directories.