shipyard

package module
v0.0.0-...-eeaa3c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

shipyard

Configuration and "Builder" tool for the AV Pi Systems

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("The requested item was not found")

ErrNotFound is the error that a Datastore should return if it is unable to find the requested item

Functions

This section is empty.

Types

type APIDevice

type APIDevice struct {
	Driver  string
	Address string
	Ports   []string
}

APIDevice is a slimmed down version of Device used by the AV Control API

type APIRoom

type APIRoom struct {
	ID           string
	ProxyBaseURL string
	Devices      map[string]APIDevice
}

APIRoom represents the room doc used by the AV Control API in order to control a given room

type AudioControl

type AudioControl struct {
	MasterVolume ControlSet
}

AudioControl contains information about audio controls in the room

type ControlAPIRequest

type ControlAPIRequest interface{}

ControlAPIRequest contains the information necessary for making a request to the AV Control API

type ControlGroup

type ControlGroup struct {
	Displays     []DisplayControl
	Audio        AudioControl
	PowerOff     ControlSet
	DefaultState ControlSet
}

ControlGroup represents a group of Devices and inputs. These groups are used for logical grouping and displaying on different UIs

type ControlSet

type ControlSet struct {
	APIRequest ControlAPIRequest
	Requests   []GenericControlRequest
}

ControlSet represents the request to be made (both to the AV Control API and other arbitrary locations) in order to set the room to a given state

type Datastore

type Datastore interface {
	GetRoom(roomID string) (Room, error)
	ListAllRooms() ([]string, error)
	SaveRoom(room Room) error

	GetDevice(deviceID string) (Device, error)
	GetRoomDevices(roomID string) ([]Device, error)
	ListRoomDevices(roomID string) ([]string, error)
	SaveDevice(device Device) error

	GetDeviceTemplate(templateID string) (DeviceTemplate, error)
	ListDeviceTemplates() ([]string, error)

	GetUIConfig(roomID string) (UIConfig, error)
	SaveUIConfig(config UIConfig) error

	SaveControlDoc(doc RoomControlDoc) error

	GetConfig(configID string) (interface{}, error)
}

Datastore is the interface that a datastore implementation must meet in order to function properly for shipyard

type Device

type Device struct {
	ID                 string                           `json:"id"`
	Room               string                           `json:"room"`
	APIControllable    bool                             `json:"api_controllable"`
	PublicDescription  string                           `json:"publicDescription"`
	PrivateDescription string                           `json:"privateDescription"`
	Address            string                           `json:"address"`
	Commands           map[string]GenericControlRequest `json:"commands"`
	Presets            map[string]string                `json:"presets,omitempty"`
	Driver             string                           `json:"driver"`
	DyanmicPorts       bool                             `json:"dynamicPorts"`
	Ports              []DevicePort                     `json:"ports"`
	Tags               Tags                             `json:"tags"`
}

Device represents a physical AV device and its configuration

type DeviceControl

type DeviceControl struct {
	Driver  string   `json:"driver"`
	Address string   `json:"address"`
	Ports   []string `json:"ports,omitempty"`
}

DeviceControl represents a pared down set of information for a device that is necessary for the AV API to understand how to control the device

type DevicePort

type DevicePort struct {
	ID        string         `json:"id"`
	Name      string         `json:"name"`
	Endpoints []PortEndpoint `json:"endpoints"`
	Incoming  bool           `json:"incoming"`
	Type      string         `json:"type"`
}

DevicePort represents a port on a physical device

type DeviceTemplate

type DeviceTemplate struct {
	ID       string `json:"id"`
	Template Device `json:"template"`
}

DeviceTemplate represents a template for a device

type DisplayControl

type DisplayControl struct {
	Name    string
	Icon    string
	Sources []DisplayControlSource
}

DisplayControl represents a Display and its associated controls for a given group

type DisplayControlSource

type DisplayControlSource struct {
	Name    string
	Icon    string
	Visible bool
	ControlSet
}

DisplayControlSource represents a source and its associated controls in relation to a specific display

type GenericControlRequest

type GenericControlRequest struct {
	URL    string
	Method string
	Body   interface{}
}

GenericControlRequest contains the information necessary to make a generic HTTP request in association with making state changes in a room

type Logger

type Logger interface {
	Debugf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
}

Logger is the interface that should be met by a logging implementation in order for it to be useful to shipyard

type MasterVolume

type MasterVolume struct {
	Device string `json:"device"`
	Block  string `json:"block"`
}

type PortEndpoint

type PortEndpoint struct {
	Device string `json:"device"`
	Port   string `json:"port"`
}

type Room

type Room struct {
	ID                 string `json:"id"`
	Designation        string `json:"designation"`
	PublicDescription  string `json:"publicDescription"`
	PrivateDescription string `json:"privateDescription"`
	ProxyBaseURL       string `json:"proxyBaseURL"`
	Tags               Tags   `json:"tags"`
}

Room represents a physical room containing AV Equipment

type RoomConfig

type RoomConfig struct {
	ID            string
	ControlPanels map[string]string
	ControlGroups map[string]ControlGroup
}

RoomConfig represents the program for a room that can be used by various UIs to control different states in the room

type RoomControlCompiler

type RoomControlCompiler interface {
	CompileRoomControlDoc(Room, []Device) (RoomControlDoc, error)
}

RoomControlCompiler represents the interface that an implementation needs to meet in order to be used as a compiler for a room control doc

type RoomControlDoc

type RoomControlDoc struct {
	ID           string                   `json:"id"`
	ProxyBaseURL string                   `json:"proxyBaseURL"`
	Devices      map[string]DeviceControl `json:"devices"`
}

RoomControlDoc represents a pared down view of a room that the AV API needs in order to successfully control a room

type Tags

type Tags map[string]string

Tags are a set of arbitrary key value pairs used for storing extra information

type Transport

type Transport interface {
	Serve(address string) error
}

Transport is the interface that any given transport implementation should meet for shipyard

type UIConfig

type UIConfig struct {
	ID            string                  `json:"id"`
	ControlPanels map[string]string       `json:"controlPanels"`
	ControlGroups map[string]ControlGroup `json:"controlGroups"`
}

type UIControlGroup

type UIControlGroup struct {
	PowerOff     ControlSet           `json:"powerOff"`
	DefaultState ControlSet           `json:"defaultState"`
	Displays     map[string]UIDisplay `json:"displays"`
	Inputs       []string             `json:"inputs"`
	Microphones  map[string][]string  `json:"microphones"`
	Cameras      []string             `json:"cameras"`
	MasterVolume MasterVolume         `json:"masterVolume"`
}

type UIDisplay

type UIDisplay struct {
	DefaultInput string `json:"defaultInput"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL