appmodel

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppModel

type AppModel struct {
	DB *domain.DB
	// contains filtered or unexported fields
}

AppModel represents the model for app

func (*AppModel) Create

func (m *AppModel) Create(ownerID domain.UserID) (domain.AppID, error)

Create adds an app to the database Other arguments: source URL, auto-update mode (if that applies to app)

func (*AppModel) CreateVersion

func (m *AppModel) CreateVersion(appID domain.AppID, locationKey string, manifest domain.AppVersionManifest) (domain.AppVersion, error)

CreateVersion adds a new version for an app in the DB has appid, version, location key, create date use appid and version as primary keys index on appid as well

func (*AppModel) Delete

func (m *AppModel) Delete(appID domain.AppID) error

Delete the app from the DB row. It fails if there are versions of the app in the DB

func (*AppModel) DeleteVersion

func (m *AppModel) DeleteVersion(appID domain.AppID, version domain.Version) error

DeleteVersion removes a version from the DB

func (*AppModel) GetCurrentVersion added in v0.11.0

func (m *AppModel) GetCurrentVersion(appID domain.AppID) (domain.Version, error)

GetCurrentVersion returns the current version of the app. If there are no versions it returns domain.ErrNotRowsInResultSet

func (*AppModel) GetForOwner

func (m *AppModel) GetForOwner(userID domain.UserID) ([]*domain.App, error)

GetForOwner returns array of application data for a given user

func (*AppModel) GetFromID

func (m *AppModel) GetFromID(appID domain.AppID) (domain.App, error)

GetFromID gets the app using its unique ID on the system It returns an error if ID is not found

func (*AppModel) GetVersion

func (m *AppModel) GetVersion(appID domain.AppID, version domain.Version) (domain.AppVersion, error)

GetVersion returns the version for the app

func (*AppModel) GetVersionForUI added in v0.11.0

func (m *AppModel) GetVersionForUI(appID domain.AppID, version domain.Version) (domain.AppVersionUI, error)

func (*AppModel) GetVersionManifest added in v0.11.0

func (m *AppModel) GetVersionManifest(appID domain.AppID, version domain.Version) (domain.AppVersionManifest, error)

func (*AppModel) GetVersionManifestJSON added in v0.11.0

func (m *AppModel) GetVersionManifestJSON(appID domain.AppID, version domain.Version) (string, error)

func (*AppModel) GetVersionsForApp

func (m *AppModel) GetVersionsForApp(appID domain.AppID) ([]*domain.AppVersion, error)

GetVersionsForApp returns an array of versions of code for that application

func (*AppModel) GetVersionsForUIForApp added in v0.11.0

func (m *AppModel) GetVersionsForUIForApp(appID domain.AppID) ([]domain.AppVersionUI, error)

GetUIOVersionsForApp returns an array of versions of code for that application

func (*AppModel) PrepareStatements

func (m *AppModel) PrepareStatements()

PrepareStatements prepares the statements

type AppVersionUIDB added in v0.11.0

type AppVersionUIDB struct {
	domain.AppVersionUI
	AuthorsDB string `db:"authors"`
}

Jump to

Keyboard shortcuts

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