Documentation
¶
Overview ¶
Package manifest provides an alternative data format for representing poolstores that is easier to edit by hand, because default options can be specified for activities within a given pool, where usually the details are similar except for the stream details
Index ¶
- func GetConfigModel(c Config) *models.Config
- func GetStreamsModel(streams map[string]*Stream) []*models.Stream
- func UploadManifest(bc *apiclient.Bc, auth runtime.ClientAuthInfoWriter, timeout time.Duration, ...) (*models.StoreStatus, error)
- type Activity
- type Config
- type Description
- type Group
- type Manifest
- func (m *Manifest) GetActivitiesInPool(pref Ref) []*models.Activity
- func (m *Manifest) GetActivityModel(aref Ref) *models.Activity
- func (m *Manifest) GetPool(pref Ref) *models.Pool
- func (m *Manifest) GetUIModel(uiref Ref) *models.UserInterface
- func (m *Manifest) GetUISetModel(usref Ref) []*models.UserInterface
- type Pool
- type Ref
- type Stream
- type StreamSet
- type UI
- type UISet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigModel ¶
GetConfigModel returns a pointer of type model.Config representing the configuration
func GetStreamsModel ¶
GetStreamsModel returns an array of pointers to models.Streams representing the stream map
func UploadManifest ¶
func UploadManifest(bc *apiclient.Bc, auth runtime.ClientAuthInfoWriter, timeout time.Duration, m Manifest) (*models.StoreStatus, error)
UploadManifest uploads a manifest to the booking server
Types ¶
type Activity ¶
type Activity struct {
Config Config `yaml:"config"`
Description Ref `yaml:"description"`
UISet Ref `yaml:"UISet"`
ExpiresAt int64 `yaml:"exp"`
Streams map[string]*Stream `yaml:"streams"`
}
Activity represents an activity
type Config ¶
type Config struct {
URL string `yaml:"url"`
}
Config represents a configuration for a user interface
type Description ¶
type Description struct {
Name string `json:"name"`
Type string `json:"type"`
Short string `json:"short,omitempty"`
Long string `json:"long,omitempty"`
Further string `json:"further,omitempty"`
Thumb string `json:"thumb,omitempty"`
Image string `json:"image,omitempty"`
}
Description represents a description of an activity, for displaying in the booking system / application
func (*Description) ToModel ¶
func (d *Description) ToModel() *models.Description
ToModel returns a pointer of type models.Description representing the description
type Group ¶
type Group struct {
// Pools represents all the pools in the group
Pools []Ref
}
Group represnts a booking group (a list of pools)
type Manifest ¶
type Manifest struct {
// Groups represents all the groups in the poolstore
Groups map[Ref]*Group `yaml:"groups"`
// Pools represents all the pools in the poolstore
Pools map[Ref]*Pool `yaml:"pools"`
Activities map[Ref]*Activity `yaml:"activities"`
UIs map[Ref]*UI
UISets map[Ref]*UISet `yaml:"UISets"`
Descriptions map[Ref]*Description
}
Manifest represents a complete listing of the experiments available to book
func (*Manifest) GetActivitiesInPool ¶
GetActivitiesInPool rehydrates activities into a complete models.Activity type It needs data outside of the pool, hence method on Manifest, with pool as a ref just so it is not tempting to refactor to a method on a pool pointer like in pkg/pool (which won't work here due to refactoring the structure to make it easier to human edit - activities here are not childs of the pool in the data structure but siblings with a link-by-Ref scheme to let the parent-child r'ship be recreated in the models representation
func (*Manifest) GetActivityModel ¶
GetActivityModel returns a pointer of type models.Activity type representing the referenced activity
func (*Manifest) GetUIModel ¶
func (m *Manifest) GetUIModel(uiref Ref) *models.UserInterface
GetUIModel returns a pointer to the referenced UI as type models.UserInterface
func (*Manifest) GetUISetModel ¶
func (m *Manifest) GetUISetModel(usref Ref) []*models.UserInterface
GetUISetModel returns an array of pointers type models.UserInterface representing the referenced UISet
type Pool ¶
type Pool struct {
Description
MinSession uint64
MaxSession uint64
Activities []Ref
}
Pool represents a booking Pool (a list of activities)
type Stream ¶
type Stream struct {
For string `yaml:"for"`
URL string `yaml:"url"`
Audience string `yaml:"audience"`
ConnectionType string `yaml:"ct"`
Topic string `yaml:"topic"`
Verb string `yaml:"verb"`
Scopes []string `yaml:"scopes"`
}
Stream represents a connection to a relay instance
type StreamSet ¶
type StreamSet []Ref
StreamSet is an array of references to streams to be used with an activity
type UI ¶
type UI struct {
// URL with moustache {{key}} templating for stream connections
Description
URL string `json:"url"`
StreamsRequired []string `json:"streamsRequired"`
}
UI represents a UI (User Interface)