mock

package
v2.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package mock is a generated GoMock package.

Package mock is a generated GoMock package.

Package mock is a generated GoMock package.

Package mock is a generated GoMock package.

Index

Constants

View Source
const FirstMockID int = 65536

Variables

This section is empty.

Functions

func SetIDForFunc

func SetIDForFunc(gen *platform.IDGenerator, id platform.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, platform2.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, platform2.ID) error
	UpdateAuthorizationFn      func(context.Context, platform2.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

func (s *AuthorizationService) DeleteAuthorization(ctx context.Context, id platform2.ID) error

DeleteAuthorization removes a authorization by ID.

func (*AuthorizationService) FindAuthorizationByID

func (s *AuthorizationService) FindAuthorizationByID(ctx context.Context, id platform2.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

FindAuthorizations returns a list of authorizations that match filter and the total count of matching authorizations.

func (*AuthorizationService) UpdateAuthorization

UpdateAuthorization updates the status and description if available.

type Authorizer

type Authorizer struct {
	Permissions []influxdb.Permission
	AllowAll    bool
	UserID      platform.ID
}

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() platform.ID

func (*Authorizer) Identifier

func (a *Authorizer) Identifier() platform.ID

func (Authorizer) Kind

func (Authorizer) Kind() string

func (*Authorizer) PermissionSet

func (a *Authorizer) PermissionSet() (influxdb.PermissionSet, error)

type AuthorizerV1

type AuthorizerV1 struct {
	AuthorizeFn func(ctx context.Context, c influxdb.CredentialsV1) (*influxdb.Authorization, error)
}

func (*AuthorizerV1) Authorize

func (a *AuthorizerV1) Authorize(ctx context.Context, c influxdb.CredentialsV1) (*influxdb.Authorization, 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) Cursor

func (b *Bucket) Cursor(opts ...kv.CursorHint) (kv.Cursor, error)

Cursor returns a cursor at the beginning of this bucket.

func (*Bucket) Delete

func (b *Bucket) Delete(key []byte) error

Delete should error if the transaction it was called in is not writable.

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.

func (*Bucket) Get

func (b *Bucket) Get(key []byte) ([]byte, error)

Get returns a key within this bucket. Errors if key does not exist.

func (*Bucket) GetBatch

func (b *Bucket) GetBatch(keys ...[]byte) ([][]byte, error)

GetBatch returns a set of keys values within this bucket.

func (*Bucket) Put

func (b *Bucket) Put(key, value []byte) error

Put should error if the transaction it was called in is not writable.

type BucketLookup

type BucketLookup struct{}

BucketLookup implements the BucketLookup interface needed by flux "from" and "to".

func (BucketLookup) Lookup

func (BucketLookup) Lookup(_ context.Context, orgID platform2.ID, name string) (platform2.ID, bool)

func (BucketLookup) LookupName

func (BucketLookup) LookupName(_ context.Context, orgID platform2.ID, id platform2.ID) string

type BucketOperationLogService

type BucketOperationLogService struct {
	GetBucketOperationLogFn func(context.Context, platform2.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

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, platform2.ID) (*platform.Bucket, error)
	FindBucketByIDCalls   SafeCount
	FindBucketByNameFn    func(context.Context, platform2.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, platform2.ID, platform.BucketUpdate) (*platform.Bucket, error)
	UpdateBucketCalls     SafeCount
	DeleteBucketFn        func(context.Context, platform2.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) Close

func (s *BucketService) Close() error

Close closes the BucketService.

func (*BucketService) CreateBucket

func (s *BucketService) CreateBucket(ctx context.Context, bucket *platform.Bucket) error

CreateBucket creates a new bucket and sets b.ID with the new identifier.

func (*BucketService) DeleteBucket

func (s *BucketService) DeleteBucket(ctx context.Context, id platform2.ID) error

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 platform2.ID) (*platform.Bucket, error)

FindBucketByID returns a single bucket by ID.

func (*BucketService) FindBucketByName

func (s *BucketService) FindBucketByName(ctx context.Context, orgID platform2.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) Open

func (s *BucketService) Open() error

Open opens the BucketService.

func (*BucketService) UpdateBucket

func (s *BucketService) UpdateBucket(ctx context.Context, id platform2.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, platform.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, platform.ID) error
	CreateCheckCalls   SafeCount
	UpdateCheckFn      func(context.Context, platform.ID, influxdb.CheckCreate) (influxdb.Check, error)
	UpdateCheckCalls   SafeCount
	PatchCheckFn       func(context.Context, platform.ID, influxdb.CheckUpdate) (influxdb.Check, error)
	PatchCheckCalls    SafeCount
	DeleteCheckFn      func(context.Context, platform.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 platform.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 platform.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 platform.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 platform.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 platform.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.

func (*Cursor) First

func (c *Cursor) First() (k []byte, v []byte)

First moves the cursor to the first key in the bucket.

func (*Cursor) Last

func (c *Cursor) Last() (k []byte, v []byte)

Last moves the cursor to the last key in the bucket.

func (*Cursor) Next

func (c *Cursor) Next() (k []byte, v []byte)

Next moves the cursor to the next key in the bucket.

func (*Cursor) Prev

func (c *Cursor) Prev() (k []byte, v []byte)

Prev moves the cursor to the prev key in the bucket.

func (*Cursor) Seek

func (c *Cursor) Seek(prefix []byte) (k []byte, v []byte)

Seek moves the cursor forward until reaching prefix in the key name.

type DBRPMappingService

type DBRPMappingService struct {
	FindByIDFn func(ctx context.Context, orgID, id platform.ID) (*influxdb.DBRPMapping, error)
	FindManyFn func(ctx context.Context, dbrp influxdb.DBRPMappingFilter, opts ...influxdb.FindOptions) ([]*influxdb.DBRPMapping, int, error)
	CreateFn   func(ctx context.Context, dbrp *influxdb.DBRPMapping) error
	UpdateFn   func(ctx context.Context, dbrp *influxdb.DBRPMapping) error
	DeleteFn   func(ctx context.Context, orgID, id platform.ID) error
}

func (*DBRPMappingService) Create

func (s *DBRPMappingService) Create(ctx context.Context, dbrp *influxdb.DBRPMapping) error

func (*DBRPMappingService) Delete

func (s *DBRPMappingService) Delete(ctx context.Context, orgID, id platform.ID) error

func (*DBRPMappingService) FindByID added in v2.1.0

func (s *DBRPMappingService) FindByID(ctx context.Context, orgID, id platform.ID) (*influxdb.DBRPMapping, error)

func (*DBRPMappingService) FindMany

func (s *DBRPMappingService) FindMany(ctx context.Context, dbrp influxdb.DBRPMappingFilter, opts ...influxdb.FindOptions) ([]*influxdb.DBRPMapping, int, error)

func (*DBRPMappingService) Update added in v2.1.0

func (s *DBRPMappingService) Update(ctx context.Context, dbrp *influxdb.DBRPMapping) error

type DashboardOperationLogService

type DashboardOperationLogService struct {
	GetDashboardOperationLogFn func(context.Context, platform2.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

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, platform2.ID) (*platform.Dashboard, error)
	FindDashboardByIDCalls SafeCount
	FindDashboardsF        func(context.Context, platform.DashboardFilter, platform.FindOptions) ([]*platform.Dashboard, int, error)
	FindDashboardsCalls    SafeCount
	UpdateDashboardF       func(context.Context, platform2.ID, platform.DashboardUpdate) (*platform.Dashboard, error)
	UpdateDashboardCalls   SafeCount
	DeleteDashboardF       func(context.Context, platform2.ID) error
	DeleteDashboardCalls   SafeCount

	AddDashboardCellF            func(ctx context.Context, id platform2.ID, c *platform.Cell, opts platform.AddDashboardCellOptions) error
	AddDashboardCellCalls        SafeCount
	RemoveDashboardCellF         func(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID) error
	RemoveDashboardCellCalls     SafeCount
	GetDashboardCellViewF        func(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID) (*platform.View, error)
	GetDashboardCellViewCalls    SafeCount
	UpdateDashboardCellViewF     func(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID, upd platform.ViewUpdate) (*platform.View, error)
	UpdateDashboardCellViewCalls SafeCount
	UpdateDashboardCellF         func(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID, upd platform.CellUpdate) (*platform.Cell, error)
	UpdateDashboardCellCalls     SafeCount
	CopyDashboardCellF           func(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID) (*platform.Cell, error)
	CopyDashboardCellCalls       SafeCount
	ReplaceDashboardCellsF       func(ctx context.Context, id platform2.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 (*DashboardService) CopyDashboardCell

func (s *DashboardService) CopyDashboardCell(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID) (*platform.Cell, error)

func (*DashboardService) CreateDashboard

func (s *DashboardService) CreateDashboard(ctx context.Context, b *platform.Dashboard) error

func (*DashboardService) DeleteDashboard

func (s *DashboardService) DeleteDashboard(ctx context.Context, id platform2.ID) error

func (*DashboardService) FindDashboardByID

func (s *DashboardService) FindDashboardByID(ctx context.Context, id platform2.ID) (*platform.Dashboard, error)

func (*DashboardService) FindDashboards

func (*DashboardService) GetDashboardCellView

func (s *DashboardService) GetDashboardCellView(ctx context.Context, dashboardID, cellID platform2.ID) (*platform.View, error)

func (*DashboardService) RemoveDashboardCell

func (s *DashboardService) RemoveDashboardCell(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID) error

func (*DashboardService) ReplaceDashboardCells

func (s *DashboardService) ReplaceDashboardCells(ctx context.Context, id platform2.ID, cs []*platform.Cell) error

func (*DashboardService) UpdateDashboard

func (*DashboardService) UpdateDashboardCell

func (s *DashboardService) UpdateDashboardCell(ctx context.Context, dashboardID platform2.ID, cellID platform2.ID, upd platform.CellUpdate) (*platform.Cell, error)

func (*DashboardService) UpdateDashboardCellView

func (s *DashboardService) UpdateDashboardCellView(ctx context.Context, dashboardID, cellID platform2.ID, upd platform.ViewUpdate) (*platform.View, error)

type DeleteService

type DeleteService struct {
	DeleteBucketRangePredicateF func(tx context.Context, orgID, bucketID platform.ID, min, max int64, pred influxdb.Predicate, measurement influxql.Expr) 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 platform.ID, min, max int64, pred influxdb.Predicate, measurement influxql.Expr) 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 platform.ID) (*influxdb.Document, error)
	FindDocumentsFn  func(ctx context.Context, oid platform.ID) ([]*influxdb.Document, 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) FindDocument

func (s *DocumentStore) FindDocument(ctx context.Context, id platform.ID) (*influxdb.Document, error)

FindDocument will call the mocked FindDocumentFn.

func (*DocumentStore) FindDocuments

func (s *DocumentStore) FindDocuments(ctx context.Context, oid platform.ID) ([]*influxdb.Document, error)

FindDocuments will call the mocked FindDocumentsFn.

type Flagger

type Flagger struct {
	// contains filtered or unexported fields
}

Flagger is a mock.

func NewFlagger

func NewFlagger(flags map[feature.Flag]interface{}) *Flagger

NewFlagger returns a mock Flagger.

func (Flagger) Flags

func (f Flagger) Flags(context.Context, ...feature.Flag) (map[string]interface{}, error)

Flags returns a map of flag keys to flag values according to its configured flag map. It never returns an error.

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 (*GeneratorResultSet) Tags

func (g *GeneratorResultSet) Tags() models.Tags

type IDGenerator

type IDGenerator struct {
	IDFn func() platform.ID
}

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 platform.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 platform.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() platform.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, platform2.ID) error
	DeleteLabelCalls        SafeCount
	FindLabelByIDFn         func(ctx context.Context, id platform2.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, platform2.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

func (s *LabelService) CreateLabel(ctx context.Context, l *platform.Label) error

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

func (s *LabelService) DeleteLabel(ctx context.Context, id platform2.ID) error

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

func (s *LabelService) FindLabelByID(ctx context.Context, id platform2.ID) (*platform.Label, error)

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 platform2.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 platform2.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.

func (*LookupService) FindResourceName

func (s *LookupService) FindResourceName(ctx context.Context, resource platform.ResourceType, id platform2.ID) (string, error)

FindResourceName returns the name for the resource and ID.

type MockAnnotationService added in v2.1.0

type MockAnnotationService struct {
	// contains filtered or unexported fields
}

MockAnnotationService is a mock of AnnotationService interface

func NewMockAnnotationService added in v2.1.0

func NewMockAnnotationService(ctrl *gomock.Controller) *MockAnnotationService

NewMockAnnotationService creates a new mock instance

func (*MockAnnotationService) CreateAnnotations added in v2.1.0

func (m *MockAnnotationService) CreateAnnotations(ctx context.Context, orgID platform.ID, create []influxdb.AnnotationCreate) ([]influxdb.AnnotationEvent, error)

CreateAnnotations mocks base method

func (*MockAnnotationService) CreateOrUpdateStream added in v2.1.0

func (m *MockAnnotationService) CreateOrUpdateStream(ctx context.Context, orgID platform.ID, stream influxdb.Stream) (*influxdb.ReadStream, error)

CreateOrUpdateStream mocks base method

func (*MockAnnotationService) DeleteAnnotation added in v2.1.0

func (m *MockAnnotationService) DeleteAnnotation(ctx context.Context, id platform.ID) error

DeleteAnnotation mocks base method

func (*MockAnnotationService) DeleteAnnotations added in v2.1.0

func (m *MockAnnotationService) DeleteAnnotations(ctx context.Context, orgID platform.ID, delete influxdb.AnnotationDeleteFilter) error

DeleteAnnotations mocks base method

func (*MockAnnotationService) DeleteStreamByID added in v2.1.0

func (m *MockAnnotationService) DeleteStreamByID(ctx context.Context, id platform.ID) error

DeleteStreamByID mocks base method

func (*MockAnnotationService) DeleteStreams added in v2.1.0

func (m *MockAnnotationService) DeleteStreams(ctx context.Context, orgID platform.ID, delete influxdb.BasicStream) error

DeleteStreams mocks base method

func (*MockAnnotationService) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAnnotationService) GetAnnotation added in v2.1.0

GetAnnotation mocks base method

func (*MockAnnotationService) GetStream added in v2.1.0

GetStream mocks base method

func (*MockAnnotationService) ListAnnotations added in v2.1.0

ListAnnotations mocks base method

func (*MockAnnotationService) ListStreams added in v2.1.0

ListStreams mocks base method

func (*MockAnnotationService) UpdateAnnotation added in v2.1.0

UpdateAnnotation mocks base method

func (*MockAnnotationService) UpdateStream added in v2.1.0

func (m *MockAnnotationService) UpdateStream(ctx context.Context, id platform.ID, stream influxdb.Stream) (*influxdb.ReadStream, error)

UpdateStream mocks base method

type MockAnnotationServiceMockRecorder added in v2.1.0

type MockAnnotationServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockAnnotationServiceMockRecorder is the mock recorder for MockAnnotationService

func (*MockAnnotationServiceMockRecorder) CreateAnnotations added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) CreateAnnotations(ctx, orgID, create interface{}) *gomock.Call

CreateAnnotations indicates an expected call of CreateAnnotations

func (*MockAnnotationServiceMockRecorder) CreateOrUpdateStream added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) CreateOrUpdateStream(ctx, orgID, stream interface{}) *gomock.Call

CreateOrUpdateStream indicates an expected call of CreateOrUpdateStream

func (*MockAnnotationServiceMockRecorder) DeleteAnnotation added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) DeleteAnnotation(ctx, id interface{}) *gomock.Call

DeleteAnnotation indicates an expected call of DeleteAnnotation

func (*MockAnnotationServiceMockRecorder) DeleteAnnotations added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) DeleteAnnotations(ctx, orgID, delete interface{}) *gomock.Call

DeleteAnnotations indicates an expected call of DeleteAnnotations

func (*MockAnnotationServiceMockRecorder) DeleteStreamByID added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) DeleteStreamByID(ctx, id interface{}) *gomock.Call

DeleteStreamByID indicates an expected call of DeleteStreamByID

func (*MockAnnotationServiceMockRecorder) DeleteStreams added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) DeleteStreams(ctx, orgID, delete interface{}) *gomock.Call

DeleteStreams indicates an expected call of DeleteStreams

func (*MockAnnotationServiceMockRecorder) GetAnnotation added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) GetAnnotation(ctx, id interface{}) *gomock.Call

GetAnnotation indicates an expected call of GetAnnotation

func (*MockAnnotationServiceMockRecorder) GetStream added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) GetStream(ctx, id interface{}) *gomock.Call

GetStream indicates an expected call of GetStream

func (*MockAnnotationServiceMockRecorder) ListAnnotations added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) ListAnnotations(ctx, orgID, filter interface{}) *gomock.Call

ListAnnotations indicates an expected call of ListAnnotations

func (*MockAnnotationServiceMockRecorder) ListStreams added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) ListStreams(ctx, orgID, filter interface{}) *gomock.Call

ListStreams indicates an expected call of ListStreams

func (*MockAnnotationServiceMockRecorder) UpdateAnnotation added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) UpdateAnnotation(ctx, id, update interface{}) *gomock.Call

UpdateAnnotation indicates an expected call of UpdateAnnotation

func (*MockAnnotationServiceMockRecorder) UpdateStream added in v2.1.0

func (mr *MockAnnotationServiceMockRecorder) UpdateStream(ctx, id, stream interface{}) *gomock.Call

UpdateStream indicates an expected call of UpdateStream

type MockBackupService added in v2.1.0

type MockBackupService struct {
	// contains filtered or unexported fields
}

MockBackupService is a mock of BackupService interface.

func NewMockBackupService added in v2.1.0

func NewMockBackupService(ctrl *gomock.Controller) *MockBackupService

NewMockBackupService creates a new mock instance.

func (*MockBackupService) BackupKVStore added in v2.1.0

func (m *MockBackupService) BackupKVStore(ctx context.Context, w io.Writer) error

BackupKVStore mocks base method.

func (*MockBackupService) BackupShard added in v2.1.0

func (m *MockBackupService) BackupShard(ctx context.Context, w io.Writer, shardID uint64, since time.Time) error

BackupShard mocks base method.

func (*MockBackupService) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBackupService) RLockKVStore added in v2.1.0

func (m *MockBackupService) RLockKVStore()

LockKVStore mocks base method.

func (*MockBackupService) RUnlockKVStore added in v2.1.0

func (m *MockBackupService) RUnlockKVStore()

UnlockKVStore mocks base method.

type MockBackupServiceMockRecorder added in v2.1.0

type MockBackupServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockBackupServiceMockRecorder is the mock recorder for MockBackupService.

func (*MockBackupServiceMockRecorder) BackupKVStore added in v2.1.0

func (mr *MockBackupServiceMockRecorder) BackupKVStore(ctx, w interface{}) *gomock.Call

BackupKVStore indicates an expected call of BackupKVStore.

func (*MockBackupServiceMockRecorder) BackupShard added in v2.1.0

func (mr *MockBackupServiceMockRecorder) BackupShard(ctx, w, shardID, since interface{}) *gomock.Call

BackupShard indicates an expected call of BackupShard.

func (*MockBackupServiceMockRecorder) RLockKVStore added in v2.1.0

func (mr *MockBackupServiceMockRecorder) RLockKVStore() *gomock.Call

LockKVStore indicates an expected call of LockKVStore.

func (*MockBackupServiceMockRecorder) UnlockKVStore added in v2.1.0

func (mr *MockBackupServiceMockRecorder) UnlockKVStore() *gomock.Call

UnlockKVStore indicates an expected call of UnlockKVStore.

type MockBucketManifestWriter added in v2.1.0

type MockBucketManifestWriter struct {
	// contains filtered or unexported fields
}

MockBucketManifestWriter is a mock of BucketManifestWriter interface.

func NewMockBucketManifestWriter added in v2.1.0

func NewMockBucketManifestWriter(ctrl *gomock.Controller) *MockBucketManifestWriter

NewMockBucketManifestWriter creates a new mock instance.

func (*MockBucketManifestWriter) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBucketManifestWriter) WriteManifest added in v2.1.0

func (m *MockBucketManifestWriter) WriteManifest(ctx context.Context, w io.Writer) error

WriteManifest mocks base method.

type MockBucketManifestWriterMockRecorder added in v2.1.0

type MockBucketManifestWriterMockRecorder struct {
	// contains filtered or unexported fields
}

MockBucketManifestWriterMockRecorder is the mock recorder for MockBucketManifestWriter.

func (*MockBucketManifestWriterMockRecorder) WriteManifest added in v2.1.0

func (mr *MockBucketManifestWriterMockRecorder) WriteManifest(ctx, w interface{}) *gomock.Call

WriteManifest indicates an expected call of WriteManifest.

type MockIDGenerator

type MockIDGenerator struct {
	Last  *platform.ID
	Count int
}

func NewMockIDGenerator

func NewMockIDGenerator() *MockIDGenerator

func (*MockIDGenerator) ID

func (g *MockIDGenerator) ID() platform.ID

type MockNotebookService added in v2.1.0

type MockNotebookService struct {
	// contains filtered or unexported fields
}

MockNotebookService is a mock of NotebookService interface.

func NewMockNotebookService added in v2.1.0

func NewMockNotebookService(ctrl *gomock.Controller) *MockNotebookService

NewMockNotebookService creates a new mock instance.

func (*MockNotebookService) CreateNotebook added in v2.1.0

func (m *MockNotebookService) CreateNotebook(ctx context.Context, create *influxdb.NotebookReqBody) (*influxdb.Notebook, error)

CreateNotebook mocks base method.

func (*MockNotebookService) DeleteNotebook added in v2.1.0

func (m *MockNotebookService) DeleteNotebook(ctx context.Context, id platform.ID) error

DeleteNotebook mocks base method.

func (*MockNotebookService) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockNotebookService) GetNotebook added in v2.1.0

func (m *MockNotebookService) GetNotebook(ctx context.Context, id platform.ID) (*influxdb.Notebook, error)

GetNotebook mocks base method.

func (*MockNotebookService) ListNotebooks added in v2.1.0

ListNotebooks mocks base method.

func (*MockNotebookService) UpdateNotebook added in v2.1.0

func (m *MockNotebookService) UpdateNotebook(ctx context.Context, id platform.ID, update *influxdb.NotebookReqBody) (*influxdb.Notebook, error)

UpdateNotebook mocks base method.

type MockNotebookServiceMockRecorder added in v2.1.0

type MockNotebookServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockNotebookServiceMockRecorder is the mock recorder for MockNotebookService.

func (*MockNotebookServiceMockRecorder) CreateNotebook added in v2.1.0

func (mr *MockNotebookServiceMockRecorder) CreateNotebook(ctx, create interface{}) *gomock.Call

CreateNotebook indicates an expected call of CreateNotebook.

func (*MockNotebookServiceMockRecorder) DeleteNotebook added in v2.1.0

func (mr *MockNotebookServiceMockRecorder) DeleteNotebook(ctx, id interface{}) *gomock.Call

DeleteNotebook indicates an expected call of DeleteNotebook.

func (*MockNotebookServiceMockRecorder) GetNotebook added in v2.1.0

func (mr *MockNotebookServiceMockRecorder) GetNotebook(ctx, id interface{}) *gomock.Call

GetNotebook indicates an expected call of GetNotebook.

func (*MockNotebookServiceMockRecorder) ListNotebooks added in v2.1.0

func (mr *MockNotebookServiceMockRecorder) ListNotebooks(ctx, filter interface{}) *gomock.Call

ListNotebooks indicates an expected call of ListNotebooks.

func (*MockNotebookServiceMockRecorder) UpdateNotebook added in v2.1.0

func (mr *MockNotebookServiceMockRecorder) UpdateNotebook(ctx, id, update interface{}) *gomock.Call

UpdateNotebook indicates an expected call of UpdateNotebook.

type MockPasswordsService

type MockPasswordsService struct {
	// contains filtered or unexported fields
}

MockPasswordsService is a mock of PasswordsService interface

func NewMockPasswordsService

func NewMockPasswordsService(ctrl *gomock.Controller) *MockPasswordsService

NewMockPasswordsService creates a new mock instance

func (*MockPasswordsService) CompareAndSetPassword

func (m *MockPasswordsService) CompareAndSetPassword(arg0 context.Context, arg1 platform.ID, arg2, arg3 string) error

CompareAndSetPassword mocks base method

func (*MockPasswordsService) ComparePassword

func (m *MockPasswordsService) ComparePassword(arg0 context.Context, arg1 platform.ID, arg2 string) error

ComparePassword mocks base method

func (*MockPasswordsService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockPasswordsService) SetPassword

func (m *MockPasswordsService) SetPassword(arg0 context.Context, arg1 platform.ID, arg2 string) error

SetPassword mocks base method

type MockPasswordsServiceMockRecorder

type MockPasswordsServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockPasswordsServiceMockRecorder is the mock recorder for MockPasswordsService

func (*MockPasswordsServiceMockRecorder) CompareAndSetPassword

func (mr *MockPasswordsServiceMockRecorder) CompareAndSetPassword(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

CompareAndSetPassword indicates an expected call of CompareAndSetPassword

func (*MockPasswordsServiceMockRecorder) ComparePassword

func (mr *MockPasswordsServiceMockRecorder) ComparePassword(arg0, arg1, arg2 interface{}) *gomock.Call

ComparePassword indicates an expected call of ComparePassword

func (*MockPasswordsServiceMockRecorder) SetPassword

func (mr *MockPasswordsServiceMockRecorder) SetPassword(arg0, arg1, arg2 interface{}) *gomock.Call

SetPassword indicates an expected call of SetPassword

type MockRestoreService added in v2.1.0

type MockRestoreService struct {
	// contains filtered or unexported fields
}

MockRestoreService is a mock of RestoreService interface.

func NewMockRestoreService added in v2.1.0

func NewMockRestoreService(ctrl *gomock.Controller) *MockRestoreService

NewMockRestoreService creates a new mock instance.

func (*MockRestoreService) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRestoreService) RestoreBucket added in v2.1.0

func (m *MockRestoreService) RestoreBucket(ctx context.Context, id platform.ID, rpiData []byte) (map[uint64]uint64, error)

RestoreBucket mocks base method.

func (*MockRestoreService) RestoreKVStore added in v2.1.0

func (m *MockRestoreService) RestoreKVStore(ctx context.Context, r io.Reader) error

RestoreKVStore mocks base method.

func (*MockRestoreService) RestoreShard added in v2.1.0

func (m *MockRestoreService) RestoreShard(ctx context.Context, shardID uint64, r io.Reader) error

RestoreShard mocks base method.

type MockRestoreServiceMockRecorder added in v2.1.0

type MockRestoreServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockRestoreServiceMockRecorder is the mock recorder for MockRestoreService.

func (*MockRestoreServiceMockRecorder) RestoreBucket added in v2.1.0

func (mr *MockRestoreServiceMockRecorder) RestoreBucket(ctx, id, rpiData interface{}) *gomock.Call

RestoreBucket indicates an expected call of RestoreBucket.

func (*MockRestoreServiceMockRecorder) RestoreKVStore added in v2.1.0

func (mr *MockRestoreServiceMockRecorder) RestoreKVStore(ctx, r interface{}) *gomock.Call

RestoreKVStore indicates an expected call of RestoreKVStore.

func (*MockRestoreServiceMockRecorder) RestoreShard added in v2.1.0

func (mr *MockRestoreServiceMockRecorder) RestoreShard(ctx, shardID, r interface{}) *gomock.Call

RestoreShard indicates an expected call of RestoreShard.

type MockSqlBackupRestoreService added in v2.1.0

type MockSqlBackupRestoreService struct {
	// contains filtered or unexported fields
}

MockSqlBackupRestoreService is a mock of SqlBackupRestoreService interface.

func NewMockSqlBackupRestoreService added in v2.1.0

func NewMockSqlBackupRestoreService(ctrl *gomock.Controller) *MockSqlBackupRestoreService

NewMockSqlBackupRestoreService creates a new mock instance.

func (*MockSqlBackupRestoreService) BackupSqlStore added in v2.1.0

func (m *MockSqlBackupRestoreService) BackupSqlStore(ctx context.Context, w io.Writer) error

BackupSqlStore mocks base method.

func (*MockSqlBackupRestoreService) EXPECT added in v2.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSqlBackupRestoreService) RLockSqlStore added in v2.1.0

func (m *MockSqlBackupRestoreService) RLockSqlStore()

LockSqlStore mocks base method.

func (*MockSqlBackupRestoreService) RUnlockSqlStore added in v2.1.0

func (m *MockSqlBackupRestoreService) RUnlockSqlStore()

UnlockSqlStore mocks base method.

func (*MockSqlBackupRestoreService) RestoreSqlStore added in v2.1.0

func (m *MockSqlBackupRestoreService) RestoreSqlStore(ctx context.Context, r io.Reader) error

RestoreSqlStore mocks base method.

type MockSqlBackupRestoreServiceMockRecorder added in v2.1.0

type MockSqlBackupRestoreServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockSqlBackupRestoreServiceMockRecorder is the mock recorder for MockSqlBackupRestoreService.

func (*MockSqlBackupRestoreServiceMockRecorder) BackupSqlStore added in v2.1.0

func (mr *MockSqlBackupRestoreServiceMockRecorder) BackupSqlStore(ctx, w interface{}) *gomock.Call

BackupSqlStore indicates an expected call of BackupSqlStore.

func (*MockSqlBackupRestoreServiceMockRecorder) RLockSqlStore added in v2.1.0

LockSqlStore indicates an expected call of LockSqlStore.

func (*MockSqlBackupRestoreServiceMockRecorder) RUnlockSqlStore added in v2.1.0

func (mr *MockSqlBackupRestoreServiceMockRecorder) RUnlockSqlStore() *gomock.Call

UnlockSqlStore indicates an expected call of UnlockSqlStore.

func (*MockSqlBackupRestoreServiceMockRecorder) RestoreSqlStore added in v2.1.0

func (mr *MockSqlBackupRestoreServiceMockRecorder) RestoreSqlStore(ctx, r interface{}) *gomock.Call

RestoreSqlStore indicates an expected call of RestoreSqlStore.

type NotificationEndpointService

type NotificationEndpointService struct {
	*OrganizationService
	*UserResourceMappingService
	FindNotificationEndpointByIDF     func(ctx context.Context, id platform.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 platform.ID) error
	CreateNotificationEndpointCalls   SafeCount
	UpdateNotificationEndpointF       func(ctx context.Context, id platform.ID, nr influxdb.NotificationEndpoint, userID platform.ID) (influxdb.NotificationEndpoint, error)
	UpdateNotificationEndpointCalls   SafeCount
	PatchNotificationEndpointF        func(ctx context.Context, id platform.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error)
	PatchNotificationEndpointCalls    SafeCount
	DeleteNotificationEndpointF       func(ctx context.Context, id platform.ID) ([]influxdb.SecretField, platform.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 platform.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 platform.ID) ([]influxdb.SecretField, platform.ID, error)

DeleteNotificationEndpoint removes a notification rule by ID.

func (*NotificationEndpointService) FindNotificationEndpointByID

func (s *NotificationEndpointService) FindNotificationEndpointByID(ctx context.Context, id platform.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 platform.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 platform.ID, nr influxdb.NotificationEndpoint, userID platform.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 platform.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 platform.ID) error
	CreateNotificationRuleCalls   SafeCount
	UpdateNotificationRuleF       func(ctx context.Context, id platform.ID, nr influxdb.NotificationRuleCreate, userID platform.ID) (influxdb.NotificationRule, error)
	UpdateNotificationRuleCalls   SafeCount
	PatchNotificationRuleF        func(ctx context.Context, id platform.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
	PatchNotificationRuleCalls    SafeCount
	DeleteNotificationRuleF       func(ctx context.Context, id platform.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 platform.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 platform.ID) error

DeleteNotificationRule removes a notification rule by ID.

func (*NotificationRuleStore) FindNotificationRuleByID

func (s *NotificationRuleStore) FindNotificationRuleByID(ctx context.Context, id platform.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 platform.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 platform.ID, nr influxdb.NotificationRuleCreate, userID platform.ID) (influxdb.NotificationRule, error)

UpdateNotificationRule updates a single notification rule. Returns the new notification rule after update.

type OnboardingService

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

OnboardInitialUser OnboardingResults.

type OrganizationLookup

type OrganizationLookup struct{}

OrganizationLookup implements the OrganizationLookup interface needed by flux "from" and "to".

func (OrganizationLookup) Lookup

func (OrganizationLookup) LookupName

type OrganizationOperationLogService

type OrganizationOperationLogService struct {
	GetOrganizationOperationLogFn func(context.Context, platform2.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 platform2.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 platform2.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 platform2.ID, upd platform.OrganizationUpdate) (*platform.Organization, error)
	DeleteOrganizationF         func(ctx context.Context, id platform2.ID) error
	FindResourceOrganizationIDF func(ctx context.Context, rt platform.ResourceType, id platform2.ID) (platform2.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

func (s *OrganizationService) DeleteOrganization(ctx context.Context, id platform2.ID) error

DeleteOrganization calls DeleteOrganizationF.

func (*OrganizationService) FindOrganization

FindOrganization calls FindOrganizationF.

func (*OrganizationService) FindOrganizationByID

func (s *OrganizationService) FindOrganizationByID(ctx context.Context, id platform2.ID) (*platform.Organization, error)

FindOrganizationByID calls FindOrganizationByIDF.

func (*OrganizationService) FindOrganizations

FindOrganizations calls FindOrganizationsF.

func (*OrganizationService) FindResourceOrganizationID

func (s *OrganizationService) FindResourceOrganizationID(ctx context.Context, rt platform.ResourceType, id platform2.ID) (platform2.ID, error)

FindResourceOrganizationID calls FindResourceOrganizationIDF.

func (*OrganizationService) UpdateOrganization

UpdateOrganization calls UpdateOrganizationF.

type PagingFilter

type PagingFilter struct {
	Name string
	Type []string
}

func (PagingFilter) QueryParams

func (f PagingFilter) QueryParams() map[string][]string

type PasswordsService

type PasswordsService struct {
	SetPasswordFn           func(context.Context, platform.ID, string) error
	ComparePasswordFn       func(context.Context, platform.ID, string) error
	CompareAndSetPasswordFn func(context.Context, platform.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 platform.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 platform.ID, password string) error

ComparePassword password compares the provided password.

func (*PasswordsService) SetPassword

func (s *PasswordsService) SetPassword(ctx context.Context, userID platform.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 platform.ID, bucketID platform.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 platform.ID, bucketID platform.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 ReadsStore added in v2.0.9

type ReadsStore struct {
	ReadFilterFn                   func(ctx context.Context, req *datatypes.ReadFilterRequest) (reads.ResultSet, error)
	ReadGroupFn                    func(ctx context.Context, req *datatypes.ReadGroupRequest) (reads.GroupResultSet, error)
	WindowAggregateFn              func(ctx context.Context, req *datatypes.ReadWindowAggregateRequest) (reads.ResultSet, error)
	TagKeysFn                      func(ctx context.Context, req *datatypes.TagKeysRequest) (cursors.StringIterator, error)
	TagValuesFn                    func(ctx context.Context, req *datatypes.TagValuesRequest) (cursors.StringIterator, error)
	ReadSeriesCardinalityFn        func(ctx context.Context, req *datatypes.ReadSeriesCardinalityRequest) (cursors.Int64Iterator, error)
	SupportReadSeriesCardinalityFn func(ctx context.Context) bool
	GetSourceFn                    func(orgID, bucketID uint64) proto.Message
}

func (*ReadsStore) GetSource added in v2.0.9

func (s *ReadsStore) GetSource(orgID, bucketID uint64) proto.Message

func (*ReadsStore) ReadFilter added in v2.0.9

func (*ReadsStore) ReadGroup added in v2.0.9

func (*ReadsStore) ReadSeriesCardinality added in v2.0.9

func (*ReadsStore) SupportReadSeriesCardinality added in v2.0.9

func (s *ReadsStore) SupportReadSeriesCardinality(ctx context.Context) bool

func (*ReadsStore) TagKeys added in v2.0.9

func (*ReadsStore) TagValues added in v2.0.9

func (*ReadsStore) WindowAggregate added in v2.0.9

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.

func (*SafeCount) Count

func (s *SafeCount) Count() int

Count returns the current count.

func (*SafeCount) IncrFn

func (s *SafeCount) IncrFn() func()

IncrFn increments the safe counter by 1.

func (*SafeCount) Reset

func (s *SafeCount) Reset()

Reset will reset the count to 0.

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 platform2.ID) error
	GetTargetByIDF func(ctx context.Context, id platform2.ID) (*platform.ScraperTarget, error)
	RemoveTargetF  func(ctx context.Context, id platform2.ID) error
	UpdateTargetF  func(ctx context.Context, t *platform.ScraperTarget, userID platform2.ID) (*platform.ScraperTarget, error)
}

ScraperTargetStoreService is a mock implementation of a platform.ScraperTargetStoreService.

func (*ScraperTargetStoreService) AddTarget

AddTarget adds a scraper target.

func (*ScraperTargetStoreService) GetTargetByID

GetTargetByID retrieves a scraper target by id.

func (*ScraperTargetStoreService) ListTargets

ListTargets lists all the scraper targets.

func (*ScraperTargetStoreService) RemoveTarget

func (s *ScraperTargetStoreService) RemoveTarget(ctx context.Context, id platform2.ID) error

RemoveTarget deletes a scraper target.

func (*ScraperTargetStoreService) UpdateTarget

UpdateTarget updates a scraper target.

type SecretService

type SecretService struct {
	LoadSecretFn    func(ctx context.Context, orgID platform2.ID, k string) (string, error)
	GetSecretKeysFn func(ctx context.Context, orgID platform2.ID) ([]string, error)
	PutSecretFn     func(ctx context.Context, orgID platform2.ID, k string, v string) error
	PutSecretsFn    func(ctx context.Context, orgID platform2.ID, m map[string]string) error
	PatchSecretsFn  func(ctx context.Context, orgID platform2.ID, m map[string]string) error
	DeleteSecretFn  func(ctx context.Context, orgID platform2.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

func (s *SecretService) DeleteSecret(ctx context.Context, orgID platform2.ID, ks ...string) error

DeleteSecret removes a single secret from the secret store.

func (*SecretService) GetSecretKeys

func (s *SecretService) GetSecretKeys(ctx context.Context, orgID platform2.ID) ([]string, error)

GetSecretKeys retrieves all secret keys that are stored for the organization orgID.

func (*SecretService) LoadSecret

func (s *SecretService) LoadSecret(ctx context.Context, orgID platform2.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 platform2.ID, m map[string]string) error

PatchSecrets patches all provided secrets and updates any previous values.

func (*SecretService) PutSecret

func (s *SecretService) PutSecret(ctx context.Context, orgID platform2.ID, k string, v string) error

PutSecret stores the secret pair (k,v) for the organization orgID.

func (*SecretService) PutSecrets

func (s *SecretService) PutSecrets(ctx context.Context, orgID platform2.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

func (s *SessionService) CreateSession(ctx context.Context, user string) (*platform.Session, error)

CreateSession creates a session for a user with the users maximal privileges.

func (*SessionService) ExpireSession

func (s *SessionService) ExpireSession(ctx context.Context, key string) error

ExpireSession expires the session provided at key.

func (*SessionService) FindSession

func (s *SessionService) FindSession(ctx context.Context, key string) (*platform.Session, error)

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, platform2.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, platform2.ID, platform.SourceUpdate) (*platform.Source, error)
	DeleteSourceFn   func(context.Context, platform2.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

func (s *SourceService) CreateSource(ctx context.Context, source *platform.Source) error

CreateSource sets the sources ID and stores it.

func (*SourceService) DefaultSource

func (s *SourceService) DefaultSource(ctx context.Context) (*platform.Source, error)

DefaultSource retrieves the default source.

func (*SourceService) DeleteSource

func (s *SourceService) DeleteSource(ctx context.Context, id platform2.ID) error

DeleteSource removes the source.

func (*SourceService) FindSourceByID

func (s *SourceService) FindSourceByID(ctx context.Context, id platform2.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 platform2.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)
	ReadWindowAggregateFn          func(ctx context.Context, spec query.ReadWindowAggregateSpec, alloc memory.Allocator) (query.TableIterator, error)
	ReadSeriesCardinalityFn        func(ctx context.Context, spec query.ReadSeriesCardinalitySpec, alloc memory.Allocator) (query.TableIterator, error)
	SupportReadSeriesCardinalityFn func(ctx context.Context) bool
	CloseFn                        func()
}

func (*StorageReader) Close

func (s *StorageReader) Close()

func (*StorageReader) ReadFilter

func (*StorageReader) ReadGroup

func (*StorageReader) ReadSeriesCardinality added in v2.0.9

func (s *StorageReader) ReadSeriesCardinality(ctx context.Context, spec query.ReadSeriesCardinalitySpec, alloc memory.Allocator) (query.TableIterator, error)

func (*StorageReader) ReadTagKeys

func (*StorageReader) ReadTagValues

func (*StorageReader) ReadWindowAggregate

func (s *StorageReader) ReadWindowAggregate(ctx context.Context, spec query.ReadWindowAggregateSpec, alloc memory.Allocator) (query.TableIterator, error)

func (*StorageReader) SupportReadSeriesCardinality added in v2.0.9

func (s *StorageReader) SupportReadSeriesCardinality(ctx context.Context) bool

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
	RestoreFn func(ctx context.Context, r io.Reader) error
}

Store is a mock kv.Store

func (*Store) Backup

func (s *Store) Backup(ctx context.Context, w io.Writer) error

func (*Store) RLock added in v2.1.0

func (s *Store) RLock()

RLock and RUnlock methods are to satisfy the kv.Store interface

func (*Store) RUnlock added in v2.1.0

func (s *Store) RUnlock()

func (*Store) Restore

func (s *Store) Restore(ctx context.Context, r io.Reader) error

func (*Store) Update

func (s *Store) Update(ctx context.Context, fn func(kv.Tx) error) error

Update opens up a transaction that will mutate data.

func (*Store) View

func (s *Store) View(ctx context.Context, fn func(kv.Tx) error) error

View opens up a transaction that will not write to any data. Implementing interfaces should take care to ensure that all view transactions do not mutate any data.

type TaskControlService

type TaskControlService struct {
	CreateRunFn        func(ctx context.Context, taskID platform.ID, scheduledFor time.Time, runAt time.Time) (*taskmodel.Run, error)
	CurrentlyRunningFn func(ctx context.Context, taskID platform.ID) ([]*taskmodel.Run, error)
	ManualRunsFn       func(ctx context.Context, taskID platform.ID) ([]*taskmodel.Run, error)
	StartManualRunFn   func(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)
	FinishRunFn        func(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)
	UpdateRunStateFn   func(ctx context.Context, taskID, runID platform.ID, when time.Time, state taskmodel.RunStatus) error
	AddRunLogFn        func(ctx context.Context, taskID, runID platform.ID, when time.Time, log string) error
}

func (*TaskControlService) AddRunLog

func (tcs *TaskControlService) AddRunLog(ctx context.Context, taskID, runID platform.ID, when time.Time, log string) error

func (*TaskControlService) CreateRun

func (tcs *TaskControlService) CreateRun(ctx context.Context, taskID platform.ID, scheduledFor time.Time, runAt time.Time) (*taskmodel.Run, error)

func (*TaskControlService) CurrentlyRunning

func (tcs *TaskControlService) CurrentlyRunning(ctx context.Context, taskID platform.ID) ([]*taskmodel.Run, error)

func (*TaskControlService) FinishRun

func (tcs *TaskControlService) FinishRun(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)

func (*TaskControlService) ManualRuns

func (tcs *TaskControlService) ManualRuns(ctx context.Context, taskID platform.ID) ([]*taskmodel.Run, error)

func (*TaskControlService) StartManualRun

func (tcs *TaskControlService) StartManualRun(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)

func (*TaskControlService) UpdateRunState

func (tcs *TaskControlService) UpdateRunState(ctx context.Context, taskID, runID platform.ID, when time.Time, state taskmodel.RunStatus) error

type TaskService

type TaskService struct {
	FindTaskByIDFn    func(context.Context, platform.ID) (*taskmodel.Task, error)
	FindTaskByIDCalls SafeCount
	FindTasksFn       func(context.Context, taskmodel.TaskFilter) ([]*taskmodel.Task, int, error)
	FindTasksCalls    SafeCount
	CreateTaskFn      func(context.Context, taskmodel.TaskCreate) (*taskmodel.Task, error)
	CreateTaskCalls   SafeCount
	UpdateTaskFn      func(context.Context, platform.ID, taskmodel.TaskUpdate) (*taskmodel.Task, error)
	UpdateTaskCalls   SafeCount
	DeleteTaskFn      func(context.Context, platform.ID) error
	DeleteTaskCalls   SafeCount
	FindLogsFn        func(context.Context, taskmodel.LogFilter) ([]*taskmodel.Log, int, error)
	FindLogsCalls     SafeCount
	FindRunsFn        func(context.Context, taskmodel.RunFilter) ([]*taskmodel.Run, int, error)
	FindRunsCalls     SafeCount
	FindRunByIDFn     func(context.Context, platform.ID, platform.ID) (*taskmodel.Run, error)
	FindRunByIDCalls  SafeCount
	CancelRunFn       func(context.Context, platform.ID, platform.ID) error
	CancelRunCalls    SafeCount
	RetryRunFn        func(context.Context, platform.ID, platform.ID) (*taskmodel.Run, error)
	RetryRunCalls     SafeCount
	ForceRunFn        func(context.Context, platform.ID, int64) (*taskmodel.Run, error)
	ForceRunCalls     SafeCount
}

func NewTaskService

func NewTaskService() *TaskService

func (*TaskService) CancelRun

func (s *TaskService) CancelRun(ctx context.Context, taskID, runID platform.ID) error

func (*TaskService) CreateTask

func (s *TaskService) CreateTask(ctx context.Context, t taskmodel.TaskCreate) (*taskmodel.Task, error)

func (*TaskService) DeleteTask

func (s *TaskService) DeleteTask(ctx context.Context, id platform.ID) error

func (*TaskService) FindLogs

func (s *TaskService) FindLogs(ctx context.Context, filter taskmodel.LogFilter) ([]*taskmodel.Log, int, error)

func (*TaskService) FindRunByID

func (s *TaskService) FindRunByID(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)

func (*TaskService) FindRuns

func (s *TaskService) FindRuns(ctx context.Context, filter taskmodel.RunFilter) ([]*taskmodel.Run, int, error)

func (*TaskService) FindTaskByID

func (s *TaskService) FindTaskByID(ctx context.Context, id platform.ID) (*taskmodel.Task, error)

func (*TaskService) FindTasks

func (s *TaskService) FindTasks(ctx context.Context, filter taskmodel.TaskFilter) ([]*taskmodel.Task, int, error)

func (*TaskService) ForceRun

func (s *TaskService) ForceRun(ctx context.Context, taskID platform.ID, scheduledFor int64) (*taskmodel.Run, error)

func (*TaskService) RetryRun

func (s *TaskService) RetryRun(ctx context.Context, taskID, runID platform.ID) (*taskmodel.Run, error)

func (*TaskService) UpdateTask

func (s *TaskService) UpdateTask(ctx context.Context, id platform.ID, upd taskmodel.TaskUpdate) (*taskmodel.Task, error)

type TelegrafConfigStore

type TelegrafConfigStore struct {
	*UserResourceMappingService
	FindTelegrafConfigByIDF     func(ctx context.Context, id platform2.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 platform2.ID) error
	CreateTelegrafConfigCalls   SafeCount
	UpdateTelegrafConfigF       func(ctx context.Context, id platform2.ID, tc *platform.TelegrafConfig, userID platform2.ID) (*platform.TelegrafConfig, error)
	UpdateTelegrafConfigCalls   SafeCount
	DeleteTelegrafConfigF       func(ctx context.Context, id platform2.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 platform2.ID) error

CreateTelegrafConfig creates a new telegraf config and sets b.ID with the new identifier.

func (*TelegrafConfigStore) DeleteTelegrafConfig

func (s *TelegrafConfigStore) DeleteTelegrafConfig(ctx context.Context, id platform2.ID) error

DeleteTelegrafConfig removes a telegraf config by ID.

func (*TelegrafConfigStore) FindTelegrafConfigByID

func (s *TelegrafConfigStore) FindTelegrafConfigByID(ctx context.Context, id platform2.ID) (*platform.TelegrafConfig, error)

FindTelegrafConfigByID returns a single telegraf config by ID.

func (*TelegrafConfigStore) FindTelegrafConfigs

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 platform2.ID, tc *platform.TelegrafConfig, userID platform2.ID) (*platform.TelegrafConfig, error)

UpdateTelegrafConfig updates a single telegraf config. Returns the new telegraf config after update.

type TimeGenerator

type TimeGenerator struct {
	FakeValue time.Time
}

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

type TokenGenerator struct {
	TokenFn func() (string, error)
}

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) Bucket

func (t *Tx) Bucket(b []byte) (kv.Bucket, error)

Bucket possibly creates and returns bucket, b.

func (*Tx) Context

func (t *Tx) Context() context.Context

Context returns the context associated with this Tx.

func (*Tx) WithContext

func (t *Tx) WithContext(ctx context.Context)

WithContext associates a context with this Tx.

type UserOperationLogService

type UserOperationLogService struct {
	GetUserOperationLogFn func(context.Context, platform2.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

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, platform2.ID, platform2.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 platform2.ID, userID platform2.ID) error

DeleteUserResourceMapping removes a UserResourceMapping.

func (*UserResourceMappingService) FindUserResourceMappings

FindUserResourceMappings finds mappings that match a given filter.

type UserService

type UserService struct {
	// Methods for a platform.UserService
	FindUserByIDFn          func(context.Context, platform2.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, platform2.ID) error
	FindUserFn              func(context.Context, platform.UserFilter) (*platform.User, error)
	UpdateUserFn            func(context.Context, platform2.ID, platform.UserUpdate) (*platform.User, error)
	FindPermissionForUserFn func(context.Context, platform2.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

func (s *UserService) CreateUser(ctx context.Context, User *platform.User) error

CreateUser creates a new User and sets b.ID with the new identifier.

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(ctx context.Context, id platform2.ID) error

DeleteUser removes a User by ID.

func (*UserService) FindPermissionForUser

func (s *UserService) FindPermissionForUser(ctx context.Context, uid platform2.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

func (s *UserService) FindUserByID(ctx context.Context, id platform2.ID) (*platform.User, error)

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 platform2.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, platform.ID) error
	DeleteVariableCalls   SafeCount
	FindVariableByIDF     func(context.Context, platform.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 platform.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 platform.ID) error

func (*VariableService) FindVariableByID

func (s *VariableService) FindVariableByID(ctx context.Context, id platform.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 platform.ID, update *influxdb.VariableUpdate) (*influxdb.Variable, error)

type WriteService

type WriteService struct {
	WriteToF func(context.Context, platform.BucketFilter, io.Reader) error
}

WriteService writes data read from the reader.

func (*WriteService) WriteTo

func (s *WriteService) WriteTo(ctx context.Context, filter platform.BucketFilter, r io.Reader) error

WriteTo calls the mocked WriteToF function with arguments.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL