foxtrot

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package foxtrot provides core foxtrot data structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App added in v0.0.10

type App struct {
	// contains filtered or unexported fields
}

App is a top level data structure containing all relevant foxtrot parts, including database, authenticator and HTTP api structs.

func NewApp added in v0.0.10

func NewApp(cfg *Config, mux *http.ServeMux) (*App, error)

NewApp creates a new App struct for given config and wire it with given mux on /api.

type Config added in v0.0.10

type Config struct {
	DSN        string `help:"SQLite Data Source Name" default:":memory:"`
	AuthSecret string `help:"JWT token generation secret. default: <RANDOM_STRING>" env:"FT_AUTH_SECRET"`

	Version Version `kong:"-"`
}

Config contains the DB and Authenticator configuration as kong struct tags to use as command line flags.

type Message added in v0.0.5

type Message struct {
	ID        int    `json:"id"` // ordered by creation time
	Content   string `json:"content"`
	CreatedAt string `json:"createdAt"`
	Room      string `json:"room"`
	Author    string `json:"author"`
}

Message is a chat message.

type Room added in v0.0.5

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

Room is a chat room identified by its name.

type User

type User struct {
	Name      string `json:"name"`
	AvatarURL string `json:"avatarURL,omitempty"`
	JWT       string `json:"jwt,omitempty"`
	// contains filtered or unexported fields
}

User is a core foxtrot data structure representing a user entry in the database as well as the data related to a user as presented in the web UI.

type Version added in v0.0.13

type Version struct {
	App       string `json:"app"`
	CommitSha string `json:"commitSha"`
	Semver    string `json:"semver"`
}

Version contains build version information which is returned as JSON at the version HTTP endpoint.

Jump to

Keyboard shortcuts

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