Documentation ¶
Index ¶
- Variables
- type App
- type AppImplementation
- func (app *AppImplementation) CreateEvent(runID string, event protocol.Event) error
- func (app *AppImplementation) CreateRun(options protocol.CreateRunOptions) (protocol.Run, error)
- func (app *AppImplementation) DeleteRun(runID string) error
- func (app *AppImplementation) GetApp(runID string) (io.Reader, error)
- func (app *AppImplementation) GetCache(runID string) (io.Reader, error)
- func (app *AppImplementation) GetEvents(runID string, lastID string) EventIterator
- func (app *AppImplementation) GetExitData(runID string) (protocol.ExitData, error)
- func (app *AppImplementation) GetOutput(runID string) (io.Reader, error)
- func (app *AppImplementation) IsRunCreated(runID string) (bool, error)
- func (app *AppImplementation) PutApp(runID string, reader io.Reader, objectSize int64) error
- func (app *AppImplementation) PutCache(runID string, reader io.Reader, objectSize int64) error
- func (app *AppImplementation) PutOutput(runID string, reader io.Reader, objectSize int64) error
- func (app *AppImplementation) ReportAPINetworkUsage(runID string, in uint64, out uint64) error
- func (app *AppImplementation) StartRun(runID string, dockerImage string, options protocol.StartRunOptions) error
- type EventIterator
- type Events
- type Key
- type MinioOptions
- type RedisOptions
- type StartupOptions
Constants ¶
This section is empty.
Variables ¶
var ErrAppNotAvailable = errors.New("app not available")
ErrAppNotAvailable is the error you get when you try to start a run but the code hasn't yet been uploaded
var ErrArchiveFormat = errors.New("archive format")
ErrArchiveFormat is the error you get trying to upload an archive with a bad format
var ErrNotFound = errors.New("not found")
ErrNotFound is the error for something not being found. Use this as a sentinal value
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { CreateRun(options protocol.CreateRunOptions) (protocol.Run, error) DeleteRun(runID string) error StartRun(runID string, dockerImage string, options protocol.StartRunOptions) error GetApp(runID string) (io.Reader, error) PutApp(runID string, reader io.Reader, objectSize int64) error GetCache(runID string) (io.Reader, error) PutCache(runID string, reader io.Reader, objectSize int64) error GetOutput(runID string) (io.Reader, error) PutOutput(runID string, reader io.Reader, objectSize int64) error GetExitData(runID string) (protocol.ExitData, error) GetEvents(runID string, lastID string) EventIterator CreateEvent(runID string, event protocol.Event) error IsRunCreated(runID string) (bool, error) ReportAPINetworkUsage(runID string, in uint64, out uint64) error }
App is the interface for the operations of the server
func New ¶
func New(startupOptions *StartupOptions) (App, error)
New initialises the main state of the application
type AppImplementation ¶
type AppImplementation struct { BlobStore blobstore.BlobStore JobDispatcher jobdispatcher.Jobs Stream stream.Stream KeyValueStore keyvaluestore.KeyValueStore HTTP *http.Client // This is the URL that the wrapper uses to talk back to the server API ServerURL string // contains filtered or unexported fields }
AppImplementation holds the state for the application
func (*AppImplementation) CreateEvent ¶
func (app *AppImplementation) CreateEvent(runID string, event protocol.Event) error
CreateEvent add an event to the stream
func (*AppImplementation) CreateRun ¶
func (app *AppImplementation) CreateRun(options protocol.CreateRunOptions) (protocol.Run, error)
CreateRun creates a run
func (*AppImplementation) DeleteRun ¶
func (app *AppImplementation) DeleteRun(runID string) error
DeleteRun deletes the run. Should be the last thing called TODO: If one delete operation fails the rest should still be attempted
func (*AppImplementation) GetApp ¶
func (app *AppImplementation) GetApp(runID string) (io.Reader, error)
GetApp downloads the tar & gzipped application code
func (*AppImplementation) GetCache ¶
func (app *AppImplementation) GetCache(runID string) (io.Reader, error)
GetCache downloads the tar & gzipped build cache
func (*AppImplementation) GetEvents ¶
func (app *AppImplementation) GetEvents(runID string, lastID string) EventIterator
GetEvents returns an iterator to get at all the events. Use "0" for lastId to start at the beginning of the stream. Otherwise use the id of the last seen event to restart the stream from that point. Don't try to restart the stream from the last event, otherwise More() will just wait around forever.
func (*AppImplementation) GetExitData ¶
func (app *AppImplementation) GetExitData(runID string) (protocol.ExitData, error)
GetExitData downloads the exit data
func (*AppImplementation) GetOutput ¶
func (app *AppImplementation) GetOutput(runID string) (io.Reader, error)
GetOutput downloads the scraper output
func (*AppImplementation) IsRunCreated ¶
func (app *AppImplementation) IsRunCreated(runID string) (bool, error)
func (*AppImplementation) ReportAPINetworkUsage ¶
func (app *AppImplementation) ReportAPINetworkUsage(runID string, in uint64, out uint64) error
func (*AppImplementation) StartRun ¶
func (app *AppImplementation) StartRun(runID string, dockerImage string, options protocol.StartRunOptions) error
StartRun starts the run
type EventIterator ¶
EventIterator is the interface for getting individual events in a list of events
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is an iterator to retrieve events from a stream
type MinioOptions ¶
MinioOptions are the options for the specific blob storage
type RedisOptions ¶
RedisOptions are the options for the specific key value store
type StartupOptions ¶
type StartupOptions struct { Minio MinioOptions Redis RedisOptions RunsNamespace string AuthenticationURL string ResourcesAllowedURL string UsageURL string ServerURL string }
StartupOptions are the options available when initialising the application