controller

package
v0.0.0-...-ad951c9 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFolders

func GetFolders() ([]filestore.FilestoreFolder, error)

Types

type Controller

type Controller struct {
	Ctx            context.Context
	Options        ControllerOptions
	JobUpdatesChan chan *types.Job
}

func NewController

func NewController(
	ctx context.Context,
	options ControllerOptions,
) (*Controller, error)

func (*Controller) CheckAPIKey

func (c *Controller) CheckAPIKey(ctx context.Context, apiKey string) (*types.ApiKey, error)

func (*Controller) CreateAPIKey

func (c *Controller) CreateAPIKey(ctx types.RequestContext, name string) (string, error)

func (*Controller) CreateJobAsync

func (c *Controller) CreateJobAsync(ctx types.RequestContext, request types.JobSpec) (string, error)

func (*Controller) CreateJobSync

func (c *Controller) CreateJobSync(ctx types.RequestContext, request types.JobSpec) (*jobcreator.RunJobResults, error)

func (*Controller) DeleteAPIKey

func (c *Controller) DeleteAPIKey(ctx types.RequestContext, apiKey string) error

func (*Controller) FilestoreConfig

func (c *Controller) FilestoreConfig(ctx types.RequestContext) (filestore.FilestoreConfig, error)

func (*Controller) FilestoreCreateFolder

func (c *Controller) FilestoreCreateFolder(ctx types.RequestContext, path string) (filestore.FileStoreItem, error)

func (*Controller) FilestoreDelete

func (c *Controller) FilestoreDelete(ctx types.RequestContext, path string) error

func (*Controller) FilestoreGet

func (c *Controller) FilestoreGet(ctx types.RequestContext, path string) (filestore.FileStoreItem, error)

func (*Controller) FilestoreList

func (c *Controller) FilestoreList(ctx types.RequestContext, path string) ([]filestore.FileStoreItem, error)

func (*Controller) FilestoreRename

func (c *Controller) FilestoreRename(ctx types.RequestContext, path string, newPath string) (filestore.FileStoreItem, error)

func (*Controller) FilestoreUpload

func (c *Controller) FilestoreUpload(ctx types.RequestContext, path string, r io.Reader) (filestore.FileStoreItem, error)

func (*Controller) GetAPIKeys

func (c *Controller) GetAPIKeys(ctx types.RequestContext) ([]*types.ApiKey, error)

func (*Controller) GetJobs

func (c *Controller) GetJobs(ctx types.RequestContext) ([]*types.Job, error)

func (*Controller) GetStatus

func (c *Controller) GetStatus(ctx types.RequestContext) (types.UserStatus, error)

func (*Controller) GetTransactions

func (c *Controller) GetTransactions(ctx types.RequestContext) ([]*types.BalanceTransfer, error)

func (*Controller) Start

func (c *Controller) Start() error

type ControllerOptions

type ControllerOptions struct {
	Store     store.Store
	Filestore filestore.FileStore
	JobRunner *job.JobRunner
	// this is an "env" prefix like "dev"
	// the user prefix is handled inside the controller
	// (see getFilestorePath)
	FilePrefixGlobal string
	// this is a golang template that is used to prefix the user
	// path in the filestore - it is passed Owner and OwnerType values
	// write me an example FilePrefixUser as a go template
	// e.g. "users/{{.Owner}}"
	FilePrefixUser string
	// a static path used to denote what sub-folder job results live in
	FilePrefixResults string
}

Jump to

Keyboard shortcuts

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