Documentation ¶
Index ¶
- Constants
- Variables
- func HandleStopGame(platform platforms.Platform) http.HandlerFunc
- func LoggerMiddleware(logger *zerolog.Logger) func(next http.Handler) http.Handler
- func RunApiServer(pl platforms.Platform, cfg *config.UserConfig, st *state.State, ...)
- type AddMappingRequest
- type AllMappingsResponse
- type HistoryReponseEntry
- type HistoryResponse
- type Index
- type IndexResponse
- type LaunchRequest
- type LaunchRequestMetadata
- type MappingResponse
- type PlayingResponse
- type ReaderResponse
- type ReaderStatusResponse
- type ReaderWriteRequest
- type SearchResultGame
- type SearchResults
- type SettingsResponse
- type StatusResponse
- type System
- type SystemsResponse
- type TokenResponse
- type UpdateMappingRequest
- type UpdateSettingsRequest
- type VersionResponse
Constants ¶
View Source
const ( SubStreamStatus = "status" SubStreamEvents = "events" )
Variables ¶
View Source
var IndexInstance = NewIndex()
Functions ¶
func HandleStopGame ¶
func HandleStopGame(platform platforms.Platform) http.HandlerFunc
func RunApiServer ¶
func RunApiServer( pl platforms.Platform, cfg *config.UserConfig, st *state.State, tq *tokens.TokenQueue, db *database.Database, )
Types ¶
type AddMappingRequest ¶
type AllMappingsResponse ¶
type AllMappingsResponse struct {
Mappings []MappingResponse `json:"mappings"`
}
func (*AllMappingsResponse) Render ¶
func (amr *AllMappingsResponse) Render(w http.ResponseWriter, r *http.Request) error
type HistoryReponseEntry ¶
type HistoryResponse ¶
type HistoryResponse struct {
Entries []HistoryReponseEntry `json:"entries"`
}
func (*HistoryResponse) Render ¶
func (hr *HistoryResponse) Render(w http.ResponseWriter, r *http.Request) error
type Index ¶
type Index struct { Indexing bool TotalSteps int CurrentStep int CurrentDesc string TotalFiles int // contains filtered or unexported fields }
func (*Index) GenerateIndex ¶
func (s *Index) GenerateIndex(platform platforms.Platform, cfg *config.UserConfig)
func (*Index) SetEventHook ¶
type IndexResponse ¶
type LaunchRequest ¶
type LaunchRequest struct { Type string `json:"type"` UID string `json:"uid"` Text string `json:"text"` Data string `json:"data"` Metadata *LaunchRequestMetadata `json:"metadata"` }
type LaunchRequestMetadata ¶
type LaunchRequestMetadata struct {
ToyModel *string `json:"toyModel"`
}
type MappingResponse ¶
type PlayingResponse ¶
type ReaderResponse ¶
type ReaderStatusResponse ¶
TODO: legacy, remove in v2
type ReaderWriteRequest ¶
type ReaderWriteRequest struct {
Text string `json:"text"`
}
type SearchResultGame ¶
type SearchResults ¶
type SearchResults struct { Results []SearchResultGame `json:"results"` Total int `json:"total"` }
func (*SearchResults) Render ¶
func (sr *SearchResults) Render(w http.ResponseWriter, r *http.Request) error
type SettingsResponse ¶
type SettingsResponse struct { ConnectionString string `json:"connectionString"` AllowCommands bool `json:"allowCommands"` DisableSounds bool `json:"disableSounds"` ProbeDevice bool `json:"probeDevice"` ExitGame bool `json:"exitGame"` ExitGameDelay int8 `json:"exitGameDelay"` ExitGameBlocklist []string `json:"exitGameBlocklist"` Debug bool `json:"debug"` Launching bool `json:"launching"` }
func (*SettingsResponse) Render ¶
func (sr *SettingsResponse) Render(w http.ResponseWriter, r *http.Request) error
type StatusResponse ¶
type StatusResponse struct { Reader ReaderStatusResponse `json:"reader"` // TODO: remove in v2 Readers []ReaderResponse `json:"readers"` ActiveToken TokenResponse `json:"activeToken"` LastToken TokenResponse `json:"lastToken"` Launching bool `json:"launching"` GamesIndex IndexResponse `json:"gamesIndex"` Playing PlayingResponse `json:"playing"` }
func (*StatusResponse) Render ¶
func (sr *StatusResponse) Render(w http.ResponseWriter, r *http.Request) error
type SystemsResponse ¶
type SystemsResponse struct {
Systems []System `json:"systems"`
}
func (*SystemsResponse) Render ¶
func (sr *SystemsResponse) Render(w http.ResponseWriter, _ *http.Request) error
type TokenResponse ¶
type UpdateMappingRequest ¶
type UpdateSettingsRequest ¶
type UpdateSettingsRequest struct { ConnectionString *string `json:"connectionString"` AllowCommands *bool `json:"allowCommands"` DisableSounds *bool `json:"disableSounds"` ProbeDevice *bool `json:"probeDevice"` ExitGame *bool `json:"exitGame"` ExitGameDelay *int8 `json:"exitGameDelay"` ExitGameBlocklist *[]string `json:"exitGameBlocklist"` Debug *bool `json:"debug"` Launching *bool `json:"launching"` }
type VersionResponse ¶
func (*VersionResponse) Render ¶
func (vr *VersionResponse) Render(w http.ResponseWriter, r *http.Request) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.