Documentation ¶
Index ¶
Constants ¶
const (
GSStorageName = "gs"
)
GSStorageName is a Google Storage name.
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 ExtractBucketAndPrefix ¶
ExtractBucketAndPrefix extracts bucket name and prefix path from provided uri. uri could be any S3 compatible storage uri like AWS S3 or Google Storage. after processing of 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 ¶
type ArtifactStorageFactory struct {
// contains filtered or unexported fields
}
ArtifactStorageFactory represents Artifact Storage .
func NewArtifactStorageFactory ¶
func NewArtifactStorageFactory(config *config.Config) (*ArtifactStorageFactory, error)
NewArtifactStorageFactory creates new Artifact Storage Factory instance.
func (*ArtifactStorageFactory) GetStorage ¶
func (s *ArtifactStorageFactory) GetStorage( ctx context.Context, runArtifactPath string, ) (ArtifactStorageProvider, error)
GetStorage returns Artifact storage based on provided runArtifactPath.
type ArtifactStorageFactoryProvider ¶
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 ¶
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 GS ¶
type GS struct {
// contains filtered or unexported fields
}
GS represents adapter to work with GS storage artifacts.
type Local ¶
type Local struct{}
Local represents local file storage adapter to work with artifacts.
type MockArtifactStorageFactoryProvider ¶
MockArtifactStorageFactoryProvider is an autogenerated mock type for the ArtifactStorageFactoryProvider type
func NewMockArtifactStorageFactoryProvider ¶
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 ¶
func (_m *MockArtifactStorageFactoryProvider) GetStorage(ctx context.Context, runArtifactPath string) (ArtifactStorageProvider, error)
GetStorage provides a mock function with given fields: ctx, runArtifactPath
type MockArtifactStorageProvider ¶
MockArtifactStorageProvider is an autogenerated mock type for the ArtifactStorageProvider type
func NewMockArtifactStorageProvider ¶
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 ¶
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 ¶
func (_m *MockArtifactStorageProvider) List(ctx context.Context, artifactURI string, path string) ([]ArtifactObject, error)
List provides a mock function with given fields: ctx, artifactURI, path