cloudstorage

package module
v0.0.0-...-51e4ec8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 5 Imported by: 0

README

cloudstorage

A Go library for cloud storage using a client interface. The library abstracts the underlying image cloud storage service and provides a simple way to upload and delete the uploaded file.

Here are some clients we have for some Cloud Storage Services:

Documentation

Overview

Package cloudstorage is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Upload uploads the file to the Cloud Storage given by object
	// and return the CloudFile data structure.
	Upload(ctx context.Context, file io.Reader, object string, expires time.Time) (*CloudFile, error)
	// Delete deletes the given object from Cloud Storage.
	Delete(ctx context.Context, object string) error
}

Client is an interface for Cloud Storage.

type CloudFile

type CloudFile struct {
	// URl is the public URL for the cloud file.
	URL string
}

CloudFile is a data structure for file in the cloud.

type GoMockClient

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

GoMockClient is a mock of Client interface.

func NewGoMockClient

func NewGoMockClient(ctrl *gomock.Controller) *GoMockClient

NewGoMockClient creates a new mock instance.

func (*GoMockClient) Delete

func (m *GoMockClient) Delete(ctx context.Context, object string) error

Delete mocks base method.

func (*GoMockClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*GoMockClient) Upload

func (m *GoMockClient) Upload(ctx context.Context, file io.Reader, object string, expires time.Time) (*CloudFile, error)

Upload mocks base method.

type GoMockClientMockRecorder

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

GoMockClientMockRecorder is the mock recorder for GoMockClient.

func (*GoMockClientMockRecorder) Delete

func (mr *GoMockClientMockRecorder) Delete(ctx, object interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*GoMockClientMockRecorder) Upload

func (mr *GoMockClientMockRecorder) Upload(ctx, file, object, expires interface{}) *gomock.Call

Upload indicates an expected call of Upload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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