api

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogListPath = "/log/list"
	LogViewPath = "/log/view"
)
View Source
var (
	ConfigPath = "/config"
)
View Source
var (
	EnvPath = "/env"
)
View Source
var (
	ExploreCurrentPath = "/state/explore/current"
)
View Source
var (
	RequestsPath = "/state/requests"
)

Functions

This section is empty.

Types

type ConfigAPI

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

ConfigAPI represents current configuration explore rest api..

func NewConfigAPI

func NewConfigAPI(node models.Node, cfg config.Configuration) *ConfigAPI

NewConfigAPI creates a ConfigAPI instance.

func (*ConfigAPI) Configuration

func (h *ConfigAPI) Configuration(c *gin.Context)

@Summary current node's configuration @Description return current node's configuration. @Tags State @Accept json @Produce json @Success 200 {object} object @Router /config [get]

func (*ConfigAPI) Register

func (h *ConfigAPI) Register(route gin.IRoutes)

Register adds config explore url route.

type EnvAPI

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

EnvAPI represents LinDB's env api.

func NewEnvAPI

func NewEnvAPI(monitor config.Monitor, role string) *EnvAPI

NewEnvAPI creates a EnvAPI instance.

func (*EnvAPI) GetEnv

func (api *EnvAPI) GetEnv(c *gin.Context)

GetEnv returns LinDB's env vars.

func (*EnvAPI) Register

func (api *EnvAPI) Register(route gin.IRoutes)

Register adds request env url route.

type ExploreAPI

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

ExploreAPI represents monitoring metric explore rest api.

func NewExploreAPI

func NewExploreAPI(globalKeyValues tag.Tags, r *linmetric.Registry) *ExploreAPI

NewExploreAPI creates explore api instance.

func (*ExploreAPI) ExploreCurrent

func (d *ExploreAPI) ExploreCurrent(c *gin.Context)

ExploreCurrent explores current node monitoring metric.

func (*ExploreAPI) Register

func (d *ExploreAPI) Register(route gin.IRoutes)

Register adds explore url route.

type FileInfo

type FileInfo struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

FileInfo represents file info include name/size.

type LoggerAPI

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

LoggerAPI represents view log file rest api.

func NewLoggerAPI

func NewLoggerAPI(logDir string) *LoggerAPI

NewLoggerAPI creates log view api instance.

func (*LoggerAPI) List

func (d *LoggerAPI) List(c *gin.Context)

@Summary list log files @Description return all log files in log dir. @Tags State @Accept json @Produce json @Success 200 {object} object @Failure 404 {string} string "not found" @Failure 500 {string} string "internal error" @Router /log/list [get]

func (*LoggerAPI) Register

func (d *LoggerAPI) Register(route gin.IRoutes)

Register adds explore url route.

func (*LoggerAPI) View

func (d *LoggerAPI) View(c *gin.Context)

View tails the log file, return the last n lines. @Summary tail log file @Description return last N lines in log file. @Tags State @Accept json @Produce plain @Success 200 {string} string @Failure 404 {string} string "not found" @Failure 500 {string} string "internal error" @Router /log/view [get]

type RequestAPI

type RequestAPI struct {
}

RequestAPI represents request state related api.

func NewRequestAPI

func NewRequestAPI() *RequestAPI

NewRequestAPI creates a RequestAPI instance.

func (*RequestAPI) GetAllAliveRequests

func (api *RequestAPI) GetAllAliveRequests(c *gin.Context)

GetAllAliveRequests returns all alive request.

func (*RequestAPI) Register

func (api *RequestAPI) Register(route gin.IRoutes)

Register adds request state url route.

Jump to

Keyboard shortcuts

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