Documentation
¶
Overview ¶
Package vela presents the Vela v0 protocol through neutral host services.
Index ¶
- Constants
- Variables
- func AppearanceChanged(before, after map[string]any) bool
- func CapabilitiesChanged(before, after map[string]any) bool
- func DedicatedPort(s map[string]any) int
- func IsBuiltinSkinID(id string) bool
- func NativeLibraryType(mt frontend.MediaType) string
- func NormalizeSettings(s frontend.Settings) frontend.Settings
- func ProjectLibrary(p frontend.Presentations, fallback frontend.MediaType) (frontend.MediaType, string, bool)
- func PruneAppIcons(ctx context.Context, db *sql.DB, settings map[string]any)
- func PruneWordmarks(ctx context.Context, db *sql.DB, settings map[string]any)
- func ServeOnMainPort(s map[string]any) bool
- func ValidLivePreviewMode(mode string) bool
- func ValidSkinID(id string) bool
- type AppIcon
- type AppIconValidationError
- type BuiltinSkin
- type Frontend
- type SignInMethods
- type SkinDocumentEntry
- type SkinStore
- func (s *SkinStore) HasInstalled(ctx context.Context, id string) bool
- func (s *SkinStore) InstallArchive(ctx context.Context, pkg []byte) (SkinSummary, error)
- func (s *SkinStore) List(ctx context.Context, velaClientDir string) []SkinSummary
- func (s *SkinStore) Remove(ctx context.Context, id string) error
- func (s *SkinStore) Snapshot(ctx context.Context) (generation uint64, packs []json.RawMessage, documents []SkinDocumentEntry, ...)
- type SkinSummary
- type Wordmark
- type WordmarkValidationError
Constants ¶
const ( MaxAppNameChars = 40 MaxWordmarkBytes = 512 << 10 MaxWordmarkWidth = 1024 MaxWordmarkHeight = 256 )
const ( LivePreviewAuto = "auto" LivePreviewOnClick = "on-click" LivePreviewOff = "off" )
const ( MaxAppIconBytes = 512 << 10 MaxAppIconSize = 1024 )
const ( MaxSkinArchiveBytes = 8 << 20 // 8 MB .vskin archive MaxSkinExpandedBytes = 32 << 20 // 32 MB expanded contents MaxSkinArchiveFiles = 200 // max files in .vskin MaxSkinPackBytes = 64 << 10 // 64 KB SkinPack JSON MaxSkinDocumentBytes = 2 << 20 // 2 MB SkinDocument JSON )
const DefaultPort = 8098
Variables ¶
var ( ErrBuiltinSkin = errors.New("built-in skins cannot be modified or removed") ErrSkinNotFound = errors.New("skin not found") ErrSkinInvalid = errors.New("invalid skin package") )
var (
ErrAppIconTooLarge = errors.New("app icon exceeds 512 KB")
)
var (
ErrWordmarkTooLarge = errors.New("wordmark exceeds 512 KB")
)
Functions ¶
func AppearanceChanged ¶
AppearanceChanged reports whether two Vela settings maps produce a different appearance/branding snapshot.
func CapabilitiesChanged ¶
CapabilitiesChanged reports whether two Vela settings maps produce different advertised sign-in capabilities.
func DedicatedPort ¶
DedicatedPort extracts a valid optional dedicated listener port (1..65535) from Vela settings, or returns 0 when Vela uses only Ether's main port.
func IsBuiltinSkinID ¶
IsBuiltinSkinID reports whether id names the compiled cinematic engine alias or one of Vela's non-removable built-in skin documents.
func NativeLibraryType ¶
func NormalizeSettings ¶
NormalizeSettings trims appName, omits unset branding keys, and clones wordmark/icon maps.
func ProjectLibrary ¶
func ProjectLibrary(p frontend.Presentations, fallback frontend.MediaType) (frontend.MediaType, string, bool)
ProjectLibrary interprets this adapter's presentation declaration. Console-only and adapter-only sources remain unpublished; visibility is still applied by Experience.Views.
func PruneAppIcons ¶
PruneAppIcons removes unreferenced app icons (and their generated variants) older than an hour so an uploaded draft is never deleted mid-edit while old assets do not accumulate.
func PruneWordmarks ¶
PruneWordmarks removes unreferenced wordmarks older than an hour so an uploaded draft is never deleted mid-edit while old assets do not accumulate.
func ServeOnMainPort ¶
ServeOnMainPort reports whether Vela should continue serving /vela and /sessions/media on Ether's main (Plex) port. Defaults to true when omitted.
func ValidLivePreviewMode ¶
ValidLivePreviewMode reports whether mode is a supported Vela Live TV preview setting value.
func ValidSkinID ¶
ValidSkinID reports whether id matches the Vela skin identifier grammar.
Types ¶
type AppIcon ¶
type AppIcon struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
Digest string `json:"digest"`
}
AppIcon is a validated, content-addressed square owner PWA icon asset.
func UploadAppIcon ¶
UploadAppIcon validates a square PNG, SVG, or WebP app icon (<= 512 KB, 1x1..1024x1024 px), generates safe PNG sizes for PWA any/maskable (192, 512), apple-touch-icon (180), and favicons (16, 32, 48), and stores them by SHA-256 digest.
type AppIconValidationError ¶
type AppIconValidationError struct {
Message string
}
AppIconValidationError reports an invalid square app icon image or dimension check.
func (*AppIconValidationError) Error ¶
func (e *AppIconValidationError) Error() string
type BuiltinSkin ¶
BuiltinSkin describes a non-removable skin shipped with Vela.
func BuiltinSkins ¶
func BuiltinSkins() []BuiltinSkin
BuiltinSkins returns the non-removable built-in skin documents in display order.
type Frontend ¶
func (Frontend) Describe ¶
func (Frontend) Describe() frontend.Descriptor
type SignInMethods ¶
SignInMethods holds the owner's enabled sign-in methods for Vela viewers. Each method defaults to enabled when absent from persisted settings.
func SignInMethodsFromSettings ¶
func SignInMethodsFromSettings(s map[string]any) SignInMethods
SignInMethodsFromSettings returns the effective Vela sign-in method toggles.
type SkinDocumentEntry ¶
type SkinDocumentEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
URL string `json:"url"`
Preview string `json:"preview,omitempty"`
Swatches []string `json:"swatches"`
}
SkinDocumentEntry is an entry in GET /vela/v0/appearance documents[].
type SkinStore ¶
type SkinStore struct {
// contains filtered or unexported fields
}
SkinStore manages owner-installed Vela skins on disk and in the database.
func NewSkinStore ¶
NewSkinStore creates a store backed by db and dir (typically <dataDir>/vela-skins).
func (*SkinStore) HasInstalled ¶
HasInstalled reports whether id is currently installed.
func (*SkinStore) InstallArchive ¶
InstallArchive validates, rewrites, atomically unpacks, and persists a .vskin archive.
func (*SkinStore) List ¶
func (s *SkinStore) List(ctx context.Context, velaClientDir string) []SkinSummary
List returns built-in skins followed by owner-installed skins. When velaClientDir contains skins/catalog.json, built-in previews, versions, and swatches are enriched from it.
type SkinSummary ¶
type SkinSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Kind string `json:"kind"` // "pack" or "document"
Builtin bool `json:"builtin"`
Preview string `json:"preview,omitempty"`
Swatches []string `json:"swatches"`
InstalledAt int64 `json:"installedAt,omitempty"`
}
SkinSummary describes a built-in or owner-installed skin for the console.
type Wordmark ¶
type Wordmark struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
Digest string `json:"digest"`
}
Wordmark is a validated, content-addressed owner wordmark asset.
type WordmarkValidationError ¶
type WordmarkValidationError struct {
Message string
}
WordmarkValidationError reports an invalid wordmark image or dimension check.
func (*WordmarkValidationError) Error ¶
func (e *WordmarkValidationError) Error() string
Source Files
¶
- ai_search.go
- appearance.go
- audio_fallback.go
- auth.go
- bootstrap.go
- branding.go
- catalog.go
- client_caps.go
- compatibility.go
- detail.go
- detail_warm.go
- events.go
- extra_playback.go
- fail_log.go
- frontend.go
- hero.go
- icon.go
- idempotency.go
- images.go
- libraries.go
- library_live.go
- library_projection.go
- live.go
- live_cursor.go
- liveness.go
- media.go
- media_cap_wait.go
- media_diagnostics.go
- original_video.go
- output.go
- pairing_tokens.go
- people.go
- playback.go
- playlists.go
- plex_profiles.go
- quality.go
- rating.go
- reading.go
- rows.go
- session_ports.go
- skins.go
- theme.go
- tracks.go
- trailer_preview.go
- versions.go