routes

package
v0.0.1-rc5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRelicTemporalitySelector

func NewRelicTemporalitySelector(kind view.InstrumentKind) metricdata.Temporality

Types

type GrafanaAlert

type GrafanaAlert struct {
	Status       string                 `json:"status"`
	Labels       map[string]string      `json:"labels"`
	Annotations  map[string]string      `json:"annotations"`
	StartsAt     time.Time              `json:"startsAt"`
	EndsAt       time.Time              `json:"endsAt"`
	GeneratorURL string                 `json:"generatorURL"`
	Fingerprint  string                 `json:"fingerprint"`
	SilenceURL   string                 `json:"silenceURL"`
	DashboardURL string                 `json:"dashboardURL"`
	PanelURL     string                 `json:"panelURL"`
	ValueString  string                 `json:"valueString"`
	Values       map[string]interface{} `json:"values"`
}

type GrafanaBody

type GrafanaBody struct {
	Receiver          string            `json:"receiver"`
	Status            string            `json:"status"`
	Alerts            []GrafanaAlert    `json:"alerts"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	TruncatedAlerts   int               `json:"truncatedAlerts"`
	OrgId             int               `json:"orgId"`
	Title             string            `json:"title"`
	State             string            `json:"state"`
	Message           string            `json:"message"`
}

type Router

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

func New

func New(db *data.Manager, ob []outbound.Sender, logger logrus.FieldLogger, cfg *config.Config) *Router

func (*Router) CreateEscalation

func (r *Router) CreateEscalation(c *gin.Context)

CreateEscalation godoc

@Summary		Create an escalation
@Description	Create an escalation
@Tags			escalations
@Accept			json
@Produce		json
@Success		200	{object}	escalation.Escalation
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/escalations [post]
@Param			escalation	body	escalation.Escalation	true	"escalation"

func (*Router) CreateService

func (r *Router) CreateService(c *gin.Context)

CreateService godoc

@Summary		Create a service
@Description	Create a service
@Tags			services
@Accept			json
@Produce		json
@Success		200	{object}	service.Service
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/services [post]
@Param			service	body	service.Service	true	"service"

func (*Router) CreateTeam

func (r *Router) CreateTeam(c *gin.Context)

CreateTeam godoc

@Summary		Create a team
@Description	Create a team
@Tags			teams
@Accept			json
@Produce		json
@Success		200	{object}	team.Team
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/teams [post]
@Param			team	body	team.Team	true	"team"

func (*Router) CreateUser

func (r *Router) CreateUser(c *gin.Context)

CreateUser godoc

@Summary		Create a user
@Description	Create a user
@Tags			users
@Accept			json
@Produce		json
@Success		200	{object}	user.User
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/users [post]
@Param			user	body	user.User	true	"user"

func (*Router) DeleteEscalation

func (r *Router) DeleteEscalation(c *gin.Context)

DeleteEscalation godoc

@Summary		Delete an existing escalation
@Description	Delete an existing escalation
@Tags			escalations
@Accept			json
@Produce		json
@Success		204
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/escalations/{id} [delete]
@Param			id	path	int	true	"id"

func (*Router) DeleteService

func (r *Router) DeleteService(c *gin.Context)

DeleteService godoc

@Summary		Delete a service
@Description	Delete a service
@Tags			services
@Accept			json
@Produce		json
@Success		204
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/services/{id} [delete]
@Param			id	path	int	true	"id"

func (*Router) DeleteTeam

func (r *Router) DeleteTeam(c *gin.Context)

DeleteTeam godoc

@Summary		Delete a team
@Description	Delete a team
@Tags			teams
@Accept			json
@Produce		json
@Success		204
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/teams/{id} [delete]
@Param			id	path	int	true	"id"

func (*Router) DeleteUser

func (r *Router) DeleteUser(c *gin.Context)

DeleteUser godoc

@Summary		Delete an existing user
@Description	Delete an existing user
@Tags			users
@Accept			json
@Produce		json
@Success		204
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/users/{id} [delete]
@Param			id	path	int	true	"id"

func (*Router) GetAlerts

func (r *Router) GetAlerts(c *gin.Context)

GetAlerts godoc

@Summary		Get all alerts
@Description	Get all alerts
@Tags			alerts
@Accept			json
@Produce		json
@Success		200	{array}		data.Alert
@Failure		500	{object}	data.Error
@Router			/services [get]

func (*Router) GetConfig

func (r *Router) GetConfig(c *gin.Context)

GetConfig godoc

@Summary	Get currently running config
@Schemes
@Description	Get currently running config
@Tags			debug
@Produce		json
@Success		200	{object}	config.Config
@Router			/debug/config [get]

func (*Router) GetEscalation

func (r *Router) GetEscalation(c *gin.Context)

GetEscalation godoc

@Summary		Get an escalation
@Description	Get an escalation
@Tags			escalations
@Accept			json
@Produce		json
@Success		200	{object}	escalation.Escalation
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/escalations/{id} [get]
@Param			id	path	int	true	"id"

func (*Router) GetEscalations

func (r *Router) GetEscalations(c *gin.Context)

GetEscalations godoc

@Summary	Get all escalations
@Schemes
@Description	Get all escalations
@Tags			escalations
@Accept			json
@Produce		json
@Success		200	{array}		escalation.Escalation
@Failure		500	{object}	data.Error
@Router			/escalations [get]

func (*Router) GetService

func (r *Router) GetService(c *gin.Context)

GetService godoc

@Summary		Get a service
@Description	Get a service
@Tags			services
@Accept			json
@Produce		json
@Success		200	{object}	service.Service
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/services/{id} [get]
@Param			id	path	int	true	"id"

func (*Router) GetServices

func (r *Router) GetServices(c *gin.Context)

GetServices godoc

@Summary		Get all services
@Description	Get all services
@Tags			services
@Accept			json
@Produce		json
@Success		200	{array}		service.Service
@Failure		500	{object}	data.Error
@Router			/services [get]

func (*Router) GetTeam

func (r *Router) GetTeam(c *gin.Context)

GetTeam godoc

@Summary		Get a team
@Description	Get a team
@Tags			teams
@Accept			json
@Produce		json
@Success		200	{object}	team.Team
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/teams/{id} [get]
@Param			id	path	int	true	"id"

func (*Router) GetTeams

func (r *Router) GetTeams(c *gin.Context)

GetTeams godoc

@Summary		Get all teams
@Description	Get all teams
@Tags			teams
@Accept			json
@Produce		json
@Success		200	{array}		team.Team
@Failure		500	{object}	data.Error
@Router			/teams [get]

func (*Router) GetUser

func (r *Router) GetUser(c *gin.Context)

GetUser godoc

@Summary		Get a user
@Description	Get a user
@Tags			users
@Accept			json
@Produce		json
@Success		200	{object}	user.User
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/users/{id} [get]
@Param			id	path	int	true	"id"

func (*Router) GetUsers

func (r *Router) GetUsers(c *gin.Context)

GetUsers godoc

@Summary	Get all users
@Schemes
@Description	Get all users
@Tags			users
@Accept			json
@Produce		json
@Success		200	{array}		user.User
@Failure		500	{object}	data.Error
@Router			/users [get]

func (*Router) GrafanaInbound

func (r *Router) GrafanaInbound(c *gin.Context)

GrafanaInbound godoc

@Summary		Send a Grafana alert
@Description	Send a Grafana alert
@Tags			alerts
@Accept			json
@Produce		json
@Success		204
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/alerts/grafana [post]
@Param			alert	body	GrafanaBody	true	"aolert"

func (*Router) SendErr

func (r *Router) SendErr(c *gin.Context, status int, err error, span trace.Span)

func (*Router) SendErrorMessage deprecated

func (r *Router) SendErrorMessage(c *gin.Context, status int, message string)

Deprecated: Please use `SendErr` instead

func (*Router) SendJsonResponse

func (r *Router) SendJsonResponse(c *gin.Context, status int, h interface{}, span trace.Span)

func (*Router) SendNullResponse

func (r *Router) SendNullResponse(c *gin.Context, status int, span trace.Span)

func (*Router) UpdateEscalation

func (r *Router) UpdateEscalation(c *gin.Context)

UpdateEscalation godoc

@Summary		Update an existing escalation
@Description	Create an existing escalation
@Tags			escalations
@Accept			json
@Produce		json
@Success		200	{object}	escalation.Escalation
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/escalations/{id} [put]
@Param			escalation	body	escalation.Escalation	true	"escalation"
@Param			id			path	int						true	"id"

func (*Router) UpdateService

func (r *Router) UpdateService(c *gin.Context)

UpdateService godoc

@Summary		Update a service
@Description	Update a service
@Tags			services
@Accept			json
@Produce		json
@Success		200	{object}	service.Service
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/services/{id} [put]
@Param			service	body	service.Service	true	"service"
@Param			id		path	int				true	"id"

func (*Router) UpdateTeam

func (r *Router) UpdateTeam(c *gin.Context)

UpdateTeam godoc

@Summary		Update a team
@Description	Update a team
@Tags			teams
@Accept			json
@Produce		json
@Success		200	{object}	team.Team
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/services/{id} [put]
@Param			team	body	team.Team	true	"team"
@Param			id		path	int			true	"id"

func (*Router) UpdateUser

func (r *Router) UpdateUser(c *gin.Context)

UpdateUser godoc

@Summary		Update an existing user
@Description	Create an existing user
@Tags			users
@Accept			json
@Produce		json
@Success		200	{object}	user.User
@Failure		400	{object}	data.Error
@Failure		500	{object}	data.Error
@Router			/users/{id} [put]
@Param			user	body	user.User	true	"user"
@Param			id		path	int			true	"id"

Jump to

Keyboard shortcuts

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