gateway

package
v0.0.0-...-2b11b4c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFile                error = rerror.NewE(i18n.T("invalid file"))
	ErrFailedToUploadFile         error = rerror.NewE(i18n.T("failed to upload file"))
	ErrFileTooLarge               error = rerror.NewE(i18n.T("file too large"))
	ErrFailedToDeleteFile         error = rerror.NewE(i18n.T("failed to delete file"))
	ErrFileNotFound               error = rerror.NewE(i18n.T("file not found"))
	ErrUnsupportedOperation       error = rerror.NewE(i18n.T("unsupported operation"))
	ErrUnsupportedContentEncoding error = rerror.NewE(i18n.T("unsupported content encoding"))
)

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Email string
	Name  string
}

type Container

type Container struct {
	Authenticator Authenticator
	File          File
	Mailer        Mailer
	TaskRunner    TaskRunner
}

type File

type File interface {
	ReadAsset(context.Context, string, string, map[string]string) (io.ReadCloser, map[string]string, error)
	GetAssetFiles(context.Context, string) ([]FileEntry, error)
	UploadAsset(context.Context, *file.File) (string, int64, error)
	DeleteAsset(context.Context, string, string) error
	GetURL(*asset.Asset) string
	IssueUploadAssetLink(context.Context, IssueUploadAssetParam) (*UploadAssetLink, error)
	UploadedAsset(context.Context, *asset.Upload) (*file.File, error)
}

type FileEntry

type FileEntry struct {
	Name            string
	Size            int64
	ContentType     string
	ContentEncoding string
}

type IssueUploadAssetParam

type IssueUploadAssetParam struct {
	UUID     string
	Filename string
	// ContentLength is the size of the file in bytes. It is required when S3 is used.
	ContentLength   int64
	ContentType     string
	ContentEncoding string
	ExpiresAt       time.Time

	Cursor string
}

func (IssueUploadAssetParam) GetOrGuessContentType

func (p IssueUploadAssetParam) GetOrGuessContentType() string

type Mailer

type Mailer interface {
	SendMail(toContacts []Contact, subject, plainContent, htmlContent string) error
}

type TaskRunner

type TaskRunner interface {
	Run(context.Context, task.Payload) error
	Retry(context.Context, string) error
}
type UploadAssetLink struct {
	URL             string
	ContentType     string
	ContentLength   int64
	ContentEncoding string
	Next            string
}

Directories

Path Synopsis
Package gatewaymock is a generated GoMock package.
Package gatewaymock is a generated GoMock package.

Jump to

Keyboard shortcuts

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