Back to godoc.org

Package v1

v1.1.1
Latest Go to latest

The highest tagged major version is .

Published: Jun 21, 2020 | License: MIT | Module: devt.de/krotik/brawler

Overview

Package v1 contains Brawler REST API Version 1.

Engine endpoint

/engine

The engine endpoint is used to control named event engines. A GET request gives an overview over all available engines. The response should have the following structure:

[ <engine name>, <engine name>, <engine name> ]

/engine/<engine name>

A GET request to a specific engine returns the current engine state. The response should have the following structure:

{
	id      : <ID of the engine>
	workers : <Number of worker threads>
	status  : <Status of the engine (Running / Stopping / Stopped)>
}

A POST request to a specific engine runs the given rumble code on the engine. The body should contain the rumble script in plain text. The engine is created if it does not exist. Can optimally be posted to a subpath which is interpreted as code name.

The response is the result of the code:

{
	result: <Result of the code>
}

/engine/<engine name>/log

A GET request to the log path returns all log messages for the given engine. The response should be a list of log message objects of the following structure:

{
	mid   : <Root monitor ID for the log message>
	level : <Message level>
	msg   : <Log message>
}

A DELETE to the log path clears all log messages.

/engine/<engine name>/sinks

A DElETE to the sinks path clears all current sinks from an engine and reloads its standard sinks.

/engine/<engine name>/sinks?prefix=<prefix>

A GET request to the sinks path returns all available sinks. The response should have the following structure:

{
	<name> : {
		description      : <Sink description>,
		kind_match       : <List of matched event kinds>
		scope_match      : <List of matched scopes>
		state_match      : { <Required state key> : <Required state value / nil for any> }
		priority         : <Priority of the sink>
		suppression_list : <List of suppressed sinks>
	}
}

The search can be narrowed down by providing an optional name prefix.

/engine/<engine name>/sink/<sink name>

A GET request to the sink path returns the code of the given sink in plain text.

Rumble endpoint

The rumble endpoint can be used to retrieve information about Rumble.

/rumble/functions

A GET request to the functions endpoint returns a list of all available Rumble functions.

/rumble/keywords

A GET request to the keywords endpoint returns a list of all available Rumble keywords.

Index

Constants

const APIv1 = "/v1"

APIv1 is the directory for version 1 of the API

const EndpointEngine = web.APIRoot + APIv1 + "/engine/"

EndpointEngine is the engine endpoint URL (rooted). Handles everything under engine/...

const EndpointRumble = web.APIRoot + APIv1 + "/rumble/"

EndpointRumble is the rumble endpoint URL (rooted). Handles everything under rumble/...

Variables

var V1EndpointMap = map[string]web.RestEndpointInst{
	EndpointEngine: EngineEndpointInst,
	EndpointRumble: RumbleEndpointInst,
}

V1EndpointMap is a map of urls to endpoints for version 1 of the API

func EngineEndpointInst

func EngineEndpointInst() web.RestEndpointHandler

EngineEndpointInst creates a new endpoint handler.

func RumbleEndpointInst

func RumbleEndpointInst() web.RestEndpointHandler

RumbleEndpointInst creates a new endpoint handler.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier