gcs

package
v0.0.0-...-8b94866 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "gcs"

Variables

This section is empty.

Functions

func NewService

func NewService(config mediastore.ServiceConfig) (mediastore.Service, error)

Types

type Config

type Config struct {
	BucketName      string `env:"BUCKET_NAME" yaml:"bucket_name" json:"bucket_name"`
	ProjectID       string `env:"PROJECT_ID" yaml:"project_id" json:"project_id"`
	CredentialFile  string `env:"CREDENTIAL_FILE" yaml:"credential_file" json:"credential_file"`
	Basepath        string `env:"BASEPATH" yaml:"basepath" json:"basepath"`
	BucketOperation bool   `env:"BUCKET_OPERATION" yaml:"bucket_operation" json:"bucket_operation"`
}

func ConfigSkeleton

func ConfigSkeleton() Config

func (*Config) IsAvailableCredentials

func (conf *Config) IsAvailableCredentials() (bool, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) GetObject

func (s *Service) GetObject(sourceKey string) (stream *bytes.Buffer, err error)

func (*Service) GetPublicObject

func (s *Service) GetPublicObject(sourceKey string) (targetURl string, err error)

func (*Service) PutObject

func (s *Service) PutObject(targetKey string, contentSource io.Reader) (uploadInfo *mediastore.UploadInfo, err error)

type UploadInfo

type UploadInfo struct {
	Bucket string
	Key    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL