Documentation ¶
Index ¶
- Variables
- func GetCredentials(ctx context.Context) (*google.Credentials, error)
- type ContentType
- type GCSRepository
- func (gcs *GCSRepository) Download(path string, toFile string) ([]byte, error)
- func (gcs *GCSRepository) Read(path string) ([]byte, error)
- func (gcs *GCSRepository) ReadImage(path string) (image.Image, error)
- func (gcs *GCSRepository) Write(data []byte, output string, contentType ContentType) error
- func (gcs *GCSRepository) WriteImage(data *image.RGBA, output string) error
- type LocalStorage
- type NFTStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingEnv = errors.New("missing GOOGLE_CLOUD_SERVICE_ACCOUNT env var") ErrInvalidCredentials = errors.New("invalid credentials") )
Functions ¶
func GetCredentials ¶
func GetCredentials(ctx context.Context) (*google.Credentials, error)
Types ¶
type ContentType ¶ added in v0.1.10
type ContentType string
const ( JSONTYPE ContentType = "application/json;charset=uft-8" IMAGEPNG ContentType = "image/png" )
type GCSRepository ¶
type GCSRepository struct { Bucket string // contains filtered or unexported fields }
func NewGcsRepository ¶
func NewGcsRepository(bucket string) *GCSRepository
func (*GCSRepository) Download ¶
func (gcs *GCSRepository) Download(path string, toFile string) ([]byte, error)
func (*GCSRepository) ReadImage ¶
func (gcs *GCSRepository) ReadImage(path string) (image.Image, error)
func (*GCSRepository) Write ¶
func (gcs *GCSRepository) Write(data []byte, output string, contentType ContentType) error
func (*GCSRepository) WriteImage ¶
func (gcs *GCSRepository) WriteImage(data *image.RGBA, output string) error
type LocalStorage ¶
type LocalStorage struct{}
func (LocalStorage) Write ¶
func (LocalStorage) Write(data []byte, output string, contentType ContentType) error
func (LocalStorage) WriteImage ¶
func (LocalStorage) WriteImage(data *image.RGBA, output string) error
Click to show internal directories.
Click to hide internal directories.