gateway

package
v0.0.0-...-fd95f72 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 11 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"))
)

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) (io.ReadCloser, 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
}

type IssueUploadAssetParam

type IssueUploadAssetParam struct {
	UUID          string
	Filename      string
	ContentLength int64
	ExpiresAt     time.Time

	Cursor string
}

func (IssueUploadAssetParam) ContentType

func (p IssueUploadAssetParam) ContentType() 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
	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