Documentation ¶
Index ¶
- Constants
- Variables
- type Cleaner
- type DeleteParams
- type FakeAnnotationsRepo
- func (_m *FakeAnnotationsRepo) Delete(ctx context.Context, params *DeleteParams) error
- func (_m *FakeAnnotationsRepo) Find(ctx context.Context, query *ItemQuery) ([]*ItemDTO, error)
- func (_m *FakeAnnotationsRepo) FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error)
- func (_m *FakeAnnotationsRepo) Save(ctx context.Context, item *Item) error
- func (_m *FakeAnnotationsRepo) SaveMany(ctx context.Context, items []Item) error
- func (_m *FakeAnnotationsRepo) Update(ctx context.Context, item *Item) error
- type FindTagsResult
- type GetAnnotationTagsResponse
- type Item
- type ItemDTO
- type ItemQuery
- type Repository
- type Tag
- type TagsDTO
- type TagsQuery
Constants ¶
View Source
const ( Organization annotationType = iota Dashboard )
Variables ¶
View Source
var ( ErrTimerangeMissing = errors.New("missing timerange") ErrBaseTagLimitExceeded = errutil.NewBase(errutil.StatusBadRequest, "annotations.tag-limit-exceeded", errutil.WithPublicMessage("Tags length exceeds the maximum allowed.")) )
Functions ¶
This section is empty.
Types ¶
type DeleteParams ¶
type FakeAnnotationsRepo ¶
FakeAnnotationsRepo is an autogenerated mock type for the Repository type
func NewFakeAnnotationsRepo ¶
func NewFakeAnnotationsRepo(t testing.TB) *FakeAnnotationsRepo
NewFakeAnnotationsRepo creates a new instance of FakeAnnotationsRepo. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func (*FakeAnnotationsRepo) Delete ¶
func (_m *FakeAnnotationsRepo) Delete(ctx context.Context, params *DeleteParams) error
Delete provides a mock function with given fields: ctx, params
func (*FakeAnnotationsRepo) FindTags ¶
func (_m *FakeAnnotationsRepo) FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error)
FindTags provides a mock function with given fields: ctx, query
func (*FakeAnnotationsRepo) Save ¶
func (_m *FakeAnnotationsRepo) Save(ctx context.Context, item *Item) error
Save provides a mock function with given fields: ctx, item
type FindTagsResult ¶
type FindTagsResult struct {
Tags []*TagsDTO `json:"tags"`
}
FindTagsResult is the result of a tags search.
type GetAnnotationTagsResponse ¶
type GetAnnotationTagsResponse struct {
Result FindTagsResult `json:"result"`
}
GetAnnotationTagsResponse is a response struct for FindTagsResult.
type Item ¶
type Item struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` OrgID int64 `json:"orgId" xorm:"org_id"` UserID int64 `json:"userId" xorm:"user_id"` DashboardID int64 `json:"dashboardId" xorm:"dashboard_id"` PanelID int64 `json:"panelId" xorm:"panel_id"` Text string `json:"text"` AlertID int64 `json:"alertId" xorm:"alert_id"` PrevState string `json:"prevState"` NewState string `json:"newState"` Epoch int64 `json:"epoch"` EpochEnd int64 `json:"epochEnd"` Created int64 `json:"created"` Updated int64 `json:"updated"` Tags []string `json:"tags"` Data *simplejson.Json `json:"data"` // needed until we remove it from db Type string Title string }
type ItemDTO ¶
type ItemDTO struct { ID int64 `json:"id" xorm:"id"` AlertID int64 `json:"alertId" xorm:"alert_id"` AlertName string `json:"alertName"` DashboardID int64 `json:"dashboardId" xorm:"dashboard_id"` DashboardUID *string `json:"dashboardUID" xorm:"dashboard_uid"` PanelID int64 `json:"panelId" xorm:"panel_id"` UserID int64 `json:"userId" xorm:"user_id"` NewState string `json:"newState"` PrevState string `json:"prevState"` Created int64 `json:"created"` Updated int64 `json:"updated"` Time int64 `json:"time"` TimeEnd int64 `json:"timeEnd"` Text string `json:"text"` Tags []string `json:"tags"` Login string `json:"login"` Email string `json:"email"` AvatarURL string `json:"avatarUrl" xorm:"avatar_url"` Data *simplejson.Json `json:"data"` }
type ItemQuery ¶
type ItemQuery struct { OrgID int64 `json:"orgId"` From int64 `json:"from"` To int64 `json:"to"` UserID int64 `json:"userId"` AlertID int64 `json:"alertId"` DashboardID int64 `json:"dashboardId"` DashboardUID string `json:"dashboardUID"` PanelID int64 `json:"panelId"` AnnotationID int64 `json:"annotationId"` Tags []string `json:"tags"` Type string `json:"type"` MatchAny bool `json:"matchAny"` SignedInUser *user.SignedInUser Limit int64 `json:"limit"` }
type Repository ¶
type Repository interface { Save(ctx context.Context, item *Item) error SaveMany(ctx context.Context, items []Item) error Update(ctx context.Context, item *Item) error Find(ctx context.Context, query *ItemQuery) ([]*ItemDTO, error) Delete(ctx context.Context, params *DeleteParams) error FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error) }
Click to show internal directories.
Click to hide internal directories.