router

package
v6.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 63 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BusiGroup

func BusiGroup(ctx *ctx.Context, id int64) *models.BusiGroup

func CaptchaVerify

func CaptchaVerify(id string, value string) bool

验证

func Dangerous

func Dangerous(c *gin.Context, v interface{}, code ...int)

func Dashboard

func Dashboard(ctx *ctx.Context, id int64) *models.Dashboard

func DatasourceCheck

func DatasourceCheck(ds models.Datasource) error

func PromBatchQueryInstant added in v6.6.0

func PromBatchQueryInstant(pc *prom.PromClientMap, f BatchInstantForm) ([]model.Value, error)

func PromBatchQueryRange added in v6.6.0

func PromBatchQueryRange(pc *prom.PromClientMap, f BatchQueryForm) ([]model.Value, error)

func Render

func Render(c *gin.Context, data, msg interface{})

func SmtpValidate added in v6.4.0

func SmtpValidate(text string) (aconf.SMTPConfig, error)

func TaskCreate

func TaskCreate(v interface{}, ibexc aconf.Ibex) (int64, error)

return task.id, error

func User

func User(ctx *ctx.Context, id int64) *models.User

func UserGroup

func UserGroup(ctx *ctx.Context, id int64) *models.UserGroup

func Username

func Username(c *gin.Context) string

Types

type AccessDetails

type AccessDetails struct {
	AccessUuid   string
	UserIdentity string
}

type AlertCard

type AlertCard struct {
	Title    string  `json:"title"`
	Total    int     `json:"total"`
	EventIds []int64 `json:"event_ids"`
	Severity int     `json:"severity"`
}

type AlertCate

type AlertCate struct {
	Name       string             `json:"name"`
	IconUrl    string             `json:"icon_url"`
	AlertRules []models.AlertRule `json:"alert_rules"`
	Favorite   bool               `json:"favorite"`
}

type BatchInstantForm added in v6.6.0

type BatchInstantForm struct {
	DatasourceId int64             `json:"datasource_id" binding:"required"`
	Queries      []InstantFormItem `json:"queries" binding:"required"`
}

type BatchQueryForm added in v6.6.0

type BatchQueryForm struct {
	DatasourceId int64           `json:"datasource_id" binding:"required"`
	Queries      []QueryFormItem `json:"queries" binding:"required"`
}

type BoardCate

type BoardCate struct {
	Name     string    `json:"name"`
	IconUrl  string    `json:"icon_url"`
	Boards   []Payload `json:"boards"`
	Favorite bool      `json:"favorite"`
}

type CallbackOutput

type CallbackOutput struct {
	Redirect     string       `json:"redirect"`
	User         *models.User `json:"user"`
	AccessToken  string       `json:"access_token"`
	RefreshToken string       `json:"refresh_token"`
}

type CaptchaRedisStore

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

func (*CaptchaRedisStore) Get

func (s *CaptchaRedisStore) Get(id string, clear bool) string

func (*CaptchaRedisStore) Set

func (s *CaptchaRedisStore) Set(id string, value string) error

func (*CaptchaRedisStore) Verify

func (s *CaptchaRedisStore) Verify(id, answer string, clear bool) bool

type CaptchaReqBody

type CaptchaReqBody struct {
	Id          string
	VerifyValue string
}

type ChartGroupPure

type ChartGroupPure struct {
	Name   string      `json:"name"`
	Weight int         `json:"weight"`
	Charts []ChartPure `json:"charts"`
}

type ChartPure

type ChartPure struct {
	Configs string `json:"configs"`
	Weight  int    `json:"weight"`
}

type DashboardPure

type DashboardPure struct {
	Name        string           `json:"name"`
	Tags        string           `json:"tags"`
	Configs     string           `json:"configs"`
	ChartGroups []ChartGroupPure `json:"chart_groups"`
}

type DoneIdsReply

type DoneIdsReply struct {
	Err string `json:"err"`
	Dat struct {
		List []int64 `json:"list"`
	} `json:"dat"`
}

type InstantFormItem

type InstantFormItem struct {
	Time  int64  `json:"time" binding:"required"`
	Query string `json:"query" binding:"required"`
}

type Payload

type Payload struct {
	Cate    string      `json:"cate"`
	Fname   string      `json:"fname"`
	Name    string      `json:"name"`
	Configs interface{} `json:"configs"`
	Tags    string      `json:"tags"`
}

type QueryFormItem added in v6.6.0

type QueryFormItem struct {
	Start int64  `json:"start" binding:"required"`
	End   int64  `json:"end" binding:"required"`
	Step  int64  `json:"step" binding:"required"`
	Query string `json:"query" binding:"required"`
}

type RSAConfigOutput

type RSAConfigOutput struct {
	OpenRSA      bool
	RSAPublicKey string
}

type RedirectOutput

type RedirectOutput struct {
	Redirect string `json:"redirect"`
	State    string `json:"state"`
}

type Router

type Router struct {
	HTTP              httpx.Config
	Center            cconf.Center
	Operations        cconf.Operation
	DatasourceCache   *memsto.DatasourceCacheType
	NotifyConfigCache *memsto.NotifyConfigCacheType
	PromClients       *prom.PromClientMap
	TdendgineClients  *tdengine.TdengineClientMap
	Redis             storage.Redis
	MetaSet           *metas.Set
	IdentSet          *idents.Set
	TargetCache       *memsto.TargetCacheType
	Sso               *sso.SsoClient
	UserCache         *memsto.UserCacheType
	UserGroupCache    *memsto.UserGroupCacheType
	Ctx               *ctx.Context
}

func (*Router) Board

func (rt *Router) Board(id int64) *models.Board

func (*Router) Config

func (rt *Router) Config(r *gin.Engine)

func (*Router) QueryData added in v6.2.0

func (rt *Router) QueryData(c *gin.Context)

func (*Router) QueryLog added in v6.2.0

func (rt *Router) QueryLog(c *gin.Context)

func (*Router) QuerySqlTemplate added in v6.2.0

func (rt *Router) QuerySqlTemplate(c *gin.Context)

query sql template

type SsoConfigOutput

type SsoConfigOutput struct {
	OidcDisplayName  string `json:"oidcDisplayName"`
	CasDisplayName   string `json:"casDisplayName"`
	OauthDisplayName string `json:"oauthDisplayName"`
}

type TargetQuery

type TargetQuery struct {
	Filters []models.HostQuery `json:"queries"`
	P       int                `json:"p"`
	Limit   int                `json:"limit"`
}

type TaskCreateReply

type TaskCreateReply struct {
	Err string `json:"err"`
	Dat int64  `json:"dat"` // task.id
}

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	AccessUuid   string
	RefreshUuid  string
	AtExpires    int64
	RtExpires    int64
}

Jump to

Keyboard shortcuts

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