models

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: GPL-3.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	NotificationReadersConnected     = "readers.added"
	NotificationReadersDisconnected  = "readers.removed"
	NotificationRunning              = "running"
	NotificationTokensAdded          = "tokens.added"
	NotificationTokensRemoved        = "tokens.removed"
	NotificationStopped              = "media.stopped"
	NotificationStarted              = "media.started"
	NotificationMediaIndexing        = "media.indexing" // TODO: rename to generating
	NotificationPlaytimeLimitReached = "playtime.limit.reached"
	NotificationPlaytimeLimitWarning = "playtime.limit.warning"
)
View Source
const (
	PlaytimeLimitReasonSession = "session"
	PlaytimeLimitReasonDaily   = "daily"
)
View Source
const (
	MethodLaunch               = "launch" // DEPRECATED
	MethodRun                  = "run"
	MethodRunScript            = "run.script"
	MethodStop                 = "stop"
	MethodTokens               = "tokens"
	MethodMedia                = "media"
	MethodMediaGenerate        = "media.generate"
	MethodMediaGenerateCancel  = "media.generate.cancel"
	MethodMediaIndex           = "media.index" // DEPRECATED
	MethodMediaSearch          = "media.search"
	MethodMediaTags            = "media.tags"
	MethodMediaActive          = "media.active"
	MethodMediaActiveUpdate    = "media.active.update"
	MethodSettings             = "settings"
	MethodSettingsUpdate       = "settings.update"
	MethodSettingsReload       = "settings.reload"
	MethodSettingsLogsDownload = "settings.logs.download"
	MethodPlaytimeLimits       = "settings.playtime.limits"
	MethodPlaytimeLimitsUpdate = "settings.playtime.limits.update"
	MethodPlaytime             = "playtime"
	MethodClients              = "clients"
	MethodClientsNew           = "clients.new"
	MethodClientsDelete        = "clients.delete"
	MethodSystems              = "systems"
	MethodLaunchersRefresh     = "launchers.refresh"
	MethodHistory              = "tokens.history"
	MethodMappings             = "mappings"
	MethodMappingsNew          = "mappings.new"
	MethodMappingsDelete       = "mappings.delete"
	MethodMappingsUpdate       = "mappings.update"
	MethodMappingsReload       = "mappings.reload"
	MethodReaders              = "readers"
	MethodReadersWrite         = "readers.write"
	MethodReadersWriteCancel   = "readers.write.cancel"
	MethodVersion              = "version"
	MethodHealthCheck          = "health"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveMedia

type ActiveMedia struct {
	Started    time.Time `json:"started"`
	LauncherID string    `json:"launcherId"`
	SystemID   string    `json:"systemId"`
	SystemName string    `json:"systemName"`
	Path       string    `json:"mediaPath"`
	Name       string    `json:"mediaName"`
}

func NewActiveMedia added in v2.7.0

func NewActiveMedia(systemID, systemName, path, name, launcherID string) *ActiveMedia

NewActiveMedia creates a new ActiveMedia with the current timestamp.

func (*ActiveMedia) Equal

func (a *ActiveMedia) Equal(with *ActiveMedia) bool

type AddMappingParams

type AddMappingParams struct {
	Label    string `json:"label"`
	Type     string `json:"type"`
	Match    string `json:"match"`
	Pattern  string `json:"pattern"`
	Override string `json:"override"`
	Enabled  bool   `json:"enabled"`
}

type AllMappingsResponse

type AllMappingsResponse struct {
	Mappings []MappingResponse `json:"mappings"`
}

type ClientResponse

type ClientResponse struct {
	Name    string    `json:"name"`
	Address string    `json:"address"`
	Secret  string    `json:"secret"`
	ID      uuid.UUID `json:"id"`
}

type DeleteClientParams

type DeleteClientParams struct {
	ID string `json:"id"`
}

type DeleteMappingParams

type DeleteMappingParams struct {
	ID int `json:"id"`
}

type ErrorObject

type ErrorObject struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type HealthCheckResponse added in v2.7.1

type HealthCheckResponse struct {
	Status string `json:"status"`
}

type HistoryResponse

type HistoryResponse struct {
	Entries []HistoryResponseEntry `json:"entries"`
}

type HistoryResponseEntry

type HistoryResponseEntry struct {
	Time    time.Time `json:"time"`
	Type    string    `json:"type"`
	UID     string    `json:"uid"`
	Text    string    `json:"text"`
	Data    string    `json:"data"`
	Success bool      `json:"success"`
}

type IndexingStatusResponse

type IndexingStatusResponse struct {
	TotalSteps         *int    `json:"totalSteps,omitempty"`
	CurrentStep        *int    `json:"currentStep,omitempty"`
	CurrentStepDisplay *string `json:"currentStepDisplay,omitempty"`
	TotalFiles         *int    `json:"totalFiles,omitempty"`
	TotalMedia         *int    `json:"totalMedia,omitempty"`
	Exists             bool    `json:"exists"`
	Indexing           bool    `json:"indexing"`
	Optimizing         bool    `json:"optimizing"`
}

type LogDownloadResponse

type LogDownloadResponse struct {
	Filename string `json:"filename"`
	Content  string `json:"content"`
	Size     int    `json:"size"`
}

type MappingResponse

type MappingResponse struct {
	ID       string `json:"id"`
	Added    string `json:"added"`
	Label    string `json:"label"`
	Type     string `json:"type"`
	Match    string `json:"match"`
	Pattern  string `json:"pattern"`
	Override string `json:"override"`
	Enabled  bool   `json:"enabled"`
}

type MediaIndexParams

type MediaIndexParams struct {
	Systems *[]string `json:"systems"`
}

type MediaResponse

type MediaResponse struct {
	Database IndexingStatusResponse `json:"database"`
	Active   []ActiveMedia          `json:"active"`
}

type MediaStartedParams

type MediaStartedParams struct {
	SystemID   string `json:"systemId"`
	SystemName string `json:"systemName"`
	MediaPath  string `json:"mediaPath"`
	MediaName  string `json:"mediaName"`
}

type NewClientParams

type NewClientParams struct {
	Name string `json:"name"`
}

type Notification

type Notification struct {
	Method string          `json:"method"`
	Params json.RawMessage `json:"params"`
}

type PaginationInfo added in v2.7.0

type PaginationInfo struct {
	NextCursor  *string `json:"nextCursor,omitempty"`
	HasNextPage bool    `json:"hasNextPage"`
	PageSize    int     `json:"pageSize"`
}

type PlaytimeLimitReachedParams added in v2.7.0

type PlaytimeLimitReachedParams struct {
	Reason string `json:"reason"`
}

type PlaytimeLimitWarningParams added in v2.7.0

type PlaytimeLimitWarningParams struct {
	Interval  string `json:"interval"`
	Remaining string `json:"remaining"`
}

type PlaytimeLimitsResponse added in v2.7.0

type PlaytimeLimitsResponse struct {
	Daily        *string  `json:"daily,omitempty"`
	Session      *string  `json:"session,omitempty"`
	SessionReset *string  `json:"sessionReset,omitempty"`
	Retention    *int     `json:"retention,omitempty"`
	Warnings     []string `json:"warnings,omitempty"`
	Enabled      bool     `json:"enabled"`
}

type PlaytimeStatusResponse added in v2.7.0

type PlaytimeStatusResponse struct {
	SessionStarted        *string `json:"sessionStarted,omitempty"`
	SessionDuration       *string `json:"sessionDuration,omitempty"`
	SessionCumulativeTime *string `json:"sessionCumulativeTime,omitempty"`
	SessionRemaining      *string `json:"sessionRemaining,omitempty"`
	CooldownRemaining     *string `json:"cooldownRemaining,omitempty"`
	DailyUsageToday       *string `json:"dailyUsageToday,omitempty"`
	DailyRemaining        *string `json:"dailyRemaining,omitempty"`
	State                 string  `json:"state"`
	SessionActive         bool    `json:"sessionActive"`
	LimitsEnabled         bool    `json:"limitsEnabled"`
}

type ReaderInfo

type ReaderInfo struct {
	ID           string   `json:"id"`
	Info         string   `json:"info"`
	Capabilities []string `json:"capabilities"`
	Connected    bool     `json:"connected"`
}

type ReaderResponse

type ReaderResponse struct {
	Driver    string `json:"driver"`
	Path      string `json:"path"`
	Connected bool   `json:"connected"`
}

type ReaderWriteParams

type ReaderWriteParams struct {
	Text string `json:"text"`
}

type ReadersResponse

type ReadersResponse struct {
	Readers []ReaderInfo `json:"readers"`
}

type RequestObject

type RequestObject struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      *uuid.UUID      `json:"id,omitempty"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

type ResponseErrorObject

type ResponseErrorObject struct {
	Error   *ErrorObject `json:"error"`
	JSONRPC string       `json:"jsonrpc"`
	ID      uuid.UUID    `json:"id"`
}

ResponseErrorObject exists for sending errors, so we can omit result from the response, but so nil responses are still returned when using the main ResponseObject.

type ResponseObject

type ResponseObject struct {
	Result  any          `json:"result"`
	Error   *ErrorObject `json:"error,omitempty"`
	JSONRPC string       `json:"jsonrpc"`
	ID      uuid.UUID    `json:"id"`
}

type RunParams

type RunParams struct {
	Type   *string `json:"type"`
	UID    *string `json:"uid"`
	Text   *string `json:"text"`
	Data   *string `json:"data"`
	Unsafe bool    `json:"unsafe"`
}

type RunScriptParams

type RunScriptParams struct {
	Name      *string               `json:"name"`
	Cmds      []models.ZapScriptCmd `json:"cmds"`
	ZapScript int                   `json:"zapscript"`
	Unsafe    bool                  `json:"unsafe"`
}

type SearchParams

type SearchParams struct {
	Systems    *[]string `json:"systems"`
	MaxResults *int      `json:"maxResults"`
	Cursor     *string   `json:"cursor,omitempty"`
	Tags       *[]string `json:"tags,omitempty"`
	Letter     *string   `json:"letter,omitempty"`
	Query      *string   `json:"query"`
}

type SearchResultMedia

type SearchResultMedia struct {
	System    System             `json:"system"`
	Name      string             `json:"name"`
	Path      string             `json:"path"`
	ZapScript string             `json:"zapScript"`
	Tags      []database.TagInfo `json:"tags"`
}

type SearchResults

type SearchResults struct {
	Pagination *PaginationInfo     `json:"pagination,omitempty"`
	Results    []SearchResultMedia `json:"results"`
	Total      int                 `json:"total"`
}

type SettingsResponse

type SettingsResponse struct {
	ReadersScanMode         string   `json:"readersScanMode"`
	ReadersScanIgnoreSystem []string `json:"readersScanIgnoreSystems"`
	ReadersScanExitDelay    float32  `json:"readersScanExitDelay"`
	RunZapScript            bool     `json:"runZapScript"`
	DebugLogging            bool     `json:"debugLogging"`
	AudioScanFeedback       bool     `json:"audioScanFeedback"`
	ReadersAutoDetect       bool     `json:"readersAutoDetect"`
}

type System

type System struct {
	ReleaseDate  *string `json:"releaseDate,omitempty"`
	Manufacturer *string `json:"manufacturer,omitempty"`
	ID           string  `json:"id,omitempty"`
	Name         string  `json:"name,omitempty"`
	Category     string  `json:"category,omitempty"`
}

type SystemsResponse

type SystemsResponse struct {
	Systems []System `json:"systems"`
}

type TagsResponse added in v2.7.0

type TagsResponse struct {
	Tags []database.TagInfo `json:"tags"`
}

type TokenResponse

type TokenResponse struct {
	ScanTime time.Time `json:"scanTime"`
	Type     string    `json:"type"`
	UID      string    `json:"uid"`
	Text     string    `json:"text"`
	Data     string    `json:"data"`
}

type TokensResponse

type TokensResponse struct {
	Last   *TokenResponse  `json:"last,omitempty"`
	Active []TokenResponse `json:"active"`
}

type UpdateActiveMediaParams

type UpdateActiveMediaParams struct {
	SystemID  string `json:"systemId"`
	MediaPath string `json:"mediaPath"`
	MediaName string `json:"mediaName"`
}

type UpdateMappingParams

type UpdateMappingParams struct {
	Label    *string `json:"label"`
	Enabled  *bool   `json:"enabled"`
	Type     *string `json:"type"`
	Match    *string `json:"match"`
	Pattern  *string `json:"pattern"`
	Override *string `json:"override"`
	ID       int     `json:"id"`
}

type UpdatePlaytimeLimitsParams added in v2.7.0

type UpdatePlaytimeLimitsParams struct {
	Enabled      *bool     `json:"enabled"`
	Daily        *string   `json:"daily"`
	Session      *string   `json:"session"`
	SessionReset *string   `json:"sessionReset"`
	Warnings     *[]string `json:"warnings"`
	Retention    *int      `json:"retention"`
}

type UpdateSettingsParams

type UpdateSettingsParams struct {
	RunZapScript            *bool     `json:"runZapScript"`
	DebugLogging            *bool     `json:"debugLogging"`
	AudioScanFeedback       *bool     `json:"audioScanFeedback"`
	ReadersAutoDetect       *bool     `json:"readersAutoDetect"`
	ReadersScanMode         *string   `json:"readersScanMode"`
	ReadersScanExitDelay    *float32  `json:"readersScanExitDelay"`
	ReadersScanIgnoreSystem *[]string `json:"readersScanIgnoreSystems"`
}

type VersionResponse

type VersionResponse struct {
	Version  string `json:"version"`
	Platform string `json:"platform"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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