webapi

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0, BSD-2-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const PluginName = "WebAPI"

PluginName is the name of the web API plugin.

Variables

View Source
var Parameters = &ParametersDefinition{}

Parameters contains the configuration used by the webapi plugin.

Functions

func IndexRequest

func IndexRequest(c echo.Context) error

IndexRequest returns INDEX

func ParseJSONRequest added in v0.5.8

func ParseJSONRequest(c echo.Context, dest interface{}) error

ParseJSONRequest parses json from HTTP request body into the dest.

func Plugin added in v0.2.0

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func Server

func Server() *echo.Echo

Server gets the server instance.

Types

type ParametersDefinition added in v0.7.4

type ParametersDefinition struct {
	// BindAddress defines the bind address for the web API.
	BindAddress string `default:"127.0.0.1:8080" usage:"the bind address for the web API"`
	BasicAuth   struct {
		// Enabled defines whether basic HTTP authentication is required to access the API.
		Enabled bool `default:"false" usage:"whether to enable HTTP basic auth"`
		// Username defines the user used by the basic HTTP authentication.
		Username string `default:"goshimmer" usage:"HTTP basic auth username"`
		// Password defines the password used by the basic HTTP authentication.
		Password string `default:"goshimmer" usage:"HTTP basic auth password"`
	} `name:"basic_auth"`
}

ParametersDefinition contains the definition of the parameters used by the webapi plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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