webserver

package
v0.0.0-...-dd7401d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidTokenError

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

InvalidTokenError signals invalid token usage

func (*InvalidTokenError) Error

func (e *InvalidTokenError) Error() string

type Token

type Token struct {
	Value string
	// contains filtered or unexported fields
}

Token token used for webserver communication

func NewToken

func NewToken(callback TokenTimeout) *Token

New creates a new token

func (*Token) IsValid

func (t *Token) IsValid() bool

func (*Token) UseToken

func (t *Token) UseToken() error

type TokenTimeout

type TokenTimeout func(token *Token)

TokenTimeout callback when a token times out

type WebServer

type WebServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

WebServer REST endpoint for sending data

func New

New creates a new WebServer

func (*WebServer) Start

func (ws *WebServer) Start() <-chan error

func (*WebServer) TokenTimeout

func (ws *WebServer) TokenTimeout(token *Token)

Jump to

Keyboard shortcuts

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