Versions in this module Expand all Collapse all v0 v0.2.3 Jan 14, 2023 v0.2.2 Feb 23, 2022 Changes in this version + func CheckActivity(a *Activity) error + func ConfigToModel(config Config) *models.Config + func CopyStore(from, to *Store) + func MakeClaims(mp *models.Permission) permission.Token + func NewStreamsFromModel(modelStreams []*models.Stream) map[string]*Stream + func SingleStreamToModel(s *Stream) *models.Stream + func SingleUIToModel(u *UI) *models.UserInterface + func StreamsToModel(streams map[string]*Stream) []*models.Stream + func UIsToModel(uis []*UI) []*models.UserInterface + type Activity struct + Config Config + ExpiresAt int64 + Streams map[string]*Stream + UI []*UI + func NewActivity(name string, expires int64) *Activity + func NewActivityFromModel(ma *models.Activity) *Activity + func (a *Activity) AddID() string + func (a *Activity) AddStream(key string, stream *Stream) + func (a *Activity) AddUI(ui *UI) + func (a *Activity) ConvertToModel() *models.Activity + func (a *Activity) GetID() string + func (a *Activity) SetID(id string) + func (a *Activity) WithID(id string) *Activity + func (a *Activity) WithNewRandomID() *Activity + type Config struct + URL string + func NewConfigFromModel(mc *models.Config) *Config + type Description struct + ID string + Name string + Type string + func NewDescription(name string) *Description + func NewDescriptionFromModel(md *models.Description) *Description + func (d *Description) ConvertToModel() *models.Description + func (d *Description) SetFurther(item string) + func (d *Description) SetID(item string) + func (d *Description) SetImage(item string) + func (d *Description) SetLong(item string) + func (d *Description) SetShort(item string) + func (d *Description) SetThumb(item string) + func (d *Description) SetType(item string) + func (d *Description) WithID(id string) *Description + type DisplayInfo struct + Further string + Image string + Long string + Short string + Thumb string + type Group struct + Pools []*Pool + func NewGroup(name string) *Group + func NewGroupFromModel(mg *models.Group) (*Group, error) + func (g *Group) AddPool(pool *Pool) + func (g *Group) AddPools(pools []*Pool) + func (g *Group) DeletePool(pool *Pool) + func (g *Group) GetID() string + func (g *Group) GetPoolIDs() []string + func (g *Group) GetPools() []*Pool + func (g *Group) SetNewRandomID() *Group + func (g *Group) SetPools(pools []*Pool) + func (g *Group) WithID(id string) *Group + func (g *Group) WithPool(pool *Pool) *Group + func (g *Group) WithPools(pools []*Pool) *Group + type Pool struct + Activities map[string]*Activity + Available map[string]int64 + InUse map[string]int64 + MaxSession uint64 + MinSession uint64 + Now func() int64 + func NewPool(name string) *Pool + func (p *Pool) ActivityExists(id string) bool + func (p *Pool) ActivityInUse(id string) bool + func (p *Pool) ActivityNextAvailableTime(id string) (int64, error) + func (p *Pool) ActivityRequest(duration uint64, id string) error + func (p *Pool) ActivityRequestAny(duration uint64) (string, error) + func (p *Pool) ActivityWaitAny() (uint64, error) + func (p *Pool) ActivityWaitDuration(duration uint64) (uint64, error) + func (p *Pool) AddActivity(activity *Activity) error + func (p *Pool) CountAvailable() int + func (p *Pool) CountInUse() int + func (p *Pool) DeleteActivity(activity *Activity) + func (p *Pool) GetActivityByID(id string) (*Activity, error) + func (p *Pool) GetActivityIDs() []string + func (p *Pool) GetID() string + func (p *Pool) GetMaxSession() uint64 + func (p *Pool) GetMinSession() uint64 + func (p *Pool) RemoveStaleEntries() + func (p *Pool) SetMaxSesssion(duration uint64) + func (p *Pool) SetMinSesssion(duration uint64) + func (p *Pool) WithDescription(d Description) *Pool + func (p *Pool) WithID(id string) *Pool + func (p *Pool) WithMaxSesssion(duration uint64) *Pool + func (p *Pool) WithMinSesssion(duration uint64) *Pool + func (p *Pool) WithNow(now func() int64) *Pool + type Store struct + BookingTokenDuration int64 + Groups map[string]*Group + Now func() int64 + Pools map[string]*Pool + Secret []byte + func ImportAll(b []byte) (*Store, error) + func NewStore() *Store + func (p *Store) AddGroup(group *Group) + func (p *Store) AddPool(pool *Pool) + func (p *Store) DeleteGroup(group *Group) + func (p *Store) DeletePool(pool *Pool) + func (p *Store) ExportAll() ([]byte, error) + func (p *Store) GetAllGroupsCount() int + func (p *Store) GetAllPoolCount() int + func (p *Store) GetAllPoolIDs() []string + func (p *Store) GetAllPools() []*Pool + func (p *Store) GetAvailableActivitiesCount() int + func (p *Store) GetGroupByID(id string) (*Group, error) + func (p *Store) GetGroupsByName(name string) ([]*Group, error) + func (p *Store) GetGroupsByNamePrefix(prefix string) ([]*Group, error) + func (p *Store) GetPoolByID(id string) (*Pool, error) + func (p *Store) GetPoolsByName(name string) ([]*Pool, error) + func (p *Store) GetPoolsByNamePrefix(prefix string) ([]*Pool, error) + func (p *Store) GetSecret() []byte + func (p *Store) GetTime() int64 + func (p *Store) PostImportEssential() + func (p *Store) PostImportSetNow(now func() int64) + func (p *Store) Reset() + func (p *Store) SetSecret(secret string) + func (p *Store) WithBookingTokenDuration(duration int64) *Store + func (p *Store) WithNow(now func() int64) *Store + func (p *Store) WithSecret(secret string) *Store + type Stream struct + For string + Permission permission.Token + Token string + URL string + Verb string + func NewSingleStreamFromModel(ms *models.Stream) *Stream + func NewStream(url string) *Stream + func (s *Stream) GetPermission() permission.Token + func (s *Stream) SetPermission(p permission.Token) + func (s *Stream) WithPermission(p permission.Token) *Stream + type UI struct + StreamsRequired []string + URL string + func NewSingleUIFromModel(mui *models.UserInterface) *UI + func NewUI(url string) *UI + func NewUIsFromModel(modelUIs []*models.UserInterface) []*UI + func (u *UI) WithDescription(d Description) *UI + func (u *UI) WithStreamsRequired(names []string) *UI