api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package api contains the implementation of notypo's streaming-api. This file is structured differently to golang's standard order. I.e. the file is structued by operations. On top, there is the Serve function, that registers all operations. The operations are listed below in the same order as they are registered in the Serve function. The public constants and types relevant to the operation are declared right above the actual function. The private ones right below. The actual api is documented externally using swagger. The comments in this document provide a developers-view

Index

Constants

View Source
const (
	PathVersion                    = "/version"
	PathCreateStream               = "/stream"
	PathOpenStreamConnection       = "/stream/{id}"
	PathCloseStreamConnection      = "/stream/{id}"
	PathEstablishWebsocketToStream = "/stream/websocket/{id}"
)

paths

Variables

This section is empty.

Functions

func Register

func Register()

Register registers the api-functions specified in this file at the http/websocket communication-unit

func Serve

func Serve()

Serve starts the webserver which implements the api specified in this file

Types

type StreamID

type StreamID *int64

StreamID (response)

type StreamSourceType

type StreamSourceType string

StreamSourceType is a code for a specific type of streams.StreamSource

const (
	// Random StreamSources provide an endless Stream of streams.Characters. The
	// Characters are randomly picked from a given charset
	Random StreamSourceType = "Random"
	// Dictionary StreamSources provide an endless Stream of streams.Characters.
	// The Characters form words, wich are randomly picked from a dictionary's
	// subset, wich only consists of a given charset
	Dictionary StreamSourceType = "Dictionary"
)

type StreamSupplierDescription

type StreamSupplierDescription struct {
	Type    StreamSourceType `json:"type"`
	Charset []rune           `json:"charset"`
}

StreamSupplierDescription (request) specifies the type and properties of a StreamSupplier

type StreamSupplierID

type StreamSupplierID *int64

StreamSupplierID (response)

type VersionResponse

type VersionResponse struct {
	Version   string `json:"version"`
	GitCommit string `json:"git_commit"`
	BuildTime string `json:"build_time"`
}

VersionResponse holds general information about this program

Jump to

Keyboard shortcuts

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