api

package
v1.7.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPrefix defines a prefix string for fault-trigger api
	APIPrefix = "/pingcap.com/api/v1"
)

Variables

This section is empty.

Functions

func ExtractResponse

func ExtractResponse(data []byte) ([]byte, error)

ExtractResponse extract response from api

Types

type Response

type Response struct {
	Action     string      `json:"action"`
	StatusCode int         `json:"status_code"`
	Message    string      `json:"message,omitempty"`
	Payload    interface{} `json:"payload,omitempty"`
}

Response defines a new response struct for http

type Server

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

Server is a web service to control fault trigger

func NewServer

func NewServer(mgr *manager.Manager, port int) *Server

NewServer returns a api server

func (*Server) StartServer

func (s *Server) StartServer()

StartServer starts a fault-trigger server

Jump to

Keyboard shortcuts

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