Documentation ¶
Index ¶
- Variables
- func CreateDashboardSnapshot(c *contextmodel.ReqContext, cfg dashboardsnapshot.SnapshotSharingOptions, ...)
- func DeleteExternalDashboardSnapshot(externalUrl string) error
- func DeleteWithKey(ctx context.Context, key string, svc Service) error
- type CreateDashboardSnapshotCommand
- type CreateExternalSnapshotResponse
- 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)
- func (_m *MockService) ValidateDashboardExists(_a0 context.Context, _a1 int64, _a2 string) error
- type Service
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrBaseNotFound = errutil.NotFound("dashboardsnapshots.not-found", errutil.WithPublicMessage("Snapshot not found"))
Functions ¶
func CreateDashboardSnapshot ¶
func CreateDashboardSnapshot(c *contextmodel.ReqContext, cfg dashboardsnapshot.SnapshotSharingOptions, cmd CreateDashboardSnapshotCommand, svc Service)
Types ¶
type CreateDashboardSnapshotCommand ¶
type CreateDashboardSnapshotCommand struct { // The "public" fields are defined in this struct while the private/SQL/response params are // defied in the rest of this command dashboardsnapshot.DashboardCreateCommand 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:"-" xorm:"id"` Name string `json:"name"` Key string `json:"key"` OrgID int64 `json:"-" xorm:"org_id"` UserID int64 `json:"-" 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 MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t interface { mock.TestingT Cleanup(func()) }) *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. The first argument is typically a *testing.T value.
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
func (*MockService) ValidateDashboardExists ¶
ValidateDashboardExists provides a mock function with given fields: _a0, _a1, _a2
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) ValidateDashboardExists(context.Context, int64, string) 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) }