Documentation
¶
Overview ¶
Package webapp implements the web interface
Index ¶
- Constants
- func GetAncestryGraphHTML(ctx context.Context, con *gorm.DB, bottle *db.BottleRelative, ...) (template.HTML, error)
- type ViewerLink
- type ViewerSpecList
- type WebApp
- func (a *WebApp) FindViewers(specs []v1alpha2.ViewerSpec, bottle digest.Digest, partSelectors []string, ...) []ViewerLink
- func (a *WebApp) GetArtifactViewers(specs ViewerSpecList, bottle digest.Digest, partSelectors []string, ...) map[string][]ViewerLink
- func (a *WebApp) GetViewerSpecList(bottle db.Bottle) ViewerSpecList
- func (a *WebApp) Initialize(serveMux *http.ServeMux)
Constants ¶
const ( // LabelViewerPrefix is used to denote the annotations that describe viewers. The part after the "/" in the key is used as the name. The value must be a JSON document representing ViewerSpec. LabelViewerPrefix = "viewer.data.act3-ace.io" // HubBottleName is the name of the bottle that is used when mounting in ACE Hub // This must not include any special characters because it needs to be used as an env var in ACE Hub. HubBottleName = "dataset" )
Variables ¶
This section is empty.
Functions ¶
func GetAncestryGraphHTML ¶
func GetAncestryGraphHTML(ctx context.Context, con *gorm.DB, bottle *db.BottleRelative, numGenAncestors, numGenDescendents uint, templates *template.Template) (template.HTML, error)
GetAncestryGraphHTML renders an HTML graph of ancestry and returns it as a string. numGenAncestors and numGenDescendents determine the number of generations in each direction to render. templates is a pointer to the templates that include the needed html templates to be used in the graph rendering.
Types ¶
type ViewerLink ¶
ViewerLink represents a viewer that will be presented to the user.
type ViewerSpecList ¶
type ViewerSpecList []v1alpha2.ViewerSpec
ViewerSpecList is just a list of ViewerSpecs.
func (*ViewerSpecList) FilterAndSort ¶
func (vsl *ViewerSpecList) FilterAndSort(mediaType string) ViewerSpecList
FilterAndSort returns only viewers supporting mediaType in sorted order (best first).
type WebApp ¶
type WebApp struct {
// contains filtered or unexported fields
}
WebApp implements the HTML web application.
func (*WebApp) FindViewers ¶
func (a *WebApp) FindViewers(specs []v1alpha2.ViewerSpec, bottle digest.Digest, partSelectors []string, artifact *db.PublicArtifact) []ViewerLink
FindViewers computes the viewers for each ACE Hub instance and provided spec. Each ViewerLink will mount the bottle using the selectors.
func (*WebApp) GetArtifactViewers ¶
func (a *WebApp) GetArtifactViewers(specs ViewerSpecList, bottle digest.Digest, partSelectors []string, artifacts []db.PublicArtifact) map[string][]ViewerLink
GetArtifactViewers finds the viewers for each artifact by matching viewerSpecs to artifact's media type.
func (*WebApp) GetViewerSpecList ¶
func (a *WebApp) GetViewerSpecList(bottle db.Bottle) ViewerSpecList
GetViewerSpecList will find annotations that denote viewers and parse them.
func (*WebApp) Initialize ¶
Initialize the routes.