appops

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppGetter

type AppGetter struct {
	AppFilesModel interface {
		Save(*map[string][]byte) (string, error)
		ReadMeta(string) (*domain.AppFilesMetadata, error) // this is going away or changing significantly
		WriteRoutes(string, []byte) error
		WriteMigrations(string, []byte) error
		Delete(string) error
	} `checkinject:"required"`
	AppModel interface {
		Create(domain.UserID, string) (*domain.App, error)
		CreateVersion(domain.AppID, domain.Version, int, domain.APIVersion, string) (*domain.AppVersion, error)
		GetVersionsForApp(domain.AppID) ([]*domain.AppVersion, error)
	} `checkinject:"required"`
	AppLogger interface {
		Log(locationKey string, source string, message string)
	} `checkinject:"required"`
	SandboxManager interface {
		ForApp(appVersion *domain.AppVersion) (domain.SandboxI, error)
	} `checkinject:"required"`
	V0AppRoutes interface {
		ValidateRoutes(routes []domain.V0AppRoute) error
	} `checkinject:"required"`
	// contains filtered or unexported fields
}

AppGetter handles incoming application files It can stash them temporarily and examine its metadata for consistency And it can commit files to become an actual app version

func (*AppGetter) Commit

Commit creates either a new app and version, or just a new version

func (*AppGetter) Delete

func (g *AppGetter) Delete(key domain.AppGetKey)

Delete removes the files and the key

func (*AppGetter) DeleteKeyData

func (g *AppGetter) DeleteKeyData(key domain.AppGetKey)

DeleteKeyData removes the data related to the key but leaves files in place.

func (*AppGetter) FromRaw

func (g *AppGetter) FromRaw(userID domain.UserID, fileData *map[string][]byte, appIDs ...domain.AppID) (domain.AppGetKey, error)

FromRaw takes raw file data as app files

func (*AppGetter) GetLastEvent

func (g *AppGetter) GetLastEvent(key domain.AppGetKey) (domain.AppGetEvent, bool)

GetLastEvent returns the last event for the key

func (*AppGetter) GetLocationKey

func (g *AppGetter) GetLocationKey(key domain.AppGetKey) (string, bool)

func (*AppGetter) GetResults

func (g *AppGetter) GetResults(key domain.AppGetKey) (domain.AppGetMeta, bool)

func (*AppGetter) GetUser

func (g *AppGetter) GetUser(key domain.AppGetKey) (domain.UserID, bool)

GetUser returns the user associated with the key Used to authorize a request for data on that key

func (*AppGetter) Init

func (g *AppGetter) Init()

Init creates the map [and starts the timers]

func (*AppGetter) Reprocess

func (g *AppGetter) Reprocess(userID domain.UserID, appID domain.AppID, locationKey string) (domain.AppGetKey, error)

Reprocess performs the app processing steps again, replacing the results upon completion. Currently only intended for use by ds-dev.

func (*AppGetter) Stop

func (g *AppGetter) Stop()

func (*AppGetter) SubscribeKey

func (g *AppGetter) SubscribeKey(key domain.AppGetKey) (domain.AppGetEvent, <-chan domain.AppGetEvent)

SubscribeKey returns the last event and a channel if the process is ongoing

func (*AppGetter) Unsubscribe

func (g *AppGetter) Unsubscribe(ch <-chan domain.AppGetEvent)

func (*AppGetter) ValidateMigrationSteps

func (g *AppGetter) ValidateMigrationSteps(migrations []domain.MigrationStep) ([]int, error)

type DeleteApp

type DeleteApp struct {
	AppFilesModel interface {
		Delete(string) error
	} `checkinject:"required"`
	AppModel interface {
		GetVersionsForApp(appID domain.AppID) ([]*domain.AppVersion, error)
		GetVersion(appID domain.AppID, version domain.Version) (*domain.AppVersion, error)
		Delete(appID domain.AppID) error
		DeleteVersion(domain.AppID, domain.Version) error
	} `checkinject:"required"`
	AppspaceModel interface {
		GetForApp(appID domain.AppID) ([]*domain.Appspace, error)
		GetForAppVersion(appID domain.AppID, version domain.Version) ([]*domain.Appspace, error)
	} `checkinject:"required"`
	AppLogger interface {
		Forget(string)
	} `checkinject:"required"`
}

func (*DeleteApp) Delete

func (d *DeleteApp) Delete(appID domain.AppID) error

func (*DeleteApp) DeleteVersion

func (d *DeleteApp) DeleteVersion(appID domain.AppID, version domain.Version) error

DeleteVersion removes the app version code and db entry from the system.

Jump to

Keyboard shortcuts

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