forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
operation_log.go
43 lines (36 loc) · 1.76 KB
/
operation_log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package influxdb
import (
"context"
"time"
)
// OperationLogEntry is a record in an operation log.
type OperationLogEntry struct {
Description string `json:"description"`
UserID ID `json:"userID,omitempty"`
Time time.Time `json:"time,omitempty"`
}
// DashboardOperationLogService is an interface for retrieving the operation log for a dashboard.
type DashboardOperationLogService interface {
// GetDashboardOperationLog retrieves the operation log for the dashboard with the provided id.
GetDashboardOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}
// BucketOperationLogService is an interface for retrieving the operation log for a bucket.
type BucketOperationLogService interface {
// GetBucketOperationLog retrieves the operation log for the bucket with the provided id.
GetBucketOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}
// UserOperationLogService is an interface for retrieving the operation log for a user.
type UserOperationLogService interface {
// GetUserOperationLog retrieves the operation log for the user with the provided id.
GetUserOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}
// OrganizationOperationLogService is an interface for retrieving the operation log for an org.
type OrganizationOperationLogService interface {
// GetOrganizationOperationLog retrieves the operation log for the org with the provided id.
GetOrganizationOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}
// DefaultOperationLogFindOptions are the default options for the operation log.
var DefaultOperationLogFindOptions = FindOptions{
Descending: true,
Limit: 100,
}