annotations

package
v4.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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:"categoryId"`
	RegionId    int64    `json:"regionId"`
	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:"to"`
	Type        ItemType `json:"type"`
	AlertId     int64    `json:"alertId"`
	DashboardId int64    `json:"dashboardId"`
	PanelId     int64    `json:"panelId"`
	NewState    []string `json:"newState"`

	Limit int64 `json:"limit"`
}

type ItemType

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

type PostParams

type PostParams struct {
	DashboardId int64  `json:"dashboardId"`
	PanelId     int64  `json:"panelId"`
	Epoch       int64  `json:"epoch"`
	Title       string `json:"title"`
	Text        string `json:"text"`
}

type Repository

type Repository interface {
	Save(item *Item) error
	Update(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