router

package
v6.0.0-ga.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 52 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultIbex = `
Address = "http://127.0.0.1:10090"
BasicAuthUser = "ibex"
BasicAuthPass = "ibex"
Timeout = 3000
`
View Source
const DefaultSMTP = `
Host = ""
Port = 994
User = "username"
Pass = "password"
From = "username@163.com"
InsecureSkipVerify = true
Batch = 5
`

Variables

This section is empty.

Functions

func BusiGroup

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

func Dangerous

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

func Dashboard

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

func DatasourceUrlIsAvail

func DatasourceUrlIsAvail(ds models.Datasource) bool

func Render

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

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 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 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 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
	Redis             storage.Redis
	MetaSet           *metas.Set
	Sso               *sso.SsoClient
	Ctx               *ctx.Context
}

func New

func New(httpConfig httpx.Config, center cconf.Center, operations cconf.Operation, ds *memsto.DatasourceCacheType, ncc *memsto.NotifyConfigCacheType,
	pc *prom.PromClientMap, redis storage.Redis, sso *sso.SsoClient, ctx *ctx.Context, metaSet *metas.Set) *Router

func (*Router) Board

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

func (*Router) Config

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

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