uploader

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupBucket

func SetupBucket(ctx *context.Context, config *ConfigParams) (*blob.Bucket, error)

SetupBucket creates a connection to a particular cloud provider's blob storage.

Types

type ConfigParams

type ConfigParams struct {
	Cloud     string
	Bucket    string
	Region    string
	AccessKey string
	SecretKey string
	Token     string
	URL       string
}

ConfigParams represents the configuration params for aws

type File

type File struct {
	URL string `json:"url"`
}

File represents url of uploaded file swagger:model

type Service

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

Service represents the uploader service

func NewService

func NewService(bucket *blob.Bucket, bucketName string, url string) *Service

NewService creates new uploader service

func (*Service) Upload

func (s *Service) Upload(ctx *context.Context, fileBytes []byte, fileName string) (*File, *types.Error)

Upload upload file

type ServiceInterface

type ServiceInterface interface {
	Upload(ctx *context.Context, fileBytes []byte, fileName string) (*File, *types.Error)
}

Service represents the interface for servicing uploader object

Jump to

Keyboard shortcuts

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