Documentation ¶
Overview ¶
Package gcs provides a storage implementation for GCS
Index ¶
- type Config
- type Storage
- func (g *Storage) Delete(ctx context.Context, path string) error
- func (g *Storage) Open(ctx context.Context, path string) (io.ReadCloser, error)
- func (g *Storage) OpenWithStat(ctx context.Context, path string) (io.ReadCloser, *gostorage.Stat, error)
- func (g *Storage) Save(ctx context.Context, content io.Reader, path string) (rerr error)
- func (g *Storage) Stat(ctx context.Context, path string) (*gostorage.Stat, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Enabled is a flag to enable or disable the storage Enabled bool `json:"enabled" koanf:"enabled" default:"false"` // CredentialsFile is the path to the credentials file CredentialsFile string `json:"credentialsFile" koanf:"credentialsFile" default:"./credentials.json"` // Bucket is the name of the bucket Bucket string `json:"bucket" koanf:"bucket" default:"yourbucketname"` }
Config is the configuration for Storage - need to blow this out but initial focus was on s3
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a Google Cloud Storage interface
func NewStorage ¶
NewStorage returns a new GCP Storage with the provided configuration
func (*Storage) OpenWithStat ¶
func (g *Storage) OpenWithStat(ctx context.Context, path string) (io.ReadCloser, *gostorage.Stat, error)
OpenWithStat opens path for reading with file stats
Click to show internal directories.
Click to hide internal directories.