annotations

package
v4.1.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 1 Imported by: 411

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRepository

func SetRepository(rep Repository)

Types

type DeleteParams

type DeleteParams struct {
	AlertId     int64 `json:"alertId"`
	DashboardId int64 `json:"dashboardId"`
	PanelId     int64 `json:"panelId"`
}

type Item

type Item struct {
	Id          int64    `json:"id"`
	OrgId       int64    `json:"orgId"`
	DashboardId int64    `json:"dashboardId"`
	PanelId     int64    `json:"panelId"`
	CategoryId  int64    `json:"panelId"`
	Type        ItemType `json:"type"`
	Title       string   `json:"title"`
	Text        string   `json:"text"`
	Metric      string   `json:"metric"`
	AlertId     int64    `json:"alertId"`
	UserId      int64    `json:"userId"`
	PrevState   string   `json:"prevState"`
	NewState    string   `json:"newState"`
	Epoch       int64    `json:"epoch"`

	Data *simplejson.Json `json:"data"`
}

type ItemQuery

type ItemQuery struct {
	OrgId       int64    `json:"orgId"`
	From        int64    `json:"from"`
	To          int64    `json:"from"`
	Type        ItemType `json:"type"`
	AlertId     int64    `json:"alertId"`
	DashboardId int64    `json:"dashboardId"`
	PanelId     int64    `json:"panelId"`
	NewState    []string `json:"newState"`

	Limit int64 `json:"alertId"`
}

type ItemType

type ItemType string
const (
	AlertType ItemType = "alert"
)

type Repository

type Repository interface {
	Save(item *Item) error
	Find(query *ItemQuery) ([]*Item, error)
	Delete(params *DeleteParams) error
}

func GetRepository

func GetRepository() Repository

Jump to

Keyboard shortcuts

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