dto

package
v2.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 9 Imported by: 6

Documentation

Overview

nolint

nolint

nolint

nolint

nolint

nolint

nolint

nolint

nolint

Index

Constants

View Source
const (
	ErrorMessage = "" /* 168-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Type  string `json:"type"`
	Value string `json:"value"`
	ID    string `json:"id,omitempty"`
	User  string `json:"user,omitempty"`
}

func (*Contact) Bind

func (contact *Contact) Bind(r *http.Request) error

func (*Contact) Render

func (*Contact) Render(w http.ResponseWriter, r *http.Request) error

type ContactList

type ContactList struct {
	List []*moira.ContactData `json:"list"`
}

func (*ContactList) Render

type ErrProvidedContactsForbidden

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

ErrProvidedContactsForbidden used when user try to save subscription with another users contacts

func (ErrProvidedContactsForbidden) Error

Error is implementation of golang error interface for ErrProvidedContactsForbidden struct

type EventsList

type EventsList struct {
	Page  int64                     `json:"page"`
	Size  int64                     `json:"size"`
	Total int64                     `json:"total"`
	List  []moira.NotificationEvent `json:"list"`
}

func (*EventsList) Render

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

func (*MessageResponse) Render

type MetricsMaintenance

type MetricsMaintenance map[string]int64

func (*MetricsMaintenance) Bind

type NotificationDeleteResponse

type NotificationDeleteResponse struct {
	Result int64 `json:"result"`
}

func (*NotificationDeleteResponse) Render

type NotificationsList

type NotificationsList struct {
	Total int64                          `json:"total"`
	List  []*moira.ScheduledNotification `json:"list"`
}

func (*NotificationsList) Render

type NotifierState

type NotifierState struct {
	State   string `json:"state"`
	Message string `json:"message,omitempty"`
}

func (*NotifierState) Bind

func (state *NotifierState) Bind(r *http.Request) error

func (*NotifierState) Render

type PatternData

type PatternData struct {
	Metrics  []string       `json:"metrics"`
	Pattern  string         `json:"pattern"`
	Triggers []TriggerModel `json:"triggers"`
}

type PatternList

type PatternList struct {
	List []PatternData `json:"list"`
}

func (*PatternList) Render

type SaveTriggerResponse

type SaveTriggerResponse struct {
	ID      string `json:"id"`
	Message string `json:"message"`
}

func (*SaveTriggerResponse) Render

type Subscription

type Subscription moira.SubscriptionData

func (*Subscription) Bind

func (subscription *Subscription) Bind(request *http.Request) error

func (*Subscription) Render

type SubscriptionList

type SubscriptionList struct {
	List []moira.SubscriptionData `json:"list"`
}

func (*SubscriptionList) Render

type TagStatistics

type TagStatistics struct {
	TagName       string                   `json:"name"`
	Triggers      []string                 `json:"triggers"`
	Subscriptions []moira.SubscriptionData `json:"subscriptions"`
}

type TagsData

type TagsData struct {
	TagNames []string `json:"list"`
}

func (*TagsData) Render

func (*TagsData) Render(w http.ResponseWriter, r *http.Request) error

type TagsStatistics

type TagsStatistics struct {
	List []TagStatistics `json:"list"`
}

func (*TagsStatistics) Render

type ThrottlingResponse

type ThrottlingResponse struct {
	Throttling int64 `json:"throttling"`
}

func (*ThrottlingResponse) Render

type Trigger

type Trigger struct {
	TriggerModel
	Throttling int64 `json:"throttling"`
}

func (*Trigger) Bind

func (trigger *Trigger) Bind(request *http.Request) error

func (*Trigger) Render

func (*Trigger) Render(w http.ResponseWriter, r *http.Request) error

type TriggerCheck

type TriggerCheck struct {
	*moira.CheckData
	TriggerID string `json:"trigger_id"`
}

func (*TriggerCheck) Render

type TriggerMaintenance

type TriggerMaintenance struct {
	Trigger *int64           `json:"trigger"`
	Metrics map[string]int64 `json:"metrics"`
}

func (*TriggerMaintenance) Bind

type TriggerMetrics

type TriggerMetrics struct {
	Main       map[string][]*moira.MetricValue `json:"main"`
	Additional map[string][]*moira.MetricValue `json:"additional,omitempty"`
}

func (*TriggerMetrics) Render

type TriggerModel

type TriggerModel struct {
	// Trigger unique ID
	ID string `json:"id"`
	// Trigger name
	Name string `json:"name"`
	// Description string
	Desc *string `json:"desc,omitempty"`
	// Graphite-like targets: t1, t2, ...
	Targets []string `json:"targets"`
	// WARN threshold
	WarnValue *float64 `json:"warn_value"`
	// ERROR threshold
	ErrorValue *float64 `json:"error_value"`
	// Could be: rising, falling, expression
	TriggerType string `json:"trigger_type"`
	// Set of tags to manipulate subscriptions
	Tags []string `json:"tags"`
	// When there are no metrics for trigger, Moira will switch metric to TTLState state after TTL seconds
	TTLState *moira.TTLState `json:"ttl_state,omitempty"`
	// When there are no metrics for trigger, Moira will switch metric to TTLState state after TTL seconds
	TTL int64 `json:"ttl,omitempty"`
	// Determines when Moira should monitor trigger
	Schedule *moira.ScheduleData `json:"sched,omitempty"`
	// Used if you need more complex logic than provided by WARN/ERROR values
	Expression string `json:"expression"`
	// Graphite patterns for trigger
	Patterns []string `json:"patterns"`
	// Shows if trigger is remote (graphite-backend) based or stored inside Moira-Redis DB
	IsRemote bool `json:"is_remote"`
	// If true, first event NODATA → OK will be omitted
	MuteNewMetrics bool `json:"mute_new_metrics"`
}

TriggerModel is moira.Trigger api representation

func CreateTriggerModel

func CreateTriggerModel(trigger *moira.Trigger) TriggerModel

CreateTriggerModel transforms moira.Trigger to TriggerModel

func (*TriggerModel) ToMoiraTrigger

func (model *TriggerModel) ToMoiraTrigger() *moira.Trigger

ToMoiraTrigger transforms TriggerModel to moira.Trigger

type TriggersList

type TriggersList struct {
	Page  *int64               `json:"page,omitempty"`
	Size  *int64               `json:"size,omitempty"`
	Total *int64               `json:"total,omitempty"`
	List  []moira.TriggerCheck `json:"list"`
}

func (*TriggersList) Render

type User

type User struct {
	Login string `json:"login"`
}

func (*User) Render

func (*User) Render(w http.ResponseWriter, r *http.Request) error

type UserSettings

type UserSettings struct {
	User
	Contacts      []moira.ContactData      `json:"contacts"`
	Subscriptions []moira.SubscriptionData `json:"subscriptions"`
}

func (*UserSettings) Render

Jump to

Keyboard shortcuts

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