gateway

package
v0.0.0-...-e6a5c78 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UploadFileSizeLimit int64 = 1024 * 1024 * 100 // about 100MB
)

Variables

View Source
var (
	ErrInvalidFile        error = errors.New("invalid file")
	ErrFailedToUploadFile error = errors.New("failed to upload file")
	ErrFileTooLarge       error = errors.New("file too large")
	ErrFailedToRemoveFile error = errors.New("failed to remove file")
)
View Source
var (
	ErrDataSourceInvalidURL error = errors.New("invalid url")
)
View Source
var ErrFailedToFetchDataFromPluginRegistry = errors.New("failed to fetch data from the plugin registry")

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Email string
	Name  string
}

type Container

type Container struct {
	Authenticator  Authenticator
	Mailer         mailer.Mailer
	DataSource     DataSource
	PluginRegistry PluginRegistry
	File           File
	Google         Google
}

type DataSource

type DataSource interface {
	Fetch(context.Context, string, id.SceneID) ([]*dataset.Schema, []*dataset.Dataset, error)
	IsURLValid(context.Context, string) bool
}

type File

type File interface {
	ReadAsset(context.Context, string) (io.ReadCloser, error)
	UploadAsset(context.Context, *file.File) (*url.URL, int64, error)
	UploadAssetFromURL(context.Context, *url.URL) (*url.URL, int64, error)
	RemoveAsset(context.Context, *url.URL) error

	ReadPluginFile(context.Context, id.PluginID, string) (io.ReadCloser, error)
	UploadPluginFile(context.Context, id.PluginID, *file.File) error
	RemovePlugin(context.Context, id.PluginID) error

	UploadBuiltScene(context.Context, io.Reader, string) error
	ReadBuiltSceneFile(context.Context, string) (io.ReadCloser, error)
	MoveBuiltScene(context.Context, string, string) error
	RemoveBuiltScene(context.Context, string) error

	UploadStory(context.Context, io.Reader, string) error
	ReadStoryFile(context.Context, string) (io.ReadCloser, error)
	MoveStory(context.Context, string, string) error
	RemoveStory(context.Context, string) error

	ReadExportProjectZip(context.Context, string) (io.ReadCloser, error)
	UploadExportProjectZip(context.Context, afero.File) error
	RemoveExportProjectZip(context.Context, string) error
}

type Google

type Google interface {
	FetchCSV(token string, fileId string, sheetName string) (io.ReadCloser, error)
}

type Mailer

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

type PluginRegistry

type PluginRegistry interface {
	FetchPluginPackage(context.Context, id.PluginID) (*pluginpack.Package, error)
	NotifyDownload(context.Context, id.PluginID) error
}

Jump to

Keyboard shortcuts

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