api

package
v0.0.0-...-30c4d99 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"error"`
}

Error represents JSON error to be sent to user.

type Server

type Server struct {
	Name      string          // Name of this Nanny.
	Notifiers notifiers       // Enabled notifiers.
	Storage   storage.Storage // What to use as persistence system.
	// contains filtered or unexported fields
}

Server is Nanny API Server.

func (*Server) Handler

func (a *Server) Handler() (http.Handler, error)

Handler returns http.Handler and error. This way we can customise http.Server and just pass in our handlers.

type Signal

type Signal struct {
	// Name of program being monitored.
	// IP addres of caller is appended to the name so it may be non-unique.
	Name     string `json:"name"`
	Notifier string `json:"notifier"` // What notifier to use.
	// After how many seconds to expect next call.
	// May contain "10s", "1h": https://golang.org/pkg/time/#ParseDuration
	NextSignal string            `json:"next_signal"`
	Meta       map[string]string `json:"meta"` // Metadata for this signal, may contain custom data.
}

Signal represents incomming JSON-encoded data to process.

Jump to

Keyboard shortcuts

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