api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Host = "localhost"
	Port = "3333"
)

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(w http.ResponseWriter, error string, code int)

ErrorJSON replies to the request with the specified error message and HTTP code using JSON.

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, data interface{})

ResponseJSON replies to the request with the specified message using JSON.

func Start

func Start()

Start starts the API server.

Types

type State

type State struct {
	// Parsed data from the sav userfile.
	SaveData savedata.SaveData
}

State for forced single session with no client storage.

var ServerState State

Jump to

Keyboard shortcuts

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