api

package
v0.0.0-...-c66ceb2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RPCPath to where the RPC server should listen on
	RPCPath        = "/api"
	VisualizerPath = "/visualizer-socket"

	// ErrNoIDGiven is returned when the request did not contain a valid ID
	ErrNoIDGiven = errors.New("no ID was given with request")
	// ErrExists is returned when the entity which is tried to create already exists
	ErrExists = errors.New("entity with given ID already exists")
	// ErrNotExists is returned when the entity tried to manage dies not exist
	ErrNotExists = errors.New("entity with given ID does not exist")
)

Functions

This section is empty.

Types

type Empty

type Empty struct{}

Empty is ... yah, an empty request :shrug:

type IDBody

type IDBody struct {
	ID string `json:"id"`
}

IDBody is a request object only storing an ID

type Loader

type Loader interface {
	Load() (*cntl.DataStore, error)
}

Loader interface for abstraction in api usage

type Storage

type Storage interface {
	Has(key string, kind interface{}) bool
	Write(key string, value interface{}) error
	Read(key string, value interface{}) error
	List(kind interface{}) []string
	Delete(key string, kind interface{}) error
}

Storage interface for abstraction in api usage

type SuccessResponse

type SuccessResponse struct {
	Success bool `json:"success"`
}

SuccessResponse returns a simple bool to state weather the operation was successful

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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