explorer

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(store mock.GlobalStorer, corsOrigins []string) (handler http.Handler)

NewHandler constructs an http.Handler with router that servers requests required by chunk explorer.

/api/has-key/{node}/{key}
/api/keys?start={key}&node={node}&limit={int[0..1000]}
/api/nodes?start={node}&key={key}&limit={int[0..1000]}

Data from global store will be served and appropriate CORS headers will be sent if allowed origins are provided.

Types

type KeysResponse

type KeysResponse struct {
	Keys []string `json:"keys"`
	Next string   `json:"next,omitempty"`
}

KeysResponse is a JSON-encoded response for global store Keys and NodeKeys methods.

type NodesResponse

type NodesResponse struct {
	Nodes []string `json:"nodes"`
	Next  string   `json:"next,omitempty"`
}

NodesResponse is a JSON-encoded response for global store Nodes and KeyNodes methods.

type StatusResponse

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

StatusResponse is a standardized JSON-encoded response that contains information about HTTP response code for easier status identification.

Jump to

Keyboard shortcuts

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