Documentation ¶
Index ¶
Constants ¶
const (
LocalStorageName = "file"
)
LocalStorageName is a file storage name.
const (
S3StorageName = "s3"
)
S3StorageName is a s3 storage name.
Variables ¶
This section is empty.
Functions ¶
func ExtractS3BucketAndPrefix ¶
ExtractS3BucketAndPrefix extracts bucket name and prefix path from provided uri. after processing of this uri s3://fasttrackml/2/30357ed2eaac4f2cacdbcd0e06e9e48a/artifacts result will be: - bucket = fasttrackml - prefix = 2/30357ed2eaac4f2cacdbcd0e06e9e48a/artifacts
Types ¶
type ArtifactObject ¶
ArtifactObject represents Artifact object agnostic to selected storage.
func (ArtifactObject) GetPath ¶
func (o ArtifactObject) GetPath() string
GetPath returns Artifact Path.
func (ArtifactObject) GetSize ¶
func (o ArtifactObject) GetSize() int64
GetSize returns Artifact Size in bytes.
func (ArtifactObject) IsDirectory ¶
func (o ArtifactObject) IsDirectory() bool
IsDirectory show that object is directly or not.
type ArtifactStorageFactory ¶ added in v0.3.2
type ArtifactStorageFactory struct {
// contains filtered or unexported fields
}
ArtifactStorageFactory represents Artifact Storage .
func NewArtifactStorageFactory ¶ added in v0.3.2
func NewArtifactStorageFactory(config *config.ServiceConfig) (*ArtifactStorageFactory, error)
NewArtifactStorageFactory creates new Artifact Storage Factory instance.
func (*ArtifactStorageFactory) GetStorage ¶ added in v0.3.2
func (s *ArtifactStorageFactory) GetStorage( ctx context.Context, runArtifactPath string, ) (ArtifactStorageProvider, error)
GetStorage returns Artifact storage based on provided runArtifactPath.
type ArtifactStorageFactoryProvider ¶ added in v0.3.2
type ArtifactStorageFactoryProvider interface { // GetStorage returns Artifact storage based on provided runArtifactPath. GetStorage(ctx context.Context, runArtifactPath string) (ArtifactStorageProvider, error) }
ArtifactStorageFactoryProvider provides an interface provider to work with Artifact Storage.
type ArtifactStorageProvider ¶ added in v0.3.2
type ArtifactStorageProvider interface { // Get returns an io.ReadCloser for specific artifact. Get(ctx context.Context, artifactURI, path string) (io.ReadCloser, error) // List lists all artifact object under provided path. List(ctx context.Context, artifactURI, path string) ([]ArtifactObject, error) }
ArtifactStorageProvider provides an interface to work with artifact storage.
type Local ¶
type Local struct{}
Local represents local file storage adapter to work with artifacts.
func NewLocal ¶
func NewLocal(config *config.ServiceConfig) (*Local, error)
NewLocal creates new Local storage instance.
type MockArtifactStorageFactoryProvider ¶ added in v0.3.2
MockArtifactStorageFactoryProvider is an autogenerated mock type for the ArtifactStorageFactoryProvider type
func NewMockArtifactStorageFactoryProvider ¶ added in v0.3.2
func NewMockArtifactStorageFactoryProvider(t interface { mock.TestingT Cleanup(func()) }) *MockArtifactStorageFactoryProvider
NewMockArtifactStorageFactoryProvider creates a new instance of MockArtifactStorageFactoryProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockArtifactStorageFactoryProvider) GetStorage ¶ added in v0.3.2
func (_m *MockArtifactStorageFactoryProvider) GetStorage(ctx context.Context, runArtifactPath string) (ArtifactStorageProvider, error)
GetStorage provides a mock function with given fields: ctx, runArtifactPath
type MockArtifactStorageProvider ¶ added in v0.3.2
MockArtifactStorageProvider is an autogenerated mock type for the ArtifactStorageProvider type
func NewMockArtifactStorageProvider ¶ added in v0.3.2
func NewMockArtifactStorageProvider(t interface { mock.TestingT Cleanup(func()) }) *MockArtifactStorageProvider
NewMockArtifactStorageProvider creates a new instance of MockArtifactStorageProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockArtifactStorageProvider) Get ¶ added in v0.3.2
func (_m *MockArtifactStorageProvider) Get(ctx context.Context, artifactURI string, path string) (io.ReadCloser, error)
Get provides a mock function with given fields: ctx, artifactURI, path
func (*MockArtifactStorageProvider) List ¶ added in v0.3.2
func (_m *MockArtifactStorageProvider) List(ctx context.Context, artifactURI string, path string) ([]ArtifactObject, error)
List provides a mock function with given fields: ctx, artifactURI, path