api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V0Prefix = "/api/v0/"

	// Debug
	GetP2pDebugInfoPath = V0Prefix + "debug/p2p_info"
	GetDebugLogPath     = V0Prefix + "debug/log"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

func ErrorMessage

func ErrorMessage(message string) Error

func (Error) Error

func (e Error) Error() string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(conf *config.Config, p2p *p2p.P2p, logBuffer *ringbuffer.RingBuffer) *Handler

func (*Handler) GetLog

func (h *Handler) GetLog(c echo.Context) (err error)

@Tags Debug @Summary Get logs @Accept json @Produce plain @Success 200 {string} string "log text" @Router /debug/log [GET]

func (*Handler) GetP2pDebugInfo

func (h *Handler) GetP2pDebugInfo(c echo.Context) (err error)

@Tags Debug @Summary Get p2p debug info @Accept json @Produce json @Success 200 {object} entity.P2pDebugInfo @Router /debug/p2p_info [GET]

func (*Handler) SetupAPI

func (h *Handler) SetupAPI() error

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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