Documentation ¶
Index ¶
- Constants
- func NewNats() (nats.Publisher, nats.Subscriber)
- func SetIDForFunc(gen *influxdb.IDGenerator, id influxdb.ID, fn func())
- type AuthorizationService
- func (s *AuthorizationService) CreateAuthorization(ctx context.Context, authorization *platform.Authorization) error
- func (s *AuthorizationService) DeleteAuthorization(ctx context.Context, id platform.ID) error
- func (s *AuthorizationService) FindAuthorizationByID(ctx context.Context, id platform.ID) (*platform.Authorization, error)
- func (s *AuthorizationService) FindAuthorizationByToken(ctx context.Context, t string) (*platform.Authorization, error)
- func (s *AuthorizationService) FindAuthorizations(ctx context.Context, filter platform.AuthorizationFilter, ...) ([]*platform.Authorization, int, error)
- func (s *AuthorizationService) UpdateAuthorization(ctx context.Context, id platform.ID, upd *platform.AuthorizationUpdate) (*platform.Authorization, error)
- type Authorizer
- type Bucket
- func (b *Bucket) Cursor(opts ...kv.CursorHint) (kv.Cursor, error)
- func (b *Bucket) Delete(key []byte) error
- func (b *Bucket) ForwardCursor(seek []byte, opts ...kv.CursorOption) (kv.ForwardCursor, error)
- func (b *Bucket) Get(key []byte) ([]byte, error)
- func (b *Bucket) GetBatch(keys ...[]byte) ([][]byte, error)
- func (b *Bucket) Put(key, value []byte) error
- type BucketLookup
- type BucketOperationLogService
- type BucketService
- func (s *BucketService) Close() error
- func (s *BucketService) CreateBucket(ctx context.Context, bucket *platform.Bucket) error
- func (s *BucketService) DeleteBucket(ctx context.Context, id platform.ID) error
- func (s *BucketService) FindBucket(ctx context.Context, filter platform.BucketFilter) (*platform.Bucket, error)
- func (s *BucketService) FindBucketByID(ctx context.Context, id platform.ID) (*platform.Bucket, error)
- func (s *BucketService) FindBucketByName(ctx context.Context, orgID platform.ID, name string) (*platform.Bucket, error)
- func (s *BucketService) FindBuckets(ctx context.Context, filter platform.BucketFilter, ...) ([]*platform.Bucket, int, error)
- func (s *BucketService) Open() error
- func (s *BucketService) UpdateBucket(ctx context.Context, id platform.ID, upd platform.BucketUpdate) (*platform.Bucket, error)
- type CheckService
- func (s *CheckService) CreateCheck(ctx context.Context, check influxdb.CheckCreate, userID influxdb.ID) error
- func (s *CheckService) DeleteCheck(ctx context.Context, id influxdb.ID) error
- func (s *CheckService) FindCheck(ctx context.Context, filter influxdb.CheckFilter) (influxdb.Check, error)
- func (s *CheckService) FindCheckByID(ctx context.Context, id influxdb.ID) (influxdb.Check, error)
- func (s *CheckService) FindChecks(ctx context.Context, filter influxdb.CheckFilter, opts ...influxdb.FindOptions) ([]influxdb.Check, int, error)
- func (s *CheckService) PatchCheck(ctx context.Context, id influxdb.ID, upd influxdb.CheckUpdate) (influxdb.Check, error)
- func (s *CheckService) UpdateCheck(ctx context.Context, id influxdb.ID, chk influxdb.CheckCreate) (influxdb.Check, error)
- type Cursor
- type DBRPMappingService
- func (s *DBRPMappingService) Create(ctx context.Context, dbrpMap *influxdb.DBRPMapping) error
- func (s *DBRPMappingService) Delete(ctx context.Context, cluster string, db string, rp string) error
- func (s *DBRPMappingService) Find(ctx context.Context, filter influxdb.DBRPMappingFilter) (*influxdb.DBRPMapping, error)
- func (s *DBRPMappingService) FindBy(ctx context.Context, cluster string, db string, rp string) (*influxdb.DBRPMapping, error)
- func (s *DBRPMappingService) FindMany(ctx context.Context, filter influxdb.DBRPMappingFilter, ...) ([]*influxdb.DBRPMapping, int, error)
- type DBRPMappingServiceV2
- func (s *DBRPMappingServiceV2) Create(ctx context.Context, dbrp *influxdb.DBRPMappingV2) error
- func (s *DBRPMappingServiceV2) Delete(ctx context.Context, orgID, id influxdb.ID) error
- func (s *DBRPMappingServiceV2) FindByID(ctx context.Context, orgID, id influxdb.ID) (*influxdb.DBRPMappingV2, error)
- func (s *DBRPMappingServiceV2) FindMany(ctx context.Context, dbrp influxdb.DBRPMappingFilterV2, ...) ([]*influxdb.DBRPMappingV2, int, error)
- func (s *DBRPMappingServiceV2) Update(ctx context.Context, dbrp *influxdb.DBRPMappingV2) error
- type DashboardOperationLogService
- type DashboardService
- func (s *DashboardService) AddDashboardCell(ctx context.Context, id platform.ID, c *platform.Cell, ...) error
- func (s *DashboardService) CopyDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID) (*platform.Cell, error)
- func (s *DashboardService) CreateDashboard(ctx context.Context, b *platform.Dashboard) error
- func (s *DashboardService) DeleteDashboard(ctx context.Context, id platform.ID) error
- func (s *DashboardService) FindDashboardByID(ctx context.Context, id platform.ID) (*platform.Dashboard, error)
- func (s *DashboardService) FindDashboards(ctx context.Context, filter platform.DashboardFilter, ...) ([]*platform.Dashboard, int, error)
- func (s *DashboardService) GetDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID) (*platform.View, error)
- func (s *DashboardService) RemoveDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID) error
- func (s *DashboardService) ReplaceDashboardCells(ctx context.Context, id platform.ID, cs []*platform.Cell) error
- func (s *DashboardService) UpdateDashboard(ctx context.Context, id platform.ID, upd platform.DashboardUpdate) (*platform.Dashboard, error)
- func (s *DashboardService) UpdateDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID, ...) (*platform.Cell, error)
- func (s *DashboardService) UpdateDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID, upd platform.ViewUpdate) (*platform.View, error)
- type DeleteService
- type DocumentService
- type DocumentStore
- func (s *DocumentStore) CreateDocument(ctx context.Context, d *influxdb.Document) error
- func (s *DocumentStore) DeleteDocument(ctx context.Context, id influxdb.ID) error
- func (s *DocumentStore) DeleteDocuments(ctx context.Context, opts ...influxdb.DocumentFindOptions) error
- func (s *DocumentStore) FindDocument(ctx context.Context, id influxdb.ID) (*influxdb.Document, error)
- func (s *DocumentStore) FindDocuments(ctx context.Context, opts ...influxdb.DocumentFindOptions) ([]*influxdb.Document, error)
- func (s *DocumentStore) UpdateDocument(ctx context.Context, d *influxdb.Document) error
- type Flagger
- type GeneratorOptionFn
- type GeneratorResultSet
- type GroupStoreReader
- type IDGenerator
- type LabelService
- func (s *LabelService) CreateLabel(ctx context.Context, l *platform.Label) error
- func (s *LabelService) CreateLabelMapping(ctx context.Context, m *platform.LabelMapping) error
- func (s *LabelService) DeleteLabel(ctx context.Context, id platform.ID) error
- func (s *LabelService) DeleteLabelMapping(ctx context.Context, m *platform.LabelMapping) error
- func (s *LabelService) FindLabelByID(ctx context.Context, id platform.ID) (*platform.Label, error)
- func (s *LabelService) FindLabels(ctx context.Context, filter platform.LabelFilter, opt ...platform.FindOptions) ([]*platform.Label, error)
- func (s *LabelService) FindResourceLabels(ctx context.Context, filter platform.LabelMappingFilter) ([]*platform.Label, error)
- func (s *LabelService) UpdateLabel(ctx context.Context, id platform.ID, upd platform.LabelUpdate) (*platform.Label, error)
- type LookupService
- type MockIDGenerator
- type NatsPublisher
- type NatsServer
- type NatsSubscriber
- type NotificationEndpointService
- func (s *NotificationEndpointService) CreateNotificationEndpoint(ctx context.Context, nr influxdb.NotificationEndpoint, userID influxdb.ID) error
- func (s *NotificationEndpointService) DeleteNotificationEndpoint(ctx context.Context, id influxdb.ID) ([]influxdb.SecretField, influxdb.ID, error)
- func (s *NotificationEndpointService) FindNotificationEndpointByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationEndpoint, error)
- func (s *NotificationEndpointService) FindNotificationEndpoints(ctx context.Context, filter influxdb.NotificationEndpointFilter, ...) ([]influxdb.NotificationEndpoint, int, error)
- func (s *NotificationEndpointService) PatchNotificationEndpoint(ctx context.Context, id influxdb.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error)
- func (s *NotificationEndpointService) UpdateNotificationEndpoint(ctx context.Context, id influxdb.ID, nr influxdb.NotificationEndpoint, ...) (influxdb.NotificationEndpoint, error)
- type NotificationRuleStore
- func (s *NotificationRuleStore) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID influxdb.ID) error
- func (s *NotificationRuleStore) DeleteNotificationRule(ctx context.Context, id influxdb.ID) error
- func (s *NotificationRuleStore) FindNotificationRuleByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationRule, error)
- func (s *NotificationRuleStore) FindNotificationRules(ctx context.Context, filter influxdb.NotificationRuleFilter, ...) ([]influxdb.NotificationRule, int, error)
- func (s *NotificationRuleStore) PatchNotificationRule(ctx context.Context, id influxdb.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
- func (s *NotificationRuleStore) UpdateNotificationRule(ctx context.Context, id influxdb.ID, nr influxdb.NotificationRuleCreate, ...) (influxdb.NotificationRule, error)
- type OnboardingService
- func (s *OnboardingService) IsOnboarding(ctx context.Context) (bool, error)
- func (s *OnboardingService) OnboardInitialUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error)
- func (s *OnboardingService) OnboardUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error)
- type OrganizationLookup
- type OrganizationOperationLogService
- type OrganizationService
- func (s *OrganizationService) CreateOrganization(ctx context.Context, b *platform.Organization) error
- func (s *OrganizationService) DeleteOrganization(ctx context.Context, id platform.ID) error
- func (s *OrganizationService) FindOrganization(ctx context.Context, filter platform.OrganizationFilter) (*platform.Organization, error)
- func (s *OrganizationService) FindOrganizationByID(ctx context.Context, id platform.ID) (*platform.Organization, error)
- func (s *OrganizationService) FindOrganizations(ctx context.Context, filter platform.OrganizationFilter, ...) ([]*platform.Organization, int, error)
- func (s *OrganizationService) FindResourceOrganizationID(ctx context.Context, rt platform.ResourceType, id platform.ID) (platform.ID, error)
- func (s *OrganizationService) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error)
- type PagingFilter
- type PasswordsService
- func (s *PasswordsService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
- func (s *PasswordsService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
- func (s *PasswordsService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
- type PointsWriter
- type RetentionService
- type SafeCount
- type ScraperTargetStoreService
- func (s *ScraperTargetStoreService) AddTarget(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) error
- func (s *ScraperTargetStoreService) GetTargetByID(ctx context.Context, id platform.ID) (*platform.ScraperTarget, error)
- func (s *ScraperTargetStoreService) ListTargets(ctx context.Context, filter platform.ScraperTargetFilter) ([]platform.ScraperTarget, error)
- func (s *ScraperTargetStoreService) RemoveTarget(ctx context.Context, id platform.ID) error
- func (s *ScraperTargetStoreService) UpdateTarget(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) (*platform.ScraperTarget, error)
- type SecretService
- func (s *SecretService) DeleteSecret(ctx context.Context, orgID platform.ID, ks ...string) error
- func (s *SecretService) GetSecretKeys(ctx context.Context, orgID platform.ID) ([]string, error)
- func (s *SecretService) LoadSecret(ctx context.Context, orgID platform.ID, k string) (string, error)
- func (s *SecretService) PatchSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error
- func (s *SecretService) PutSecret(ctx context.Context, orgID platform.ID, k string, v string) error
- func (s *SecretService) PutSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error
- type SessionService
- func (s *SessionService) CreateSession(ctx context.Context, user string) (*platform.Session, error)
- func (s *SessionService) ExpireSession(ctx context.Context, key string) error
- func (s *SessionService) FindSession(ctx context.Context, key string) (*platform.Session, error)
- func (s *SessionService) RenewSession(ctx context.Context, session *platform.Session, expiredAt time.Time) error
- type SourceService
- func (s *SourceService) CreateSource(ctx context.Context, source *platform.Source) error
- func (s *SourceService) DefaultSource(ctx context.Context) (*platform.Source, error)
- func (s *SourceService) DeleteSource(ctx context.Context, id platform.ID) error
- func (s *SourceService) FindSourceByID(ctx context.Context, id platform.ID) (*platform.Source, error)
- func (s *SourceService) FindSources(ctx context.Context, opts platform.FindOptions) ([]*platform.Source, int, error)
- func (s *SourceService) UpdateSource(ctx context.Context, id platform.ID, upd platform.SourceUpdate) (*platform.Source, error)
- type StorageReader
- func (s *StorageReader) Close()
- func (s *StorageReader) ReadFilter(ctx context.Context, spec query.ReadFilterSpec, alloc *memory.Allocator) (query.TableIterator, error)
- func (s *StorageReader) ReadGroup(ctx context.Context, spec query.ReadGroupSpec, alloc *memory.Allocator) (query.TableIterator, error)
- func (s *StorageReader) ReadTagKeys(ctx context.Context, spec query.ReadTagKeysSpec, alloc *memory.Allocator) (query.TableIterator, error)
- func (s *StorageReader) ReadTagValues(ctx context.Context, spec query.ReadTagValuesSpec, alloc *memory.Allocator) (query.TableIterator, error)
- type Store
- type TaskControlService
- func (tcs *TaskControlService) AddRunLog(ctx context.Context, taskID, runID influxdb.ID, when time.Time, log string) error
- func (tcs *TaskControlService) CreateRun(ctx context.Context, taskID influxdb.ID, scheduledFor time.Time, ...) (*influxdb.Run, error)
- func (tcs *TaskControlService) CurrentlyRunning(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error)
- func (tcs *TaskControlService) FinishRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
- func (tcs *TaskControlService) ManualRuns(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error)
- func (tcs *TaskControlService) StartManualRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
- func (tcs *TaskControlService) UpdateRunState(ctx context.Context, taskID, runID influxdb.ID, when time.Time, ...) error
- type TaskService
- func (s *TaskService) CancelRun(ctx context.Context, taskID, runID influxdb.ID) error
- func (s *TaskService) CreateTask(ctx context.Context, t influxdb.TaskCreate) (*influxdb.Task, error)
- func (s *TaskService) DeleteTask(ctx context.Context, id influxdb.ID) error
- func (s *TaskService) FindLogs(ctx context.Context, filter influxdb.LogFilter) ([]*influxdb.Log, int, error)
- func (s *TaskService) FindRunByID(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
- func (s *TaskService) FindRuns(ctx context.Context, filter influxdb.RunFilter) ([]*influxdb.Run, int, error)
- func (s *TaskService) FindTaskByID(ctx context.Context, id influxdb.ID) (*influxdb.Task, error)
- func (s *TaskService) FindTasks(ctx context.Context, filter influxdb.TaskFilter) ([]*influxdb.Task, int, error)
- func (s *TaskService) ForceRun(ctx context.Context, taskID influxdb.ID, scheduledFor int64) (*influxdb.Run, error)
- func (s *TaskService) RetryRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
- func (s *TaskService) UpdateTask(ctx context.Context, id influxdb.ID, upd influxdb.TaskUpdate) (*influxdb.Task, error)
- type TelegrafConfigStore
- func (s *TelegrafConfigStore) CreateTelegrafConfig(ctx context.Context, tc *platform.TelegrafConfig, userID platform.ID) error
- func (s *TelegrafConfigStore) DeleteTelegrafConfig(ctx context.Context, id platform.ID) error
- func (s *TelegrafConfigStore) FindTelegrafConfigByID(ctx context.Context, id platform.ID) (*platform.TelegrafConfig, error)
- func (s *TelegrafConfigStore) FindTelegrafConfigs(ctx context.Context, filter platform.TelegrafConfigFilter, ...) ([]*platform.TelegrafConfig, int, error)
- func (s *TelegrafConfigStore) UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, ...) (*platform.TelegrafConfig, error)
- type TimeGenerator
- type TokenGenerator
- type Tx
- type UserOperationLogService
- type UserResourceMappingService
- func (s *UserResourceMappingService) CreateUserResourceMapping(ctx context.Context, m *platform.UserResourceMapping) error
- func (s *UserResourceMappingService) DeleteUserResourceMapping(ctx context.Context, resourceID platform.ID, userID platform.ID) error
- func (s *UserResourceMappingService) FindUserResourceMappings(ctx context.Context, filter platform.UserResourceMappingFilter, ...) ([]*platform.UserResourceMapping, int, error)
- type UserService
- func (s *UserService) CreateUser(ctx context.Context, User *platform.User) error
- func (s *UserService) DeleteUser(ctx context.Context, id platform.ID) error
- func (s *UserService) FindPermissionForUser(ctx context.Context, uid platform.ID) (platform.PermissionSet, error)
- func (s *UserService) FindUser(ctx context.Context, filter platform.UserFilter) (*platform.User, error)
- func (s *UserService) FindUserByID(ctx context.Context, id platform.ID) (*platform.User, error)
- func (s *UserService) FindUsers(ctx context.Context, filter platform.UserFilter, opts ...platform.FindOptions) ([]*platform.User, int, error)
- func (s *UserService) UpdateUser(ctx context.Context, id platform.ID, upd platform.UserUpdate) (*platform.User, error)
- type VariableService
- func (s *VariableService) CreateVariable(ctx context.Context, variable *influxdb.Variable) error
- func (s *VariableService) DeleteVariable(ctx context.Context, id influxdb.ID) error
- func (s *VariableService) FindVariableByID(ctx context.Context, id influxdb.ID) (*influxdb.Variable, error)
- func (s *VariableService) FindVariables(ctx context.Context, filter influxdb.VariableFilter, ...) ([]*influxdb.Variable, error)
- func (s *VariableService) ReplaceVariable(ctx context.Context, variable *influxdb.Variable) error
- func (s *VariableService) UpdateVariable(ctx context.Context, id influxdb.ID, update *influxdb.VariableUpdate) (*influxdb.Variable, error)
- type WindowAggregateStoreReader
- type WriteService
Constants ¶
const FirstMockID int = 65536
Variables ¶
This section is empty.
Functions ¶
func NewNats ¶
func NewNats() (nats.Publisher, nats.Subscriber)
NewNats returns a mocked version of publisher, subscriber
func SetIDForFunc ¶
func SetIDForFunc(gen *influxdb.IDGenerator, id influxdb.ID, fn func())
SetIDForFunc replaces the id generator at the end of the pointer with one which returns the provided id. It then invokes the provided function before restoring the original value at the end of the pointer.
Types ¶
type AuthorizationService ¶
type AuthorizationService struct { // Methods for a retention.AuthorizationService OpenFn func() error CloseFn func() error // Methods for an platform.AuthorizationService FindAuthorizationByIDFn func(context.Context, platform.ID) (*platform.Authorization, error) FindAuthorizationByTokenFn func(context.Context, string) (*platform.Authorization, error) FindAuthorizationsFn func(context.Context, platform.AuthorizationFilter, ...platform.FindOptions) ([]*platform.Authorization, int, error) CreateAuthorizationFn func(context.Context, *platform.Authorization) error DeleteAuthorizationFn func(context.Context, platform.ID) error UpdateAuthorizationFn func(context.Context, platform.ID, *platform.AuthorizationUpdate) (*platform.Authorization, error) }
AuthorizationService is a mock implementation of a retention.AuthorizationService, which also makes it a suitable mock to use wherever an platform.AuthorizationService is required.
func NewAuthorizationService ¶
func NewAuthorizationService() *AuthorizationService
NewAuthorizationService returns a mock AuthorizationService where its methods will return zero values.
func (*AuthorizationService) CreateAuthorization ¶
func (s *AuthorizationService) CreateAuthorization(ctx context.Context, authorization *platform.Authorization) error
CreateAuthorization creates a new authorization and sets b.ID with the new identifier.
func (*AuthorizationService) DeleteAuthorization ¶
DeleteAuthorization removes a authorization by ID.
func (*AuthorizationService) FindAuthorizationByID ¶
func (s *AuthorizationService) FindAuthorizationByID(ctx context.Context, id platform.ID) (*platform.Authorization, error)
FindAuthorizationByID returns a single authorization by ID.
func (*AuthorizationService) FindAuthorizationByToken ¶
func (s *AuthorizationService) FindAuthorizationByToken(ctx context.Context, t string) (*platform.Authorization, error)
func (*AuthorizationService) FindAuthorizations ¶
func (s *AuthorizationService) FindAuthorizations(ctx context.Context, filter platform.AuthorizationFilter, opts ...platform.FindOptions) ([]*platform.Authorization, int, error)
FindAuthorizations returns a list of authorizations that match filter and the total count of matching authorizations.
func (*AuthorizationService) UpdateAuthorization ¶
func (s *AuthorizationService) UpdateAuthorization(ctx context.Context, id platform.ID, upd *platform.AuthorizationUpdate) (*platform.Authorization, error)
UpdateAuthorization updates the status and description if available.
type Authorizer ¶
type Authorizer struct { Permissions []influxdb.Permission AllowAll bool }
Authorizer is an Authorizer for testing that can allow everything or use specific permissions
func NewMockAuthorizer ¶
func NewMockAuthorizer(allowAll bool, permissions []influxdb.Permission) *Authorizer
func (*Authorizer) GetUserID ¶
func (a *Authorizer) GetUserID() influxdb.ID
func (*Authorizer) Identifier ¶
func (a *Authorizer) Identifier() influxdb.ID
func (Authorizer) Kind ¶
func (Authorizer) Kind() string
func (*Authorizer) PermissionSet ¶
func (a *Authorizer) PermissionSet() (influxdb.PermissionSet, error)
type Bucket ¶
type Bucket struct { GetFn func(key []byte) ([]byte, error) GetBatchFn func(keys ...[]byte) ([][]byte, error) CursorFn func() (kv.Cursor, error) PutFn func(key, value []byte) error DeleteFn func(key []byte) error ForwardCursorFn func([]byte, ...kv.CursorOption) kv.ForwardCursor }
Bucket is the abstraction used to perform get/put/delete/get-many operations in a key value store
func (*Bucket) ForwardCursor ¶
func (b *Bucket) ForwardCursor(seek []byte, opts ...kv.CursorOption) (kv.ForwardCursor, error)
ForwardCursor returns a cursor from the seek points in the configured direction.
type BucketLookup ¶
type BucketLookup struct{}
BucketLookup implements the BucketLookup interface needed by flux "from" and "to".
func (BucketLookup) LookupName ¶
type BucketOperationLogService ¶
type BucketOperationLogService struct {
GetBucketOperationLogFn func(context.Context, platform.ID, platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
}
BucketOperationLogService is a mock implementation of platform.BucketOperationLogService.
func NewBucketOperationLogService ¶
func NewBucketOperationLogService() *BucketOperationLogService
NewBucketOperationLogService returns a mock of BucketOperationLogService.
func (*BucketOperationLogService) GetBucketOperationLog ¶
func (s *BucketOperationLogService) GetBucketOperationLog(ctx context.Context, id platform.ID, opts platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
GetBucketOperationLog retrieves the operation log for the bucket with the provided id.
type BucketService ¶
type BucketService struct { // Methods for a retention.BucketService OpenFn func() error CloseFn func() error // Methods for an platform.BucketService FindBucketByIDFn func(context.Context, platform.ID) (*platform.Bucket, error) FindBucketByIDCalls SafeCount FindBucketByNameFn func(context.Context, platform.ID, string) (*platform.Bucket, error) FindBucketByNameCalls SafeCount FindBucketFn func(context.Context, platform.BucketFilter) (*platform.Bucket, error) FindBucketCalls SafeCount FindBucketsFn func(context.Context, platform.BucketFilter, ...platform.FindOptions) ([]*platform.Bucket, int, error) FindBucketsCalls SafeCount CreateBucketFn func(context.Context, *platform.Bucket) error CreateBucketCalls SafeCount UpdateBucketFn func(context.Context, platform.ID, platform.BucketUpdate) (*platform.Bucket, error) UpdateBucketCalls SafeCount DeleteBucketFn func(context.Context, platform.ID) error DeleteBucketCalls SafeCount }
BucketService is a mock implementation of a retention.BucketService, which also makes it a suitable mock to use wherever an platform.BucketService is required.
func NewBucketService ¶
func NewBucketService() *BucketService
NewBucketService returns a mock BucketService where its methods will return zero values.
func (*BucketService) CreateBucket ¶
CreateBucket creates a new bucket and sets b.ID with the new identifier.
func (*BucketService) DeleteBucket ¶
DeleteBucket removes a bucket by ID.
func (*BucketService) FindBucket ¶
func (s *BucketService) FindBucket(ctx context.Context, filter platform.BucketFilter) (*platform.Bucket, error)
FindBucket returns the first bucket that matches filter.
func (*BucketService) FindBucketByID ¶
func (s *BucketService) FindBucketByID(ctx context.Context, id platform.ID) (*platform.Bucket, error)
FindBucketByID returns a single bucket by ID.
func (*BucketService) FindBucketByName ¶
func (s *BucketService) FindBucketByName(ctx context.Context, orgID platform.ID, name string) (*platform.Bucket, error)
FindBucketByName returns a single bucket by name.
func (*BucketService) FindBuckets ¶
func (s *BucketService) FindBuckets(ctx context.Context, filter platform.BucketFilter, opts ...platform.FindOptions) ([]*platform.Bucket, int, error)
FindBuckets returns a list of buckets that match filter and the total count of matching buckets.
func (*BucketService) UpdateBucket ¶
func (s *BucketService) UpdateBucket(ctx context.Context, id platform.ID, upd platform.BucketUpdate) (*platform.Bucket, error)
UpdateBucket updates a single bucket with changeset.
type CheckService ¶
type CheckService struct { OrganizationService UserResourceMappingService // Methods for an influxdb.CheckService FindCheckByIDFn func(context.Context, influxdb.ID) (influxdb.Check, error) FindCheckByIDCalls SafeCount FindCheckFn func(context.Context, influxdb.CheckFilter) (influxdb.Check, error) FindCheckCalls SafeCount FindChecksFn func(context.Context, influxdb.CheckFilter, ...influxdb.FindOptions) ([]influxdb.Check, int, error) FindChecksCalls SafeCount CreateCheckFn func(context.Context, influxdb.CheckCreate, influxdb.ID) error CreateCheckCalls SafeCount UpdateCheckFn func(context.Context, influxdb.ID, influxdb.CheckCreate) (influxdb.Check, error) UpdateCheckCalls SafeCount PatchCheckFn func(context.Context, influxdb.ID, influxdb.CheckUpdate) (influxdb.Check, error) PatchCheckCalls SafeCount DeleteCheckFn func(context.Context, influxdb.ID) error DeleteCheckCalls SafeCount }
CheckService is a mock implementation of a retention.CheckService, which also makes it a suitable mock to use wherever an influxdb.CheckService is required.
func NewCheckService ¶
func NewCheckService() *CheckService
NewCheckService returns a mock CheckService where its methods will return zero values.
func (*CheckService) CreateCheck ¶
func (s *CheckService) CreateCheck(ctx context.Context, check influxdb.CheckCreate, userID influxdb.ID) error
CreateCheck creates a new check and sets b.ID with the new identifier.
func (*CheckService) DeleteCheck ¶
func (s *CheckService) DeleteCheck(ctx context.Context, id influxdb.ID) error
DeleteCheck removes a check by ID.
func (*CheckService) FindCheck ¶
func (s *CheckService) FindCheck(ctx context.Context, filter influxdb.CheckFilter) (influxdb.Check, error)
FindCheck returns the first check that matches filter.
func (*CheckService) FindCheckByID ¶
func (s *CheckService) FindCheckByID(ctx context.Context, id influxdb.ID) (influxdb.Check, error)
FindCheckByID returns a single check by ID.
func (*CheckService) FindChecks ¶
func (s *CheckService) FindChecks(ctx context.Context, filter influxdb.CheckFilter, opts ...influxdb.FindOptions) ([]influxdb.Check, int, error)
FindChecks returns a list of checks that match filter and the total count of matching checks.
func (*CheckService) PatchCheck ¶
func (s *CheckService) PatchCheck(ctx context.Context, id influxdb.ID, upd influxdb.CheckUpdate) (influxdb.Check, error)
PatchCheck updates a single check with changeset.
func (*CheckService) UpdateCheck ¶
func (s *CheckService) UpdateCheck(ctx context.Context, id influxdb.ID, chk influxdb.CheckCreate) (influxdb.Check, error)
UpdateCheck updates everything except id orgID.
type Cursor ¶
type Cursor struct { SeekFn func(prefix []byte) (k []byte, v []byte) FirstFn func() (k []byte, v []byte) LastFn func() (k []byte, v []byte) NextFn func() (k []byte, v []byte) PrevFn func() (k []byte, v []byte) }
Cursor is an abstraction for iterating/ranging through data. A concrete implementation of a cursor can be found in cursor.go.
type DBRPMappingService ¶
type DBRPMappingService struct { FindByFn func(ctx context.Context, cluster string, db string, rp string) (*influxdb.DBRPMapping, error) FindFn func(ctx context.Context, filter influxdb.DBRPMappingFilter) (*influxdb.DBRPMapping, error) FindManyFn func(ctx context.Context, filter influxdb.DBRPMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.DBRPMapping, int, error) CreateFn func(ctx context.Context, dbrpMap *influxdb.DBRPMapping) error DeleteFn func(ctx context.Context, cluster string, db string, rp string) error }
func NewDBRPMappingService ¶
func NewDBRPMappingService() *DBRPMappingService
func (*DBRPMappingService) Create ¶
func (s *DBRPMappingService) Create(ctx context.Context, dbrpMap *influxdb.DBRPMapping) error
func (*DBRPMappingService) Find ¶
func (s *DBRPMappingService) Find(ctx context.Context, filter influxdb.DBRPMappingFilter) (*influxdb.DBRPMapping, error)
type DBRPMappingServiceV2 ¶
type DBRPMappingServiceV2 struct { FindByIDFn func(ctx context.Context, orgID, id influxdb.ID) (*influxdb.DBRPMappingV2, error) FindManyFn func(ctx context.Context, dbrp influxdb.DBRPMappingFilterV2, opts ...influxdb.FindOptions) ([]*influxdb.DBRPMappingV2, int, error) CreateFn func(ctx context.Context, dbrp *influxdb.DBRPMappingV2) error UpdateFn func(ctx context.Context, dbrp *influxdb.DBRPMappingV2) error DeleteFn func(ctx context.Context, orgID, id influxdb.ID) error }
func (*DBRPMappingServiceV2) Create ¶
func (s *DBRPMappingServiceV2) Create(ctx context.Context, dbrp *influxdb.DBRPMappingV2) error
func (*DBRPMappingServiceV2) Delete ¶
func (s *DBRPMappingServiceV2) Delete(ctx context.Context, orgID, id influxdb.ID) error
func (*DBRPMappingServiceV2) FindByID ¶
func (s *DBRPMappingServiceV2) FindByID(ctx context.Context, orgID, id influxdb.ID) (*influxdb.DBRPMappingV2, error)
type DashboardOperationLogService ¶
type DashboardOperationLogService struct {
GetDashboardOperationLogFn func(context.Context, platform.ID, platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
}
DashboardOperationLogService is a mock implementation of platform.DashboardOperationLogService.
func NewDashboardOperationLogService ¶
func NewDashboardOperationLogService() *DashboardOperationLogService
NewDashboardOperationLogService returns a mock of DashboardOperationLogService.
func (*DashboardOperationLogService) GetDashboardOperationLog ¶
func (s *DashboardOperationLogService) GetDashboardOperationLog(ctx context.Context, id platform.ID, opts platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
GetDashboardOperationLog retrieves the operation log for the dashboard with the provided id.
type DashboardService ¶
type DashboardService struct { CreateDashboardF func(context.Context, *platform.Dashboard) error CreateDashboardCalls SafeCount FindDashboardByIDF func(context.Context, platform.ID) (*platform.Dashboard, error) FindDashboardByIDCalls SafeCount FindDashboardsF func(context.Context, platform.DashboardFilter, platform.FindOptions) ([]*platform.Dashboard, int, error) FindDashboardsCalls SafeCount UpdateDashboardF func(context.Context, platform.ID, platform.DashboardUpdate) (*platform.Dashboard, error) UpdateDashboardCalls SafeCount DeleteDashboardF func(context.Context, platform.ID) error DeleteDashboardCalls SafeCount AddDashboardCellF func(ctx context.Context, id platform.ID, c *platform.Cell, opts platform.AddDashboardCellOptions) error AddDashboardCellCalls SafeCount RemoveDashboardCellF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID) error RemoveDashboardCellCalls SafeCount GetDashboardCellViewF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID) (*platform.View, error) GetDashboardCellViewCalls SafeCount UpdateDashboardCellViewF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID, upd platform.ViewUpdate) (*platform.View, error) UpdateDashboardCellViewCalls SafeCount UpdateDashboardCellF func(ctx context.Context, dashbaordID platform.ID, cellID platform.ID, upd platform.CellUpdate) (*platform.Cell, error) UpdateDashboardCellCalls SafeCount CopyDashboardCellF func(ctx context.Context, dashbaordID platform.ID, cellID platform.ID) (*platform.Cell, error) CopyDashboardCellCalls SafeCount ReplaceDashboardCellsF func(ctx context.Context, id platform.ID, cs []*platform.Cell) error ReplaceDashboardCellsCalls SafeCount }
func NewDashboardService ¶
func NewDashboardService() *DashboardService
NewDashboardService returns a mock of DashboardService where its methods will return zero values.
func (*DashboardService) AddDashboardCell ¶
func (s *DashboardService) AddDashboardCell(ctx context.Context, id platform.ID, c *platform.Cell, opts platform.AddDashboardCellOptions) error
func (*DashboardService) CopyDashboardCell ¶
func (*DashboardService) CreateDashboard ¶
func (*DashboardService) DeleteDashboard ¶
func (*DashboardService) FindDashboardByID ¶
func (*DashboardService) FindDashboards ¶
func (s *DashboardService) FindDashboards(ctx context.Context, filter platform.DashboardFilter, opts platform.FindOptions) ([]*platform.Dashboard, int, error)
func (*DashboardService) GetDashboardCellView ¶
func (*DashboardService) RemoveDashboardCell ¶
func (*DashboardService) ReplaceDashboardCells ¶
func (*DashboardService) UpdateDashboard ¶
func (s *DashboardService) UpdateDashboard(ctx context.Context, id platform.ID, upd platform.DashboardUpdate) (*platform.Dashboard, error)
func (*DashboardService) UpdateDashboardCell ¶
func (*DashboardService) UpdateDashboardCellView ¶
func (s *DashboardService) UpdateDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID, upd platform.ViewUpdate) (*platform.View, error)
type DeleteService ¶
type DeleteService struct {
DeleteBucketRangePredicateF func(tx context.Context, orgID, bucketID influxdb.ID, min, max int64, pred influxdb.Predicate) error
}
DeleteService is a mock delete server.
func NewDeleteService ¶
func NewDeleteService() DeleteService
NewDeleteService returns a mock DeleteService where its methods will return zero values.
func (DeleteService) DeleteBucketRangePredicate ¶
func (s DeleteService) DeleteBucketRangePredicate(ctx context.Context, orgID, bucketID influxdb.ID, min, max int64, pred influxdb.Predicate) error
DeleteBucketRangePredicate calls DeleteBucketRangePredicateF.
type DocumentService ¶
type DocumentService struct { CreateDocumentStoreFn func(ctx context.Context, name string) (influxdb.DocumentStore, error) FindDocumentStoreFn func(ctx context.Context, name string) (influxdb.DocumentStore, error) }
DocumentService is mocked document service.
func NewDocumentService ¶
func NewDocumentService() *DocumentService
NewDocumentService returns a mock of DocumentService where its methods will return zero values.
func (*DocumentService) CreateDocumentStore ¶
func (s *DocumentService) CreateDocumentStore(ctx context.Context, name string) (influxdb.DocumentStore, error)
CreateDocumentStore calls the mocked CreateDocumentStoreFn.
func (*DocumentService) FindDocumentStore ¶
func (s *DocumentService) FindDocumentStore(ctx context.Context, name string) (influxdb.DocumentStore, error)
FindDocumentStore calls the mocked FindDocumentStoreFn.
type DocumentStore ¶
type DocumentStore struct { TimeGenerator TimeGenerator CreateDocumentFn func(ctx context.Context, d *influxdb.Document) error FindDocumentFn func(ctx context.Context, id influxdb.ID) (*influxdb.Document, error) UpdateDocumentFn func(ctx context.Context, d *influxdb.Document) error DeleteDocumentFn func(ctx context.Context, id influxdb.ID) error FindDocumentsFn func(ctx context.Context, opts ...influxdb.DocumentFindOptions) ([]*influxdb.Document, error) DeleteDocumentsFn func(ctx context.Context, opts ...influxdb.DocumentFindOptions) error }
DocumentStore is the mocked document store.
func NewDocumentStore ¶
func NewDocumentStore() *DocumentStore
NewDocumentStore returns a mock of DocumentStore where its methods will return zero values.
func (*DocumentStore) CreateDocument ¶
func (s *DocumentStore) CreateDocument(ctx context.Context, d *influxdb.Document) error
CreateDocument will call the mocked CreateDocumentFn.
func (*DocumentStore) DeleteDocument ¶
func (s *DocumentStore) DeleteDocument(ctx context.Context, id influxdb.ID) error
DeleteDocument will call the mocked DeleteDocumentFn.
func (*DocumentStore) DeleteDocuments ¶
func (s *DocumentStore) DeleteDocuments(ctx context.Context, opts ...influxdb.DocumentFindOptions) error
DeleteDocuments will call the mocked DeleteDocumentsFn.
func (*DocumentStore) FindDocument ¶
func (s *DocumentStore) FindDocument(ctx context.Context, id influxdb.ID) (*influxdb.Document, error)
FindDocument will call the mocked FindDocumentFn.
func (*DocumentStore) FindDocuments ¶
func (s *DocumentStore) FindDocuments(ctx context.Context, opts ...influxdb.DocumentFindOptions) ([]*influxdb.Document, error)
FindDocuments will call the mocked FindDocumentsFn.
func (*DocumentStore) UpdateDocument ¶
func (s *DocumentStore) UpdateDocument(ctx context.Context, d *influxdb.Document) error
UpdateDocument will call the mocked UpdateDocumentFn.
type Flagger ¶
type Flagger struct {
// contains filtered or unexported fields
}
Flagger is a mock.
func NewFlagger ¶
NewFlagger returns a mock Flagger.
type GeneratorOptionFn ¶
type GeneratorOptionFn func(*GeneratorResultSet)
func WithGeneratorMaxValues ¶
func WithGeneratorMaxValues(n int) GeneratorOptionFn
WithGeneratorMaxValues limits the number of values produced by GeneratorResultSet to n.
type GeneratorResultSet ¶
type GeneratorResultSet struct {
// contains filtered or unexported fields
}
func NewResultSetFromSeriesGenerator ¶
func NewResultSetFromSeriesGenerator(sg gen.SeriesGenerator, opts ...GeneratorOptionFn) *GeneratorResultSet
NewResultSetFromSeriesGenerator transforms a SeriesGenerator into a ResultSet, and therefore may be used anywhere a ResultSet is required.
func (*GeneratorResultSet) Close ¶
func (g *GeneratorResultSet) Close()
func (*GeneratorResultSet) Cursor ¶
func (g *GeneratorResultSet) Cursor() cursors.Cursor
func (*GeneratorResultSet) Err ¶
func (g *GeneratorResultSet) Err() error
func (*GeneratorResultSet) Next ¶
func (g *GeneratorResultSet) Next() bool
func (*GeneratorResultSet) Stats ¶
func (g *GeneratorResultSet) Stats() cursors.CursorStats
func (*GeneratorResultSet) Tags ¶
func (g *GeneratorResultSet) Tags() models.Tags
type GroupStoreReader ¶
type GroupStoreReader struct { *StorageReader GroupCapabilityFn func(ctx context.Context) query.GroupCapability }
func (*GroupStoreReader) GetGroupCapability ¶
func (s *GroupStoreReader) GetGroupCapability(ctx context.Context) query.GroupCapability
type IDGenerator ¶
IDGenerator is mock implementation of influxdb.IDGenerator.
func NewIDGenerator ¶
func NewIDGenerator(s string, t *testing.T) IDGenerator
NewIDGenerator is a simple way to create immutable id generator
func NewIncrementingIDGenerator ¶
func NewIncrementingIDGenerator(start influxdb.ID) IDGenerator
NewIncrementingIDGenerator returns an ID generator which starts at the provided ID and increments on each call to ID().
func NewStaticIDGenerator ¶
func NewStaticIDGenerator(id influxdb.ID) IDGenerator
NewStaticIDGenerator returns an IDGenerator which produces the ID provided to this function on a call to ID().
func (IDGenerator) ID ¶
func (g IDGenerator) ID() influxdb.ID
ID generates a new influxdb.ID from a mock function.
type LabelService ¶
type LabelService struct { CreateLabelFn func(context.Context, *platform.Label) error CreateLabelCalls SafeCount DeleteLabelFn func(context.Context, platform.ID) error DeleteLabelCalls SafeCount FindLabelByIDFn func(ctx context.Context, id platform.ID) (*platform.Label, error) FindLabelByIDCalls SafeCount FindLabelsFn func(context.Context, platform.LabelFilter) ([]*platform.Label, error) FindLabelsCalls SafeCount FindResourceLabelsFn func(context.Context, platform.LabelMappingFilter) ([]*platform.Label, error) FindResourceLabelsCalls SafeCount UpdateLabelFn func(context.Context, platform.ID, platform.LabelUpdate) (*platform.Label, error) UpdateLabelCalls SafeCount CreateLabelMappingFn func(context.Context, *platform.LabelMapping) error CreateLabelMappingCalls SafeCount DeleteLabelMappingFn func(context.Context, *platform.LabelMapping) error DeleteLabelMappingCalls SafeCount }
LabelService is a mock implementation of platform.LabelService
func NewLabelService ¶
func NewLabelService() *LabelService
NewLabelService returns a mock of LabelService where its methods will return zero values.
func (*LabelService) CreateLabel ¶
CreateLabel creates a new Label.
func (*LabelService) CreateLabelMapping ¶
func (s *LabelService) CreateLabelMapping(ctx context.Context, m *platform.LabelMapping) error
CreateLabelMapping creates a new Label mapping.
func (*LabelService) DeleteLabel ¶
DeleteLabel removes a Label.
func (*LabelService) DeleteLabelMapping ¶
func (s *LabelService) DeleteLabelMapping(ctx context.Context, m *platform.LabelMapping) error
DeleteLabelMapping removes a Label mapping.
func (*LabelService) FindLabelByID ¶
FindLabelByID finds mappings by their ID
func (*LabelService) FindLabels ¶
func (s *LabelService) FindLabels(ctx context.Context, filter platform.LabelFilter, opt ...platform.FindOptions) ([]*platform.Label, error)
FindLabels finds mappings that match a given filter.
func (*LabelService) FindResourceLabels ¶
func (s *LabelService) FindResourceLabels(ctx context.Context, filter platform.LabelMappingFilter) ([]*platform.Label, error)
FindResourceLabels finds mappings that match a given filter.
func (*LabelService) UpdateLabel ¶
func (s *LabelService) UpdateLabel(ctx context.Context, id platform.ID, upd platform.LabelUpdate) (*platform.Label, error)
UpdateLabel updates a label.
type LookupService ¶
type LookupService struct {
NameFn func(ctx context.Context, resource platform.ResourceType, id platform.ID) (string, error)
}
LookupService provides field lookup for the resource and ID.
func NewLookupService ¶
func NewLookupService() *LookupService
NewLookupService returns a mock of LookupService where its methods will return zero values.
type MockIDGenerator ¶
func NewMockIDGenerator ¶
func NewMockIDGenerator() *MockIDGenerator
func (*MockIDGenerator) ID ¶
func (g *MockIDGenerator) ID() influxdb.ID
type NatsPublisher ¶
type NatsPublisher struct {
// contains filtered or unexported fields
}
NatsPublisher is a mocked nats publisher.
type NatsServer ¶
NatsServer is the mocked nats server based buffered channel.
type NatsSubscriber ¶
type NatsSubscriber struct {
// contains filtered or unexported fields
}
NatsSubscriber is mocked nats subscriber.
type NotificationEndpointService ¶
type NotificationEndpointService struct { *OrganizationService *UserResourceMappingService FindNotificationEndpointByIDF func(ctx context.Context, id influxdb.ID) (influxdb.NotificationEndpoint, error) FindNotificationEndpointByIDCalls SafeCount FindNotificationEndpointsF func(ctx context.Context, filter influxdb.NotificationEndpointFilter, opt ...influxdb.FindOptions) ([]influxdb.NotificationEndpoint, int, error) FindNotificationEndpointsCalls SafeCount CreateNotificationEndpointF func(ctx context.Context, nr influxdb.NotificationEndpoint, userID influxdb.ID) error CreateNotificationEndpointCalls SafeCount UpdateNotificationEndpointF func(ctx context.Context, id influxdb.ID, nr influxdb.NotificationEndpoint, userID influxdb.ID) (influxdb.NotificationEndpoint, error) UpdateNotificationEndpointCalls SafeCount PatchNotificationEndpointF func(ctx context.Context, id influxdb.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error) PatchNotificationEndpointCalls SafeCount DeleteNotificationEndpointF func(ctx context.Context, id influxdb.ID) ([]influxdb.SecretField, influxdb.ID, error) DeleteNotificationEndpointCalls SafeCount }
NotificationEndpointService represents a service for managing notification rule data.
func NewNotificationEndpointService ¶
func NewNotificationEndpointService() *NotificationEndpointService
func (*NotificationEndpointService) CreateNotificationEndpoint ¶
func (s *NotificationEndpointService) CreateNotificationEndpoint(ctx context.Context, nr influxdb.NotificationEndpoint, userID influxdb.ID) error
CreateNotificationEndpoint creates a new notification rule and sets ID with the new identifier.
func (*NotificationEndpointService) DeleteNotificationEndpoint ¶
func (s *NotificationEndpointService) DeleteNotificationEndpoint(ctx context.Context, id influxdb.ID) ([]influxdb.SecretField, influxdb.ID, error)
DeleteNotificationEndpoint removes a notification rule by ID.
func (*NotificationEndpointService) FindNotificationEndpointByID ¶
func (s *NotificationEndpointService) FindNotificationEndpointByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationEndpoint, error)
FindNotificationEndpointByID returns a single telegraf config by ID.
func (*NotificationEndpointService) FindNotificationEndpoints ¶
func (s *NotificationEndpointService) FindNotificationEndpoints(ctx context.Context, filter influxdb.NotificationEndpointFilter, opt ...influxdb.FindOptions) ([]influxdb.NotificationEndpoint, int, error)
FindNotificationEndpoints returns a list of notification rules that match filter and the total count of matching notification rules. Additional options provide pagination & sorting.
func (*NotificationEndpointService) PatchNotificationEndpoint ¶
func (s *NotificationEndpointService) PatchNotificationEndpoint(ctx context.Context, id influxdb.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error)
PatchNotificationEndpoint updates a single notification rule with changeset. Returns the new notification rule after update.
func (*NotificationEndpointService) UpdateNotificationEndpoint ¶
func (s *NotificationEndpointService) UpdateNotificationEndpoint(ctx context.Context, id influxdb.ID, nr influxdb.NotificationEndpoint, userID influxdb.ID) (influxdb.NotificationEndpoint, error)
UpdateNotificationEndpoint updates a single notification rule. Returns the new notification rule after update.
type NotificationRuleStore ¶
type NotificationRuleStore struct { *OrganizationService *UserResourceMappingService FindNotificationRuleByIDF func(ctx context.Context, id influxdb.ID) (influxdb.NotificationRule, error) FindNotificationRuleByIDCalls SafeCount FindNotificationRulesF func(ctx context.Context, filter influxdb.NotificationRuleFilter, opt ...influxdb.FindOptions) ([]influxdb.NotificationRule, int, error) FindNotificationRulesCalls SafeCount CreateNotificationRuleF func(ctx context.Context, nr influxdb.NotificationRuleCreate, userID influxdb.ID) error CreateNotificationRuleCalls SafeCount UpdateNotificationRuleF func(ctx context.Context, id influxdb.ID, nr influxdb.NotificationRuleCreate, userID influxdb.ID) (influxdb.NotificationRule, error) UpdateNotificationRuleCalls SafeCount PatchNotificationRuleF func(ctx context.Context, id influxdb.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error) PatchNotificationRuleCalls SafeCount DeleteNotificationRuleF func(ctx context.Context, id influxdb.ID) error DeleteNotificationRuleCalls SafeCount }
NotificationRuleStore represents a service for managing notification rule data.
func NewNotificationRuleStore ¶
func NewNotificationRuleStore() *NotificationRuleStore
NewNotificationRuleStore creats a fake notification rules tore.
func (*NotificationRuleStore) CreateNotificationRule ¶
func (s *NotificationRuleStore) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID influxdb.ID) error
CreateNotificationRule creates a new notification rule and sets ID with the new identifier.
func (*NotificationRuleStore) DeleteNotificationRule ¶
func (s *NotificationRuleStore) DeleteNotificationRule(ctx context.Context, id influxdb.ID) error
DeleteNotificationRule removes a notification rule by ID.
func (*NotificationRuleStore) FindNotificationRuleByID ¶
func (s *NotificationRuleStore) FindNotificationRuleByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationRule, error)
FindNotificationRuleByID returns a single telegraf config by ID.
func (*NotificationRuleStore) FindNotificationRules ¶
func (s *NotificationRuleStore) FindNotificationRules(ctx context.Context, filter influxdb.NotificationRuleFilter, opt ...influxdb.FindOptions) ([]influxdb.NotificationRule, int, error)
FindNotificationRules returns a list of notification rules that match filter and the total count of matching notification rules. Additional options provide pagination & sorting.
func (*NotificationRuleStore) PatchNotificationRule ¶
func (s *NotificationRuleStore) PatchNotificationRule(ctx context.Context, id influxdb.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
PatchNotificationRule updates a single notification rule with changeset. Returns the new notification rule after update.
func (*NotificationRuleStore) UpdateNotificationRule ¶
func (s *NotificationRuleStore) UpdateNotificationRule(ctx context.Context, id influxdb.ID, nr influxdb.NotificationRuleCreate, userID influxdb.ID) (influxdb.NotificationRule, error)
UpdateNotificationRule updates a single notification rule. Returns the new notification rule after update.
type OnboardingService ¶
type OnboardingService struct { PasswordsService BucketService OrganizationService UserService AuthorizationService IsOnboardingFn func(context.Context) (bool, error) OnboardInitialUserFn func(context.Context, *platform.OnboardingRequest) (*platform.OnboardingResults, error) OnboardUserFn func(context.Context, *platform.OnboardingRequest) (*platform.OnboardingResults, error) }
OnboardingService is a mock implementation of platform.OnboardingService.
func NewOnboardingService ¶
func NewOnboardingService() *OnboardingService
NewOnboardingService returns a mock of OnboardingService where its methods will return zero values.
func (*OnboardingService) IsOnboarding ¶
func (s *OnboardingService) IsOnboarding(ctx context.Context) (bool, error)
IsOnboarding determine if onboarding request is allowed.
func (*OnboardingService) OnboardInitialUser ¶
func (s *OnboardingService) OnboardInitialUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error)
OnboardInitialUser OnboardingResults.
func (*OnboardingService) OnboardUser ¶
func (s *OnboardingService) OnboardUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error)
OnboardUser OnboardingResults.
type OrganizationLookup ¶
type OrganizationLookup struct{}
OrganizationLookup implements the OrganizationLookup interface needed by flux "from" and "to".
func (OrganizationLookup) LookupName ¶
type OrganizationOperationLogService ¶
type OrganizationOperationLogService struct {
GetOrganizationOperationLogFn func(context.Context, platform.ID, platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
}
OrganizationOperationLogService is a mock implementation of platform.OrganizationOperationLogService.
func NewOrganizationOperationLogService ¶
func NewOrganizationOperationLogService() *OrganizationOperationLogService
NewOrganizationOperationLogService returns a mock of OrganizationOperationLogService.
func (*OrganizationOperationLogService) GetOrganizationOperationLog ¶
func (s *OrganizationOperationLogService) GetOrganizationOperationLog(ctx context.Context, id platform.ID, opts platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
GetOrganizationOperationLog retrieves the operation log for the org with the provided id.
type OrganizationService ¶
type OrganizationService struct { FindOrganizationByIDF func(ctx context.Context, id platform.ID) (*platform.Organization, error) FindOrganizationF func(ctx context.Context, filter platform.OrganizationFilter) (*platform.Organization, error) FindOrganizationsF func(ctx context.Context, filter platform.OrganizationFilter, opt ...platform.FindOptions) ([]*platform.Organization, int, error) CreateOrganizationF func(ctx context.Context, b *platform.Organization) error UpdateOrganizationF func(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error) DeleteOrganizationF func(ctx context.Context, id platform.ID) error FindResourceOrganizationIDF func(ctx context.Context, rt platform.ResourceType, id platform.ID) (platform.ID, error) }
OrganizationService is a mock organization server.
func NewOrganizationService ¶
func NewOrganizationService() *OrganizationService
NewOrganizationService returns a mock OrganizationService where its methods will return zero values.
func (*OrganizationService) CreateOrganization ¶
func (s *OrganizationService) CreateOrganization(ctx context.Context, b *platform.Organization) error
CreateOrganization calls CreateOrganizationF.
func (*OrganizationService) DeleteOrganization ¶
DeleteOrganization calls DeleteOrganizationF.
func (*OrganizationService) FindOrganization ¶
func (s *OrganizationService) FindOrganization(ctx context.Context, filter platform.OrganizationFilter) (*platform.Organization, error)
FindOrganization calls FindOrganizationF.
func (*OrganizationService) FindOrganizationByID ¶
func (s *OrganizationService) FindOrganizationByID(ctx context.Context, id platform.ID) (*platform.Organization, error)
FindOrganizationByID calls FindOrganizationByIDF.
func (*OrganizationService) FindOrganizations ¶
func (s *OrganizationService) FindOrganizations(ctx context.Context, filter platform.OrganizationFilter, opt ...platform.FindOptions) ([]*platform.Organization, int, error)
FindOrganizations calls FindOrganizationsF.
func (*OrganizationService) FindResourceOrganizationID ¶
func (s *OrganizationService) FindResourceOrganizationID(ctx context.Context, rt platform.ResourceType, id platform.ID) (platform.ID, error)
FindResourceOrganizationID calls FindResourceOrganizationIDF.
func (*OrganizationService) UpdateOrganization ¶
func (s *OrganizationService) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error)
UpdateOrganization calls UpdateOrganizationF.
type PagingFilter ¶
func (PagingFilter) QueryParams ¶
func (f PagingFilter) QueryParams() map[string][]string
type PasswordsService ¶
type PasswordsService struct { SetPasswordFn func(context.Context, influxdb.ID, string) error ComparePasswordFn func(context.Context, influxdb.ID, string) error CompareAndSetPasswordFn func(context.Context, influxdb.ID, string, string) error }
PasswordsService is a mock implementation of a retention.PasswordsService, which also makes it a suitable mock to use wherever an platform.PasswordsService is required.
func NewPasswordsService ¶
func NewPasswordsService() *PasswordsService
NewPasswordsService returns a mock PasswordsService where its methods will return zero values.
func (*PasswordsService) CompareAndSetPassword ¶
func (s *PasswordsService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
CompareAndSetPassword compares the provided password and sets it to the new password.
func (*PasswordsService) ComparePassword ¶
func (s *PasswordsService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
ComparePassword password compares the provided password.
func (*PasswordsService) SetPassword ¶
func (s *PasswordsService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
SetPassword sets the users current password to be the provided password.
type PointsWriter ¶
type PointsWriter struct { Points []models.Point Err error WritePointsFn func(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, points []models.Point) error // contains filtered or unexported fields }
PointsWriter is a mock structure for writing points.
func (*PointsWriter) ForceError ¶
func (p *PointsWriter) ForceError(err error)
ForceError is for error testing, if WritePoints is called after ForceError, it will return that error.
func (*PointsWriter) Next ¶
func (p *PointsWriter) Next() models.Point
Next returns the next (oldest) batch of values.
func (*PointsWriter) WritePoints ¶
func (p *PointsWriter) WritePoints(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, points []models.Point) error
WritePoints writes points to the PointsWriter that will be exposed in the Values.
func (*PointsWriter) WritePointsCalled ¶
func (p *PointsWriter) WritePointsCalled() int
type RetentionService ¶
type RetentionService struct { OpenFn func() error CloseFn func() error PrometheusCollectorsFn func() []prometheus.Collector }
func NewRetentionService ¶
func NewRetentionService() *RetentionService
func (*RetentionService) Close ¶
func (s *RetentionService) Close() error
func (*RetentionService) Open ¶
func (s *RetentionService) Open() error
func (*RetentionService) PrometheusCollectors ¶
func (s *RetentionService) PrometheusCollectors() []prometheus.Collector
type SafeCount ¶
type SafeCount struct {
// contains filtered or unexported fields
}
SafeCount provides a safe counter, useful for call counts to maintain thread safety. Removes burden of having to introduce serialization when concurrency is brought in.
type ScraperTargetStoreService ¶
type ScraperTargetStoreService struct { UserResourceMappingService OrganizationService ListTargetsF func(ctx context.Context, filter platform.ScraperTargetFilter) ([]platform.ScraperTarget, error) AddTargetF func(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) error GetTargetByIDF func(ctx context.Context, id platform.ID) (*platform.ScraperTarget, error) RemoveTargetF func(ctx context.Context, id platform.ID) error UpdateTargetF func(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) (*platform.ScraperTarget, error) }
ScraperTargetStoreService is a mock implementation of a platform.ScraperTargetStoreService.
func (*ScraperTargetStoreService) AddTarget ¶
func (s *ScraperTargetStoreService) AddTarget(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) error
AddTarget adds a scraper target.
func (*ScraperTargetStoreService) GetTargetByID ¶
func (s *ScraperTargetStoreService) GetTargetByID(ctx context.Context, id platform.ID) (*platform.ScraperTarget, error)
GetTargetByID retrieves a scraper target by id.
func (*ScraperTargetStoreService) ListTargets ¶
func (s *ScraperTargetStoreService) ListTargets(ctx context.Context, filter platform.ScraperTargetFilter) ([]platform.ScraperTarget, error)
ListTargets lists all the scraper targets.
func (*ScraperTargetStoreService) RemoveTarget ¶
RemoveTarget deletes a scraper target.
func (*ScraperTargetStoreService) UpdateTarget ¶
func (s *ScraperTargetStoreService) UpdateTarget(ctx context.Context, t *platform.ScraperTarget, userID platform.ID) (*platform.ScraperTarget, error)
UpdateTarget updates a scraper target.
type SecretService ¶
type SecretService struct { LoadSecretFn func(ctx context.Context, orgID platform.ID, k string) (string, error) GetSecretKeysFn func(ctx context.Context, orgID platform.ID) ([]string, error) PutSecretFn func(ctx context.Context, orgID platform.ID, k string, v string) error PutSecretsFn func(ctx context.Context, orgID platform.ID, m map[string]string) error PatchSecretsFn func(ctx context.Context, orgID platform.ID, m map[string]string) error DeleteSecretFn func(ctx context.Context, orgID platform.ID, ks ...string) error }
SecretService is a mock implementation of a retention.SecretService, which also makes it a suitable mock to use wherever an platform.SecretService is required.
func NewSecretService ¶
func NewSecretService() *SecretService
NewSecretService returns a mock SecretService where its methods will return zero values.
func (*SecretService) DeleteSecret ¶
DeleteSecret removes a single secret from the secret store.
func (*SecretService) GetSecretKeys ¶
GetSecretKeys retrieves all secret keys that are stored for the organization orgID.
func (*SecretService) LoadSecret ¶
func (s *SecretService) LoadSecret(ctx context.Context, orgID platform.ID, k string) (string, error)
LoadSecret retrieves the secret value v found at key k for organization orgID.
func (*SecretService) PatchSecrets ¶
func (s *SecretService) PatchSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error
PatchSecrets patches all provided secrets and updates any previous values.
func (*SecretService) PutSecret ¶
PutSecret stores the secret pair (k,v) for the organization orgID.
func (*SecretService) PutSecrets ¶
func (s *SecretService) PutSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error
PutSecrets puts all provided secrets and overwrites any previous values.
type SessionService ¶
type SessionService struct { FindSessionFn func(context.Context, string) (*platform.Session, error) ExpireSessionFn func(context.Context, string) error CreateSessionFn func(context.Context, string) (*platform.Session, error) RenewSessionFn func(ctx context.Context, session *platform.Session, newExpiration time.Time) error }
SessionService is a mock implementation of a retention.SessionService, which also makes it a suitable mock to use wherever an platform.SessionService is required.
func NewSessionService ¶
func NewSessionService() *SessionService
NewSessionService returns a mock SessionService where its methods will return zero values.
func (*SessionService) CreateSession ¶
CreateSession creates a sesion for a user with the users maximal privileges.
func (*SessionService) ExpireSession ¶
func (s *SessionService) ExpireSession(ctx context.Context, key string) error
ExpireSession exires the session provided at key.
func (*SessionService) FindSession ¶
FindSession returns the session found at the provided key.
func (*SessionService) RenewSession ¶
func (s *SessionService) RenewSession(ctx context.Context, session *platform.Session, expiredAt time.Time) error
RenewSession extends the expire time to newExpiration.
type SourceService ¶
type SourceService struct { DefaultSourceFn func(context.Context) (*platform.Source, error) FindSourceByIDFn func(context.Context, platform.ID) (*platform.Source, error) FindSourcesFn func(context.Context, platform.FindOptions) ([]*platform.Source, int, error) CreateSourceFn func(context.Context, *platform.Source) error UpdateSourceFn func(context.Context, platform.ID, platform.SourceUpdate) (*platform.Source, error) DeleteSourceFn func(context.Context, platform.ID) error }
SourceService is a mock implementation of platform.SourceService.
func NewSourceService ¶
func NewSourceService() *SourceService
NewSourceService returns a mock of SourceService where its methods will return zero values.
func (*SourceService) CreateSource ¶
CreateSource sets the sources ID and stores it.
func (*SourceService) DefaultSource ¶
DefaultSource retrieves the default source.
func (*SourceService) DeleteSource ¶
DeleteSource removes the source.
func (*SourceService) FindSourceByID ¶
func (s *SourceService) FindSourceByID(ctx context.Context, id platform.ID) (*platform.Source, error)
FindSourceByID retrieves a source by its ID.
func (*SourceService) FindSources ¶
func (s *SourceService) FindSources(ctx context.Context, opts platform.FindOptions) ([]*platform.Source, int, error)
FindSources returns a list of all sources.
func (*SourceService) UpdateSource ¶
func (s *SourceService) UpdateSource(ctx context.Context, id platform.ID, upd platform.SourceUpdate) (*platform.Source, error)
UpdateSource updates the source.
type StorageReader ¶
type StorageReader struct { ReadFilterFn func(ctx context.Context, spec query.ReadFilterSpec, alloc *memory.Allocator) (query.TableIterator, error) ReadGroupFn func(ctx context.Context, spec query.ReadGroupSpec, alloc *memory.Allocator) (query.TableIterator, error) ReadTagKeysFn func(ctx context.Context, spec query.ReadTagKeysSpec, alloc *memory.Allocator) (query.TableIterator, error) ReadTagValuesFn func(ctx context.Context, spec query.ReadTagValuesSpec, alloc *memory.Allocator) (query.TableIterator, error) CloseFn func() }
func (*StorageReader) Close ¶
func (s *StorageReader) Close()
func (*StorageReader) ReadFilter ¶
func (s *StorageReader) ReadFilter(ctx context.Context, spec query.ReadFilterSpec, alloc *memory.Allocator) (query.TableIterator, error)
func (*StorageReader) ReadGroup ¶
func (s *StorageReader) ReadGroup(ctx context.Context, spec query.ReadGroupSpec, alloc *memory.Allocator) (query.TableIterator, error)
func (*StorageReader) ReadTagKeys ¶
func (s *StorageReader) ReadTagKeys(ctx context.Context, spec query.ReadTagKeysSpec, alloc *memory.Allocator) (query.TableIterator, error)
func (*StorageReader) ReadTagValues ¶
func (s *StorageReader) ReadTagValues(ctx context.Context, spec query.ReadTagValuesSpec, alloc *memory.Allocator) (query.TableIterator, error)
type Store ¶
type Store struct { ViewFn func(func(kv.Tx) error) error UpdateFn func(func(kv.Tx) error) error BackupFn func(ctx context.Context, w io.Writer) error }
Store is a mock kv.Store
type TaskControlService ¶
type TaskControlService struct { CreateRunFn func(ctx context.Context, taskID influxdb.ID, scheduledFor time.Time, runAt time.Time) (*influxdb.Run, error) CurrentlyRunningFn func(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error) ManualRunsFn func(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error) StartManualRunFn func(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error) FinishRunFn func(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error) UpdateRunStateFn func(ctx context.Context, taskID, runID influxdb.ID, when time.Time, state influxdb.RunStatus) error AddRunLogFn func(ctx context.Context, taskID, runID influxdb.ID, when time.Time, log string) error }
func (*TaskControlService) CurrentlyRunning ¶
func (tcs *TaskControlService) CurrentlyRunning(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error)
func (*TaskControlService) FinishRun ¶
func (tcs *TaskControlService) FinishRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
func (*TaskControlService) ManualRuns ¶
func (tcs *TaskControlService) ManualRuns(ctx context.Context, taskID influxdb.ID) ([]*influxdb.Run, error)
func (*TaskControlService) StartManualRun ¶
func (tcs *TaskControlService) StartManualRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
func (*TaskControlService) UpdateRunState ¶
type TaskService ¶
type TaskService struct { FindTaskByIDFn func(context.Context, influxdb.ID) (*influxdb.Task, error) FindTaskByIDCalls SafeCount FindTasksFn func(context.Context, influxdb.TaskFilter) ([]*influxdb.Task, int, error) FindTasksCalls SafeCount CreateTaskFn func(context.Context, influxdb.TaskCreate) (*influxdb.Task, error) CreateTaskCalls SafeCount UpdateTaskFn func(context.Context, influxdb.ID, influxdb.TaskUpdate) (*influxdb.Task, error) UpdateTaskCalls SafeCount DeleteTaskFn func(context.Context, influxdb.ID) error DeleteTaskCalls SafeCount FindLogsFn func(context.Context, influxdb.LogFilter) ([]*influxdb.Log, int, error) FindLogsCalls SafeCount FindRunsFn func(context.Context, influxdb.RunFilter) ([]*influxdb.Run, int, error) FindRunsCalls SafeCount FindRunByIDFn func(context.Context, influxdb.ID, influxdb.ID) (*influxdb.Run, error) FindRunByIDCalls SafeCount CancelRunFn func(context.Context, influxdb.ID, influxdb.ID) error CancelRunCalls SafeCount RetryRunFn func(context.Context, influxdb.ID, influxdb.ID) (*influxdb.Run, error) RetryRunCalls SafeCount ForceRunFn func(context.Context, influxdb.ID, int64) (*influxdb.Run, error) ForceRunCalls SafeCount }
func NewTaskService ¶
func NewTaskService() *TaskService
func (*TaskService) CancelRun ¶
func (s *TaskService) CancelRun(ctx context.Context, taskID, runID influxdb.ID) error
func (*TaskService) CreateTask ¶
func (s *TaskService) CreateTask(ctx context.Context, t influxdb.TaskCreate) (*influxdb.Task, error)
func (*TaskService) DeleteTask ¶
func (s *TaskService) DeleteTask(ctx context.Context, id influxdb.ID) error
func (*TaskService) FindLogs ¶
func (s *TaskService) FindLogs(ctx context.Context, filter influxdb.LogFilter) ([]*influxdb.Log, int, error)
func (*TaskService) FindRunByID ¶
func (s *TaskService) FindRunByID(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
func (*TaskService) FindRuns ¶
func (s *TaskService) FindRuns(ctx context.Context, filter influxdb.RunFilter) ([]*influxdb.Run, int, error)
func (*TaskService) FindTaskByID ¶
func (s *TaskService) FindTaskByID(ctx context.Context, id influxdb.ID) (*influxdb.Task, error)
func (*TaskService) FindTasks ¶
func (s *TaskService) FindTasks(ctx context.Context, filter influxdb.TaskFilter) ([]*influxdb.Task, int, error)
func (*TaskService) ForceRun ¶
func (s *TaskService) ForceRun(ctx context.Context, taskID influxdb.ID, scheduledFor int64) (*influxdb.Run, error)
func (*TaskService) RetryRun ¶
func (s *TaskService) RetryRun(ctx context.Context, taskID, runID influxdb.ID) (*influxdb.Run, error)
func (*TaskService) UpdateTask ¶
func (s *TaskService) UpdateTask(ctx context.Context, id influxdb.ID, upd influxdb.TaskUpdate) (*influxdb.Task, error)
type TelegrafConfigStore ¶
type TelegrafConfigStore struct { *UserResourceMappingService FindTelegrafConfigByIDF func(ctx context.Context, id platform.ID) (*platform.TelegrafConfig, error) FindTelegrafConfigByIDCalls SafeCount FindTelegrafConfigsF func(ctx context.Context, filter platform.TelegrafConfigFilter, opt ...platform.FindOptions) ([]*platform.TelegrafConfig, int, error) FindTelegrafConfigsCalls SafeCount CreateTelegrafConfigF func(ctx context.Context, tc *platform.TelegrafConfig, userID platform.ID) error CreateTelegrafConfigCalls SafeCount UpdateTelegrafConfigF func(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, userID platform.ID) (*platform.TelegrafConfig, error) UpdateTelegrafConfigCalls SafeCount DeleteTelegrafConfigF func(ctx context.Context, id platform.ID) error DeleteTelegrafConfigCalls SafeCount }
TelegrafConfigStore represents a service for managing telegraf config data.
func NewTelegrafConfigStore ¶
func NewTelegrafConfigStore() *TelegrafConfigStore
NewTelegrafConfigStore constructs a new fake TelegrafConfigStore.
func (*TelegrafConfigStore) CreateTelegrafConfig ¶
func (s *TelegrafConfigStore) CreateTelegrafConfig(ctx context.Context, tc *platform.TelegrafConfig, userID platform.ID) error
CreateTelegrafConfig creates a new telegraf config and sets b.ID with the new identifier.
func (*TelegrafConfigStore) DeleteTelegrafConfig ¶
DeleteTelegrafConfig removes a telegraf config by ID.
func (*TelegrafConfigStore) FindTelegrafConfigByID ¶
func (s *TelegrafConfigStore) FindTelegrafConfigByID(ctx context.Context, id platform.ID) (*platform.TelegrafConfig, error)
FindTelegrafConfigByID returns a single telegraf config by ID.
func (*TelegrafConfigStore) FindTelegrafConfigs ¶
func (s *TelegrafConfigStore) FindTelegrafConfigs(ctx context.Context, filter platform.TelegrafConfigFilter, opt ...platform.FindOptions) ([]*platform.TelegrafConfig, int, error)
FindTelegrafConfigs returns a list of telegraf configs that match filter and the total count of matching telegraf configs. Additional options provide pagination & sorting.
func (*TelegrafConfigStore) UpdateTelegrafConfig ¶
func (s *TelegrafConfigStore) UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, userID platform.ID) (*platform.TelegrafConfig, error)
UpdateTelegrafConfig updates a single telegraf config. Returns the new telegraf config after update.
type TimeGenerator ¶
TimeGenerator stores a fake value of time.
func (TimeGenerator) Now ¶
func (g TimeGenerator) Now() time.Time
Now will return the FakeValue stored in the struct.
type TokenGenerator ¶
TokenGenerator is mock implementation of influxdb.TokenGenerator.
func NewTokenGenerator ¶
func NewTokenGenerator(s string, err error) TokenGenerator
NewTokenGenerator is a simple way to create immutable token generator.
func (TokenGenerator) Token ¶
func (g TokenGenerator) Token() (string, error)
Token generates a new influxdb.Token from a mock function.
type Tx ¶
type Tx struct { BucketFn func(b []byte) (kv.Bucket, error) ContextFn func() context.Context WithContextFn func(ctx context.Context) }
Tx is mock of a kv.Tx.
func (*Tx) WithContext ¶
WithContext associates a context with this Tx.
type UserOperationLogService ¶
type UserOperationLogService struct {
GetUserOperationLogFn func(context.Context, platform.ID, platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
}
UserOperationLogService is a mock implementation of platform.UserOperationLogService.
func NewUserOperationLogService ¶
func NewUserOperationLogService() *UserOperationLogService
NewUserOperationLogService returns a mock of UserOperationLogService.
func (*UserOperationLogService) GetUserOperationLog ¶
func (s *UserOperationLogService) GetUserOperationLog(ctx context.Context, id platform.ID, opts platform.FindOptions) ([]*platform.OperationLogEntry, int, error)
GetUserOperationLog retrieves the operation log for the user with the provided id.
type UserResourceMappingService ¶
type UserResourceMappingService struct { FindMappingsFn func(context.Context, platform.UserResourceMappingFilter) ([]*platform.UserResourceMapping, int, error) CreateMappingFn func(context.Context, *platform.UserResourceMapping) error DeleteMappingFn func(context.Context, platform.ID, platform.ID) error }
UserResourceMappingService is a mock implementation of platform.UserResourceMappingService
func NewUserResourceMappingService ¶
func NewUserResourceMappingService() *UserResourceMappingService
NewUserResourceMappingService returns a mock of UserResourceMappingService where its methods will return zero values.
func (*UserResourceMappingService) CreateUserResourceMapping ¶
func (s *UserResourceMappingService) CreateUserResourceMapping(ctx context.Context, m *platform.UserResourceMapping) error
CreateUserResourceMapping creates a new UserResourceMapping.
func (*UserResourceMappingService) DeleteUserResourceMapping ¶
func (s *UserResourceMappingService) DeleteUserResourceMapping(ctx context.Context, resourceID platform.ID, userID platform.ID) error
DeleteUserResourceMapping removes a UserResourceMapping.
func (*UserResourceMappingService) FindUserResourceMappings ¶
func (s *UserResourceMappingService) FindUserResourceMappings(ctx context.Context, filter platform.UserResourceMappingFilter, opt ...platform.FindOptions) ([]*platform.UserResourceMapping, int, error)
FindUserResourceMappings finds mappings that match a given filter.
type UserService ¶
type UserService struct { // Methods for a platform.UserService FindUserByIDFn func(context.Context, platform.ID) (*platform.User, error) FindUsersFn func(context.Context, platform.UserFilter, ...platform.FindOptions) ([]*platform.User, int, error) CreateUserFn func(context.Context, *platform.User) error DeleteUserFn func(context.Context, platform.ID) error FindUserFn func(context.Context, platform.UserFilter) (*platform.User, error) UpdateUserFn func(context.Context, platform.ID, platform.UserUpdate) (*platform.User, error) FindPermissionForUserFn func(context.Context, platform.ID) (platform.PermissionSet, error) }
UserService is a mock implementation of a retention.UserService, which also makes it a suitable mock to use wherever an platform.UserService is required.
func NewUserService ¶
func NewUserService() *UserService
NewUserService returns a mock of UserService where its methods will return zero values.
func (*UserService) CreateUser ¶
CreateUser creates a new User and sets b.ID with the new identifier.
func (*UserService) DeleteUser ¶
DeleteUser removes a User by ID.
func (*UserService) FindPermissionForUser ¶
func (s *UserService) FindPermissionForUser(ctx context.Context, uid platform.ID) (platform.PermissionSet, error)
func (*UserService) FindUser ¶
func (s *UserService) FindUser(ctx context.Context, filter platform.UserFilter) (*platform.User, error)
FindUser finds the first user that matches a filter
func (*UserService) FindUserByID ¶
FindUserByID returns a single User by ID.
func (*UserService) FindUsers ¶
func (s *UserService) FindUsers(ctx context.Context, filter platform.UserFilter, opts ...platform.FindOptions) ([]*platform.User, int, error)
FindUsers returns a list of Users that match filter and the total count of matching Users.
func (*UserService) UpdateUser ¶
func (s *UserService) UpdateUser(ctx context.Context, id platform.ID, upd platform.UserUpdate) (*platform.User, error)
UpdateUser updates a user
type VariableService ¶
type VariableService struct { CreateVariableF func(context.Context, *influxdb.Variable) error CreateVariableCalls SafeCount DeleteVariableF func(context.Context, influxdb.ID) error DeleteVariableCalls SafeCount FindVariableByIDF func(context.Context, influxdb.ID) (*influxdb.Variable, error) FindVariableByIDCalls SafeCount FindVariablesF func(context.Context, influxdb.VariableFilter, ...influxdb.FindOptions) ([]*influxdb.Variable, error) FindVariablesCalls SafeCount ReplaceVariableF func(context.Context, *influxdb.Variable) error ReplaceVariableCalls SafeCount UpdateVariableF func(ctx context.Context, id influxdb.ID, update *influxdb.VariableUpdate) (*influxdb.Variable, error) UpdateVariableCalls SafeCount }
func NewVariableService ¶
func NewVariableService() *VariableService
NewVariableService returns a mock of VariableService where its methods will return zero values.
func (*VariableService) CreateVariable ¶
func (s *VariableService) CreateVariable(ctx context.Context, variable *influxdb.Variable) error
func (*VariableService) DeleteVariable ¶
func (s *VariableService) DeleteVariable(ctx context.Context, id influxdb.ID) error
func (*VariableService) FindVariableByID ¶
func (s *VariableService) FindVariableByID(ctx context.Context, id influxdb.ID) (*influxdb.Variable, error)
func (*VariableService) FindVariables ¶
func (s *VariableService) FindVariables(ctx context.Context, filter influxdb.VariableFilter, opts ...influxdb.FindOptions) ([]*influxdb.Variable, error)
func (*VariableService) ReplaceVariable ¶
func (s *VariableService) ReplaceVariable(ctx context.Context, variable *influxdb.Variable) error
func (*VariableService) UpdateVariable ¶
func (s *VariableService) UpdateVariable(ctx context.Context, id influxdb.ID, update *influxdb.VariableUpdate) (*influxdb.Variable, error)
type WindowAggregateStoreReader ¶
type WindowAggregateStoreReader struct { *StorageReader GetWindowAggregateCapabilityFn func(ctx context.Context) query.WindowAggregateCapability ReadWindowAggregateFn func(ctx context.Context, spec query.ReadWindowAggregateSpec, alloc *memory.Allocator) (query.TableIterator, error) }
func (*WindowAggregateStoreReader) GetWindowAggregateCapability ¶
func (s *WindowAggregateStoreReader) GetWindowAggregateCapability(ctx context.Context) query.WindowAggregateCapability
func (*WindowAggregateStoreReader) ReadWindowAggregate ¶
func (s *WindowAggregateStoreReader) ReadWindowAggregate(ctx context.Context, spec query.ReadWindowAggregateSpec, alloc *memory.Allocator) (query.TableIterator, error)
Source Files ¶
- auth_service.go
- authorization.go
- bucket_service.go
- check_service.go
- dashboard_service.go
- dbrp_mapping.go
- delete.go
- dependencies.go
- document_service.go
- flagger.go
- generators.go
- kv.go
- label_service.go
- lookup_service.go
- nats.go
- notification_endpoint_service.go
- notification_rule_store.go
- onboarding_service.go
- operation_log_service.go
- org_service.go
- paging.go
- passwords.go
- points_writer.go
- reader.go
- reads_resultset.go
- retention_service.go
- safe_count.go
- scraper_service.go
- secret_service.go
- session_service.go
- source_service.go
- task_service.go
- telegraf_service.go
- user_resource_mapping_service.go
- user_service.go
- variable_service.go
- write_service.go