github.com/influxdata/influxdb/v2@v2.7.6/operation_log.go (about)

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