Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(ds Datastore, slides *SlideStore)
Register initializes a new projector.
Types ¶
type Datastore ¶
type Datastore interface { Get(ctx context.Context, keys ...string) (map[string][]byte, error) RegisterCalculatedField(field string, f func(ctx context.Context, key string, changed map[string][]byte) ([]byte, error)) }
Datastore gets values for keys and informs, if they change.
type Projection ¶
type Projection struct { ID int `json:"id"` Type string `json:"type"` ContentObjectID string `json:"content_object_id"` MeetingID int `json:"meeting_id"` Options json.RawMessage `json:"options"` }
Projection holds the meta data to render a projection on a projecter.
type SlideStore ¶
type SlideStore struct {
// contains filtered or unexported fields
}
SlideStore holds the Slider- and Titler-functions by name.
func (*SlideStore) GetSlider ¶
func (s *SlideStore) GetSlider(name string) Slider
GetSlider returns the Slide for the given name.
Returns nil, if there if the name is unknown.
func (*SlideStore) GetTitleInformationFunc ¶
func (s *SlideStore) GetTitleInformationFunc(name string) Titler
GetTitleInformationFunc returns a Titler-function for the given name.
Returns nil, if the name is unknown.
func (*SlideStore) RegisterGetTitleInformationFunc ¶
func (s *SlideStore) RegisterGetTitleInformationFunc(collection string, f TitlerFunc)
RegisterGetTitleInformationFunc adds a function of type TitlerFunc to the store.
func (*SlideStore) RegisterSliderFunc ¶
func (s *SlideStore) RegisterSliderFunc(name string, f SliderFunc)
RegisterSliderFunc adds a SliderFunc to the store.
type Slider ¶
type Slider interface {
Slide(ctx context.Context, fetch *datastore.Fetcher, p7on *Projection) (encoded []byte, err error)
}
Slider knows how to create a slide.
type SliderFunc ¶
type SliderFunc func(ctx context.Context, fetch *datastore.Fetcher, p7on *Projection) (encoded []byte, err error)
SliderFunc is a function that implements the Slider interface.
func (SliderFunc) Slide ¶
func (f SliderFunc) Slide(ctx context.Context, fetch *datastore.Fetcher, p7on *Projection) (encoded []byte, err error)
Slide calls the func.
type Titler ¶
type Titler interface {
GetTitleInformation(ctx context.Context, fetch *datastore.Fetcher, fqid string, itemNumber string, meetingID int) (json.RawMessage, error)
}
Titler defines the interface for GetTitleInformation-function, used for individual objects.
type TitlerFunc ¶
type TitlerFunc func(ctx context.Context, fetch *datastore.Fetcher, fqid string, itemNumber string, meetingID int) (json.RawMessage, error)
TitlerFunc is a type that implements the Titler interface.
func (TitlerFunc) GetTitleInformation ¶
func (f TitlerFunc) GetTitleInformation(ctx context.Context, fetch *datastore.Fetcher, fqid string, itemNumber string, meetingID int) (json.RawMessage, error)
GetTitleInformation calls the func.