imguploader

package
v0.0.0-...-900be4e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

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) *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 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)

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