rest

package
v3.0.0-...-7237cd1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserKey     = "user"
	PasswordKey = "password"
)
View Source
const MAXSQLLength = 1024 * 1024 * 1
View Source
const StartTimeKey = "st"

Variables

View Source
var (
	ExecHeader        = []byte(`{"code":0,"column_meta":[["affected_rows","INT",4]],"data":[[`)
	ExecEnd           = []byte(`]],"rows":1}`)
	ExecEndWithTiming = []byte(`]],"rows":1,"timing":`)
	Query2            = []byte(`{"code":0,"column_meta":[`)
	Query3            = []byte(`],"data":[`)
	Query4            = []byte(`],"rows":`)
	Timing            = []byte(`,"timing":`)
)

Functions

func BadRequestResponse

func BadRequestResponse(c *gin.Context, code int)

func BadRequestResponseWithMsg

func BadRequestResponseWithMsg(c *gin.Context, code int, msg string)

func CheckAuth

func CheckAuth(c *gin.Context)

func CommonErrorResponse

func CommonErrorResponse(c *gin.Context, msg string)

func DecodeDes

func DecodeDes(auth string) (user, password string, err error)

func DoQuery

func DoQuery(c *gin.Context, db string, timeFunc ctools.FormatTimeFunc, reqID int64)

func EncodeDes

func EncodeDes(user, password string) (string, error)

func ForbiddenResponse

func ForbiddenResponse(c *gin.Context, msg string)

func TaosErrorResponse

func TaosErrorResponse(c *gin.Context, code int, msg string)

func UnAuthResponse

func UnAuthResponse(c *gin.Context, code int)

Types

type Message

type Message struct {
	Code int    `json:"code"`
	Desc string `json:"desc"`
}

type MessageWithTiming

type MessageWithTiming struct {
	Code   int    `json:"code"`
	Desc   string `json:"desc"`
	Timing int64  `json:"timing"`
}

type Restful

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

func (*Restful) Close

func (ctl *Restful) Close()

func (*Restful) Init

func (ctl *Restful) Init(r gin.IRouter)

type TDEngineRestfulResp

type TDEngineRestfulResp struct {
	Code       int              `json:"code,omitempty"`
	Desc       string           `json:"desc,omitempty"`
	ColumnMeta [][]interface{}  `json:"column_meta,omitempty"`
	Data       [][]driver.Value `json:"data,omitempty"`
	Rows       int              `json:"rows,omitempty"`
}

type TDEngineRestfulRespDoc

type TDEngineRestfulRespDoc struct {
	Code       int             `json:"code,omitempty"`
	Desc       string          `json:"desc,omitempty"`
	ColumnMeta [][]interface{} `json:"column_meta,omitempty"`
	Data       [][]interface{} `json:"data,omitempty"`
	Rows       int             `json:"rows,omitempty"`
}

Jump to

Keyboard shortcuts

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