webapi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 16 Imported by: 0

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.

View Source
var (
	// Plugin is the plugin instance of the web API plugin.
	Plugin *node.Plugin
)

Functions

func IndexRequest

func IndexRequest(c echo.Context) error

IndexRequest returns INDEX

func ParseJSONRequest

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

ParseJSONRequest parses json from HTTP request body into the dest.

Types

type ParametersDefinition

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
	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:"zipp" usage:"HTTP basic auth username"`
		// Password defines the password used by the basic HTTP authentication.
		Password string `default:"zipp" usage:"HTTP basic auth password"`
	}

	// EnableDSFilter determines if the DoubleSpendFilter should be enabled.
	EnableDSFilter bool `default:"false" usage:"whether to enable double spend filter"`
}

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

Jump to

Keyboard shortcuts

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