api

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AuthSecretSettingName = "auth_secret"
	HashFunc              = crypto.SHA256
	SessionCookieName     = "coroot_session"
	SessionCookieTTL      = 7 * 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(cache *cache.Cache, db *db.DB, collector *collector.Collector, pricing *pricing.Manager, roles rbac.RoleManager,
	globalClickHouse *db.IntegrationClickhouse, globalPrometheus *db.IntegrationsPrometheus) *Api

func (*Api) Application added in v1.5.0

func (api *Api) Application(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Auth added in v1.5.0

func (api *Api) Auth(h func(http.ResponseWriter, *http.Request, *db.User)) http.HandlerFunc

func (*Api) AuthInit added in v1.5.0

func (api *Api) AuthInit(anonymousRole string, adminPassword string) error

func (*Api) Categories

func (api *Api) Categories(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) CustomApplications added in v1.4.0

func (api *Api) CustomApplications(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) GetUser added in v1.5.6

func (api *Api) GetUser(r *http.Request) *db.User

func (*Api) Incident added in v1.5.0

func (api *Api) Incident(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Inspection added in v1.5.0

func (api *Api) Inspection(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Inspections added in v1.5.0

func (api *Api) Inspections(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Instrumentation added in v1.3.0

func (api *Api) Instrumentation(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Integration

func (api *Api) Integration(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Integrations

func (api *Api) Integrations(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) IsAllowed added in v1.5.0

func (api *Api) IsAllowed(u *db.User, action rbac.Action) bool

func (*Api) LoadWorld added in v1.5.0

func (api *Api) LoadWorld(ctx context.Context, project *db.Project, from, to timeseries.Time) (*model.World, *cache.Status, error)

func (*Api) LoadWorldByRequest added in v1.5.0

func (api *Api) LoadWorldByRequest(r *http.Request) (*model.World, *db.Project, *cache.Status, error)

func (*Api) Login added in v1.5.0

func (api *Api) Login(w http.ResponseWriter, r *http.Request)

func (*Api) Logout added in v1.5.0

func (api *Api) Logout(w http.ResponseWriter, r *http.Request)

func (*Api) Logs added in v0.20.0

func (api *Api) Logs(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Node

func (api *Api) Node(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Overview

func (api *Api) Overview(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Profiling added in v1.5.0

func (api *Api) Profiling(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Project

func (api *Api) Project(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Prom

func (api *Api) Prom(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) RCA added in v1.5.0

func (api *Api) RCA(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Roles added in v1.5.0

func (api *Api) Roles(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) SSO added in v1.5.6

func (api *Api) SSO(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) SetSessionCookie added in v1.5.6

func (api *Api) SetSessionCookie(w http.ResponseWriter, userId int, ttl time.Duration) error

func (*Api) Status

func (api *Api) Status(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Tracing

func (api *Api) Tracing(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) User added in v1.5.0

func (api *Api) User(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) Users added in v1.5.0

func (api *Api) Users(w http.ResponseWriter, r *http.Request, u *db.User)

func (*Api) WithContext added in v1.6.0

func (api *Api) WithContext(p *db.Project, cacheStatus *cache.Status, w *model.World, data any) DataWithContext

type Application added in v0.22.0

type Application struct {
	Id     model.ApplicationId `json:"id"`
	Status model.Status        `json:"status"`
}

type Context added in v0.22.0

type Context struct {
	Status Status `json:"status"`
	Search Search `json:"search"`
}

type DataWithContext added in v1.5.0

type DataWithContext struct {
	Context Context `json:"context"`
	Data    any     `json:"data"`
}

type KubeStateMetrics added in v0.22.0

type KubeStateMetrics struct {
	Status       model.Status `json:"status"`
	Applications int          `json:"applications"`
}

type Node added in v0.22.0

type Node struct {
	Name   string       `json:"name"`
	Status model.Status `json:"status"`
}

type NodeAgent added in v0.22.0

type NodeAgent struct {
	Status model.Status `json:"status"`
	Nodes  int          `json:"nodes"`
}

type Prometheus added in v0.22.0

type Prometheus struct {
	Status  model.Status `json:"status"`
	Message string       `json:"message"`
	Error   string       `json:"error"`
	Action  string       `json:"action"`
}
type Search struct {
	Applications []Application `json:"applications"`
	Nodes        []Node        `json:"nodes"`
}

type Session added in v1.5.0

type Session struct {
	Id int `json:"id"`
}

type Status added in v0.22.0

type Status struct {
	Status           model.Status      `json:"status"`
	Error            string            `json:"error"`
	Prometheus       Prometheus        `json:"prometheus"`
	NodeAgent        NodeAgent         `json:"node_agent"`
	KubeStateMetrics *KubeStateMetrics `json:"kube_state_metrics"`
}

Jump to

Keyboard shortcuts

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