Documentation
¶
Index ¶
- type AzureBackend
- func (a *AzureBackend) Delete(ctx context.Context, path string) error
- func (a *AzureBackend) Download(ctx context.Context, path string) (io.ReadCloser, error)
- func (a *AzureBackend) Exists(ctx context.Context, path string) (bool, error)
- func (a *AzureBackend) GetLastModified(ctx context.Context, path string) (time.Time, error)
- func (a *AzureBackend) GetSize(ctx context.Context, path string) (int64, error)
- func (a *AzureBackend) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error)
- func (a *AzureBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (a *AzureBackend) Upload(ctx context.Context, path string, reader io.Reader, size int64) error
- type AzureConfig
- type Backend
- type Config
- type FilesystemBackend
- func (f *FilesystemBackend) Delete(ctx context.Context, path string) error
- func (f *FilesystemBackend) Download(ctx context.Context, path string) (io.ReadCloser, error)
- func (f *FilesystemBackend) Exists(ctx context.Context, path string) (bool, error)
- func (f *FilesystemBackend) GetLastModified(ctx context.Context, path string) (time.Time, error)
- func (f *FilesystemBackend) GetSize(ctx context.Context, path string) (int64, error)
- func (f *FilesystemBackend) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error)
- func (f *FilesystemBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (f *FilesystemBackend) Upload(ctx context.Context, path string, reader io.Reader, size int64) error
- type FilesystemConfig
- type S3Backend
- func (s *S3Backend) Delete(ctx context.Context, path string) error
- func (s *S3Backend) Download(ctx context.Context, path string) (io.ReadCloser, error)
- func (s *S3Backend) Exists(ctx context.Context, path string) (bool, error)
- func (s *S3Backend) GetLastModified(ctx context.Context, path string) (time.Time, error)
- func (s *S3Backend) GetSize(ctx context.Context, path string) (int64, error)
- func (s *S3Backend) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error)
- func (s *S3Backend) List(ctx context.Context, prefix string) ([]string, error)
- func (s *S3Backend) Upload(ctx context.Context, path string, reader io.Reader, size int64) error
- type S3Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureBackend ¶
type AzureBackend struct {
// contains filtered or unexported fields
}
AzureBackend implements the Backend interface using Azure Blob Storage AzureBackend implements the Backend interface using Azure Blob Storage
func NewAzureBackend ¶
func NewAzureBackend(config AzureConfig) (*AzureBackend, error)
NewAzureBackend creates a new Azure Blob Storage backend
func (*AzureBackend) Delete ¶
func (a *AzureBackend) Delete(ctx context.Context, path string) error
Delete deletes a file from Azure Blob Storage
func (*AzureBackend) Download ¶
func (a *AzureBackend) Download(ctx context.Context, path string) (io.ReadCloser, error)
Download downloads a file from Azure Blob Storage
func (*AzureBackend) GetLastModified ¶
GetLastModified returns the last modified time of a file
func (*AzureBackend) GetURL ¶
func (a *AzureBackend) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error)
GetURL returns a presigned URL for downloading
type AzureConfig ¶
type Backend ¶
type Backend interface { // Upload uploads a file to the storage backend Upload(ctx context.Context, path string, reader io.Reader, size int64) error // Download downloads a file from the storage backend Download(ctx context.Context, path string) (io.ReadCloser, error) // Delete deletes a file from the storage backend Delete(ctx context.Context, path string) error // Exists checks if a file exists in the storage backend Exists(ctx context.Context, path string) (bool, error) // GetSize returns the size of a file in bytes GetSize(ctx context.Context, path string) (int64, error) // GetLastModified returns the last modified time of a file GetLastModified(ctx context.Context, path string) (time.Time, error) // List lists files with the given prefix List(ctx context.Context, prefix string) ([]string, error) // GetURL returns a presigned URL for downloading (if supported) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error) }
Backend defines the interface for artifact storage backends
func NewBackend ¶
NewBackend creates a new storage backend based on the configuration
type Config ¶
type Config struct { Backend string Azure AzureConfig S3 S3Config Filesystem FilesystemConfig }
Config holds the configuration for storage backends
type FilesystemBackend ¶
type FilesystemBackend struct {
// contains filtered or unexported fields
}
FilesystemBackend implements the Backend interface using local filesystem
func NewFilesystemBackend ¶
func NewFilesystemBackend(config FilesystemConfig) (*FilesystemBackend, error)
NewFilesystemBackend creates a new filesystem storage backend
func (*FilesystemBackend) Delete ¶
func (f *FilesystemBackend) Delete(ctx context.Context, path string) error
Delete deletes a file from the filesystem
func (*FilesystemBackend) Download ¶
func (f *FilesystemBackend) Download(ctx context.Context, path string) (io.ReadCloser, error)
Download downloads a file from the filesystem
func (*FilesystemBackend) GetLastModified ¶
GetLastModified returns the last modified time of a file
func (*FilesystemBackend) GetURL ¶
func (f *FilesystemBackend) GetURL(ctx context.Context, path string, expiry time.Duration) (string, error)
GetURL returns a presigned URL for downloading (not supported for filesystem)
type FilesystemConfig ¶
type FilesystemConfig struct {
BasePath string
}
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
S3Backend implements the Backend interface using S3-compatible storage
func NewS3Backend ¶
NewS3Backend creates a new S3-compatible storage backend
func (*S3Backend) GetLastModified ¶
GetLastModified returns the last modified time of a file