Documentation ¶
Index ¶
- Variables
- type CreateDashboardSnapshotCommand
- type DashboardSnapshot
- type DashboardSnapshotDTO
- type DashboardSnapshotsList
- type DeleteDashboardSnapshotCommand
- type DeleteExpiredSnapshotsCommand
- type GetDashboardSnapshotQuery
- type GetDashboardSnapshotsQuery
- type MockService
- func (_m *MockService) CreateDashboardSnapshot(_a0 context.Context, _a1 *CreateDashboardSnapshotCommand) (*DashboardSnapshot, error)
- func (_m *MockService) DeleteDashboardSnapshot(_a0 context.Context, _a1 *DeleteDashboardSnapshotCommand) error
- func (_m *MockService) DeleteExpiredSnapshots(_a0 context.Context, _a1 *DeleteExpiredSnapshotsCommand) error
- func (_m *MockService) GetDashboardSnapshot(_a0 context.Context, _a1 *GetDashboardSnapshotQuery) (*DashboardSnapshot, error)
- func (_m *MockService) SearchDashboardSnapshots(_a0 context.Context, _a1 *GetDashboardSnapshotsQuery) (DashboardSnapshotsList, error)
- type Service
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrBaseNotFound = errutil.NewBase(errutil.StatusNotFound, "dashboardsnapshots.not-found", errutil.WithPublicMessage("Snapshot not found"))
Functions ¶
This section is empty.
Types ¶
type CreateDashboardSnapshotCommand ¶
type CreateDashboardSnapshotCommand struct { // The complete dashboard model. // required:true Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` // Snapshot name // required:false Name string `json:"name"` // When the snapshot should expire in seconds in seconds. Default is never to expire. // required:false // default:0 Expires int64 `json:"expires"` // these are passed when storing an external snapshot ref // Save the snapshot on an external server rather than locally. // required:false // default: false External bool `json:"external"` ExternalURL string `json:"-"` ExternalDeleteURL string `json:"-"` // Define the unique key. Required if `external` is `true`. // required:false Key string `json:"key"` // Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`. // required:false DeleteKey string `json:"deleteKey"` OrgID int64 `json:"-"` UserID int64 `json:"-"` DashboardEncrypted []byte `json:"-"` }
swagger:model
type DashboardSnapshot ¶
type DashboardSnapshot struct { ID int64 `xorm:"pk autoincr 'id'"` Name string Key string DeleteKey string OrgID int64 `xorm:"org_id"` UserID int64 `xorm:"user_id"` External bool ExternalURL string `xorm:"external_url"` ExternalDeleteURL string `xorm:"external_delete_url"` Expires time.Time Created time.Time Updated time.Time Dashboard *simplejson.Json DashboardEncrypted []byte }
DashboardSnapshot model
type DashboardSnapshotDTO ¶
type DashboardSnapshotDTO struct { ID int64 `json:"id" xorm:"id"` Name string `json:"name"` Key string `json:"key"` OrgID int64 `json:"orgId" xorm:"org_id"` UserID int64 `json:"userId" xorm:"user_id"` External bool `json:"external"` ExternalURL string `json:"externalUrl" xorm:"external_url"` Expires time.Time `json:"expires"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
DashboardSnapshotDTO without dashboard map
type DashboardSnapshotsList ¶
type DashboardSnapshotsList []*DashboardSnapshotDTO
type DeleteDashboardSnapshotCommand ¶
type DeleteDashboardSnapshotCommand struct {
DeleteKey string `json:"-"`
}
type DeleteExpiredSnapshotsCommand ¶
type DeleteExpiredSnapshotsCommand struct {
DeletedRows int64
}
type GetDashboardSnapshotsQuery ¶
type GetDashboardSnapshotsQuery struct { Name string Limit int OrgID int64 SignedInUser *user.SignedInUser }
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t mockConstructorTestingTNewMockService) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockService) CreateDashboardSnapshot ¶
func (_m *MockService) CreateDashboardSnapshot(_a0 context.Context, _a1 *CreateDashboardSnapshotCommand) (*DashboardSnapshot, error)
CreateDashboardSnapshot provides a mock function with given fields: _a0, _a1
func (*MockService) DeleteDashboardSnapshot ¶
func (_m *MockService) DeleteDashboardSnapshot(_a0 context.Context, _a1 *DeleteDashboardSnapshotCommand) error
DeleteDashboardSnapshot provides a mock function with given fields: _a0, _a1
func (*MockService) DeleteExpiredSnapshots ¶
func (_m *MockService) DeleteExpiredSnapshots(_a0 context.Context, _a1 *DeleteExpiredSnapshotsCommand) error
DeleteExpiredSnapshots provides a mock function with given fields: _a0, _a1
func (*MockService) GetDashboardSnapshot ¶
func (_m *MockService) GetDashboardSnapshot(_a0 context.Context, _a1 *GetDashboardSnapshotQuery) (*DashboardSnapshot, error)
GetDashboardSnapshot provides a mock function with given fields: _a0, _a1
func (*MockService) SearchDashboardSnapshots ¶
func (_m *MockService) SearchDashboardSnapshots(_a0 context.Context, _a1 *GetDashboardSnapshotsQuery) (DashboardSnapshotsList, error)
SearchDashboardSnapshots provides a mock function with given fields: _a0, _a1
type Service ¶
type Service interface { CreateDashboardSnapshot(context.Context, *CreateDashboardSnapshotCommand) (*DashboardSnapshot, error) DeleteDashboardSnapshot(context.Context, *DeleteDashboardSnapshotCommand) error DeleteExpiredSnapshots(context.Context, *DeleteExpiredSnapshotsCommand) error GetDashboardSnapshot(context.Context, *GetDashboardSnapshotQuery) (*DashboardSnapshot, error) SearchDashboardSnapshots(context.Context, *GetDashboardSnapshotsQuery) (DashboardSnapshotsList, error) }
type Store ¶
type Store interface { CreateDashboardSnapshot(context.Context, *CreateDashboardSnapshotCommand) (*DashboardSnapshot, error) DeleteDashboardSnapshot(context.Context, *DeleteDashboardSnapshotCommand) error DeleteExpiredSnapshots(context.Context, *DeleteExpiredSnapshotsCommand) error GetDashboardSnapshot(context.Context, *GetDashboardSnapshotQuery) (*DashboardSnapshot, error) SearchDashboardSnapshots(context.Context, *GetDashboardSnapshotsQuery) (DashboardSnapshotsList, error) }