matryoshka

package module
v0.0.0-...-9961239 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: MIT Imports: 13 Imported by: 0

README

IN DEVELOPMENT

nameless-storage-image-saver

Build Status

Overview

Save image file in different sizes into google cloud storage.

execution test

the folder cmd contains a file to execute a test

export GOOGLE_CLOUD_PROJECT="<project id>" && go run cmd/main.go -bucket="<bucket name>"

Documentation

Overview

Package matryoshka magazine media serve

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteImage

func WriteImage(prefix, filePath, bucket string, buf *bytes.Buffer) (map[string]*BufMedia, error)

WriteImage save images

Types

type BufMedia

type BufMedia struct {
	Buf     *bytes.Buffer
	Size    uint
	Path    string
	MimeTyp string
}

BufMedia data structure with buffer and info about the image

type IStorage

type IStorage interface {
	CreateClient(ctx context.Context) error
	SaveImg(ctx context.Context, prefix, bucket string, bufMap *BufMedia) error
}

IStorage gcloud storage interface

type StorageClient

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

StorageClient bearer of cassandra driver

func (*StorageClient) CreateClient

func (storageCli *StorageClient) CreateClient(ctx context.Context) error

CreateClient connect to Bucket

func (*StorageClient) SaveImg

func (storageCli *StorageClient) SaveImg(ctx context.Context, prefix, bucket string, bufMap *BufMedia) error

SaveImg save one image into gcloud storage

Jump to

Keyboard shortcuts

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