Categorygithub.com/devteamclub/gcsimage
modulepackage
0.1.9
Repository: https://github.com/devteamclub/gcsimage.git
Documentation: pkg.go.dev

# README

Google Cloud Storage images

This wrapper is based on github.com/disintegration/imaging. Big thanks to @disintegration

Setup

GOOGLE_APPLICATION_CREDENTIALS=gcs_key.json
IMAGES_STORAGE_BUCKET=anthive-img

How to use it

import 	"github.com/devteamclub/gcsimage"

var bucket *gcsimage.Bucket

func main() {
    initImageBucket(context.Background())
	
    // ... //
    id, err := bucket.Add(context.Background(), data)
	
    // ... //
    data, contentType, err := bucket.Get(context.Background(), id, gcsimage.Top, width, height)
}

func initImageBucket(ctx context.Context) {
    var err error
    bucket, err = gcsimage.InitBucket(ctx, os.Getenv("IMAGES_STORAGE_BUCKET"))
    if err != nil {
    panic(err)
    }
}

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author

# Type aliases

No description provided by the author