Documentation
¶
Index ¶
- type AppModel
- func (m *AppModel) Create(ownerID domain.UserID) (domain.AppID, error)
- func (m *AppModel) CreateFromURL(ownerID domain.UserID, url string, auto bool, ...) (domain.AppID, error)
- func (m *AppModel) CreateVersion(appID domain.AppID, locationKey string, manifest domain.AppVersionManifest) (domain.AppVersion, error)
- func (m *AppModel) Delete(appID domain.AppID) error
- func (m *AppModel) DeleteVersion(appID domain.AppID, version domain.Version) error
- func (m *AppModel) GetAppUrlData(appID domain.AppID) (domain.AppURLData, error)
- func (m *AppModel) GetAppUrlListing(appID domain.AppID) (domain.AppListing, domain.AppURLData, error)
- func (m *AppModel) GetAutoUrlDataByLastDt(last time.Time) ([]domain.AppID, error)
- func (m *AppModel) GetCurrentVersion(appID domain.AppID) (domain.Version, error)
- func (m *AppModel) GetForOwner(userID domain.UserID) ([]*domain.App, error)
- func (m *AppModel) GetFromID(appID domain.AppID) (domain.App, error)
- func (m *AppModel) GetVersion(appID domain.AppID, version domain.Version) (domain.AppVersion, error)
- func (m *AppModel) GetVersionForUI(appID domain.AppID, version domain.Version) (domain.AppVersionUI, error)
- func (m *AppModel) GetVersionManifest(appID domain.AppID, version domain.Version) (domain.AppVersionManifest, error)
- func (m *AppModel) GetVersionManifestJSON(appID domain.AppID, version domain.Version) (string, error)
- func (m *AppModel) GetVersionsForApp(appID domain.AppID) ([]*domain.AppVersion, error)
- func (m *AppModel) GetVersionsForUIForApp(appID domain.AppID) ([]domain.AppVersionUI, error)
- func (m *AppModel) PrepareStatements()
- func (m *AppModel) SetLastFetch(appID domain.AppID, lastDt time.Time, lastResult string) error
- func (m *AppModel) SetListing(appID domain.AppID, listingFetch domain.AppListingFetch) error
- func (m *AppModel) SetNewUrl(appID domain.AppID, url string, dt time.Time) error
- func (m *AppModel) UpdateAutomatic(appID domain.AppID, auto bool) error
- func (m *AppModel) UpdateURL(appID domain.AppID, url string, listingFetch domain.AppListingFetch) error
- type AppVersionUIDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppModel ¶
type AppModel struct {
DB *domain.DB
AppUrlDataEvents interface {
Send(ownerID domain.UserID, data domain.AppURLData)
}
// contains filtered or unexported fields
}
AppModel represents the model for app
func (*AppModel) Create ¶
Create adds an app to the database with no URL data For use with manually uploaded apps.
func (*AppModel) CreateFromURL ¶ added in v0.13.0
func (m *AppModel) CreateFromURL(ownerID domain.UserID, url string, auto bool, listingFetch domain.AppListingFetch) (domain.AppID, error)
CreateFromURL creates the app and stores app url data
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 ¶
Delete the app from the DB row. It fails if there are versions of the app in the DB
func (*AppModel) DeleteVersion ¶
DeleteVersion removes a version from the DB
func (*AppModel) GetAppUrlData ¶ added in v0.13.0
GetAppUrlData returns the app url data. If there is no app url data it returns domain.ErrNoRowsInResultSet
func (*AppModel) GetAppUrlListing ¶ added in v0.13.0
func (m *AppModel) GetAppUrlListing(appID domain.AppID) (domain.AppListing, domain.AppURLData, error)
GetAppUrlListing returns the listing along with the URL data If app is not from a URL it returns the error domain.ErrNoRowsInResultSet
func (*AppModel) GetAutoUrlDataByLastDt ¶ added in v0.13.0
GetAutoUrlDataByLastDt returns the app IDs that have automatic refresh enabled and haven't been refreshed since last
func (*AppModel) GetCurrentVersion ¶ added in v0.11.0
GetCurrentVersion returns the current version of the app. If there are no versions it returns domain.ErrNotRowsInResultSet
func (*AppModel) GetForOwner ¶
GetForOwner returns array of application data for a given user
func (*AppModel) GetFromID ¶
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 (*AppModel) GetVersionManifest ¶ added in v0.11.0
func (*AppModel) GetVersionManifestJSON ¶ added in v0.11.0
func (*AppModel) GetVersionsForApp ¶
GetVersionsForApp returns an array of versions of code for that application
func (*AppModel) GetVersionsForUIForApp ¶ added in v0.11.0
GetUIOVersionsForApp returns an array of versions of code for that application
func (*AppModel) PrepareStatements ¶
func (m *AppModel) PrepareStatements()
PrepareStatements prepares the statements
func (*AppModel) SetLastFetch ¶ added in v0.13.0
SetLastFetch time of the last listing fetch
func (*AppModel) SetListing ¶ added in v0.13.0
SetListing and the last fetch data and reset the new url data.
func (*AppModel) SetNewUrl ¶ added in v0.13.0
SetNewUrl sets the new url that the remote site says future requests should go
func (*AppModel) UpdateAutomatic ¶ added in v0.13.0
UpdateAutomatic to set the value of the automatic column in app url data
type AppVersionUIDB ¶ added in v0.11.0
type AppVersionUIDB struct {
domain.AppVersionUI
AuthorsDB string `db:"authors"`
}