api

package
v0.0.0-...-bda66fc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: ISC Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaxLatest is the highest limit amount for getRandom
	MaxLatest = 100
)

Variables

This section is empty.

Functions

func DecodeHash

func DecodeHash(s string) (hash.Hash, error)

DecodeHash is a utility function, allowing the decoding of various formats

func JSONize

func JSONize(o *tangle.Object) jsonSite

JSONize converts an object into a jsonSite

Types

type API

type API struct {
	ListenInterface string
	Message         string
	// contains filtered or unexported fields
}

API is used as a container, allowing the REST API to access the node

func New

func New(c config.Configuration, n *node.Node) *API

New returns a configured instance of the API server

func (*API) Run

func (a *API) Run() error

Run starts the API server as specified in the configuration

type Error

type Error struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

Error is returned when something has gone wrong

Jump to

Keyboard shortcuts

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