imguploader

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Overview

Package imguploader is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Account string
	Key     string
}

func (*Auth) SignRequest

func (a *Auth) SignRequest(req *http.Request) error

type AzureBlobUploader

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

func NewAzureBlobUploader

func NewAzureBlobUploader(account_name string, account_key string, container_name string, sas_token_expiration_days int) *AzureBlobUploader

func (*AzureBlobUploader) Upload

func (az *AzureBlobUploader) Upload(ctx context.Context, imageDiskPath string) (string, error)

Receive path of image on disk and return azure blob url

type Error

type Error struct {
	Code   int
	Status string
	Body   []byte
	Header http.Header

	AzureCode string
}

--- AZURE LIBRARY

func (*Error) Error

func (e *Error) Error() string

type ImageUploader

type ImageUploader interface {
	Upload(ctx context.Context, path string) (string, error)
}

func NewImageUploader

func NewImageUploader() (ImageUploader, error)

type LocalUploader

type LocalUploader struct {
}

func NewLocalImageUploader

func NewLocalImageUploader() (*LocalUploader, error)

func (*LocalUploader) Upload

func (u *LocalUploader) Upload(ctx context.Context, imageOnDiskPath string) (string, error)

type MockImageUploader

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

MockImageUploader is a mock of ImageUploader interface.

func NewMockImageUploader

func NewMockImageUploader(ctrl *gomock.Controller) *MockImageUploader

NewMockImageUploader creates a new mock instance.

func (*MockImageUploader) EXPECT

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

func (*MockImageUploader) Upload

func (m *MockImageUploader) Upload(arg0 context.Context, arg1 string) (string, error)

Upload mocks base method.

type MockImageUploaderMockRecorder

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

MockImageUploaderMockRecorder is the mock recorder for MockImageUploader.

func (*MockImageUploaderMockRecorder) Upload

func (mr *MockImageUploaderMockRecorder) Upload(arg0, arg1 interface{}) *gomock.Call

Upload indicates an expected call of Upload.

type NopImageUploader

type NopImageUploader struct {
}

func (NopImageUploader) Upload

func (NopImageUploader) Upload(ctx context.Context, path string) (string, error)

type S3Uploader

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

func NewS3Uploader

func NewS3Uploader(endpoint, region, bucket, path, acl, accessKey, secretKey string, pathStyleAccess bool) *S3Uploader

func (*S3Uploader) Upload

func (u *S3Uploader) Upload(ctx context.Context, imageDiskPath string) (string, error)

type StorageClient

type StorageClient struct {
	Auth      *Auth
	Transport http.RoundTripper
}

func NewStorageClient

func NewStorageClient(account, accessKey string) *StorageClient

func (*StorageClient) FileUpload

func (c *StorageClient) FileUpload(ctx context.Context, container, blobName string, body io.Reader) (*http.Response, error)

func (*StorageClient) GetBlobSasUrl

func (c *StorageClient) GetBlobSasUrl(ctx context.Context, containerName, blobName string, sasTokenExpiration int) (string, error)

SignWithSharedKey uses an account's SharedKeyCredential to sign this signature values to produce the proper SAS query parameters.

type WebdavUploader

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

func NewWebdavImageUploader

func NewWebdavImageUploader(url, username, password, public_url string) (*WebdavUploader, error)

func (*WebdavUploader) PublicURL

func (u *WebdavUploader) PublicURL(filename string) string

func (*WebdavUploader) Upload

func (u *WebdavUploader) Upload(ctx context.Context, imgToUpload string) (string, error)

Directories

Path Synopsis
Package gcs provides an image uploader for GCS.
Package gcs provides an image uploader for GCS.

Jump to

Keyboard shortcuts

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