Documentation
¶
Index ¶
- func NewNats() (nats.Publisher, nats.Subscriber)
- 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) SetAuthorizationStatus(ctx context.Context, id platform.ID, status platform.Status) error
- type BasicAuthService
- func (s *BasicAuthService) CompareAndSetPassword(ctx context.Context, name string, old string, new string) error
- func (s *BasicAuthService) ComparePassword(ctx context.Context, name string, password string) error
- func (s *BasicAuthService) SetPassword(ctx context.Context, name string, password string) error
- 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) 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)
- func (s *BucketService) WithLogger(l *zap.Logger)
- type DBRPMappingService
- func (s *DBRPMappingService) Create(ctx context.Context, dbrpMap *platform.DBRPMapping) error
- func (s *DBRPMappingService) Delete(ctx context.Context, cluster string, db string, rp string) error
- func (s *DBRPMappingService) Find(ctx context.Context, filter platform.DBRPMappingFilter) (*platform.DBRPMapping, error)
- func (s *DBRPMappingService) FindBy(ctx context.Context, cluster string, db string, rp string) (*platform.DBRPMapping, error)
- func (s *DBRPMappingService) FindMany(ctx context.Context, filter platform.DBRPMappingFilter, ...) ([]*platform.DBRPMapping, int, 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 GroupCursor
- func (c *GroupCursor) Close()
- func (c *GroupCursor) Cursor() cursors.Cursor
- func (c *GroupCursor) Err() error
- func (c *GroupCursor) Keys() [][]byte
- func (c *GroupCursor) Next() bool
- func (c *GroupCursor) PartitionKeyVals() [][]byte
- func (c *GroupCursor) Stats() cursors.CursorStats
- func (c *GroupCursor) Tags() models.Tags
- type GroupResultSet
- type IDGenerator
- type IntegerArrayCursor
- type LabelService
- func (s *LabelService) CreateLabel(ctx context.Context, l *platform.Label) error
- func (s *LabelService) DeleteLabel(ctx context.Context, l platform.Label) error
- func (s *LabelService) FindLabels(ctx context.Context, filter platform.LabelFilter, opt ...platform.FindOptions) ([]*platform.Label, error)
- func (s *LabelService) UpdateLabel(ctx context.Context, l *platform.Label, upd platform.LabelUpdate) (*platform.Label, error)
- type LookupService
- type MacroService
- func (s *MacroService) CreateMacro(ctx context.Context, macro *platform.Macro) error
- func (s *MacroService) DeleteMacro(ctx context.Context, id platform.ID) error
- func (s *MacroService) FindMacroByID(ctx context.Context, id platform.ID) (*platform.Macro, error)
- func (s *MacroService) FindMacros(ctx context.Context) ([]*platform.Macro, error)
- func (s *MacroService) ReplaceMacro(ctx context.Context, macro *platform.Macro) error
- func (s *MacroService) UpdateMacro(ctx context.Context, id platform.ID, update *platform.MacroUpdate) (*platform.Macro, error)
- type NatsPublisher
- type NatsServer
- type NatsSubscriber
- type OnboardingService
- 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) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error)
- type PagingFilter
- type PointsWriter
- type ProtoService
- type ProxyQueryService
- type ResponseStream
- type ResultSet
- type RetentionService
- type ScraperTargetStoreService
- func (s *ScraperTargetStoreService) AddTarget(ctx context.Context, t *platform.ScraperTarget) error
- func (s *ScraperTargetStoreService) GetTargetByID(ctx context.Context, id platform.ID) (*platform.ScraperTarget, error)
- func (s *ScraperTargetStoreService) ListTargets(ctx context.Context) ([]platform.ScraperTarget, error)
- func (s *ScraperTargetStoreService) RemoveTarget(ctx context.Context, id platform.ID) error
- func (s *ScraperTargetStoreService) UpdateTarget(ctx context.Context, t *platform.ScraperTarget) (*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
- 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 TaskService
- func (s *TaskService) CancelRun(ctx context.Context, taskID, runID platform.ID) error
- func (s *TaskService) CreateTask(ctx context.Context, t *platform.Task) error
- func (s *TaskService) DeleteTask(ctx context.Context, id platform.ID) error
- func (s *TaskService) FindLogs(ctx context.Context, filter platform.LogFilter) ([]*platform.Log, int, error)
- func (s *TaskService) FindRunByID(ctx context.Context, taskID, runID platform.ID) (*platform.Run, error)
- func (s *TaskService) FindRuns(ctx context.Context, filter platform.RunFilter) ([]*platform.Run, int, error)
- func (s *TaskService) FindTaskByID(ctx context.Context, id platform.ID) (*platform.Task, error)
- func (s *TaskService) FindTasks(ctx context.Context, filter platform.TaskFilter) ([]*platform.Task, int, error)
- func (s *TaskService) ForceRun(ctx context.Context, taskID platform.ID, scheduledFor int64) (*platform.Run, error)
- func (s *TaskService) RetryRun(ctx context.Context, taskID, runID platform.ID) (*platform.Run, error)
- func (s *TaskService) UpdateTask(ctx context.Context, id platform.ID, upd platform.TaskUpdate) (*platform.Task, error)
- type TelegrafConfigStore
- func (s *TelegrafConfigStore) CreateTelegrafConfig(ctx context.Context, tc *platform.TelegrafConfig, userID platform.ID) error
- func (s *TelegrafConfigStore) CreateUserResourceMapping(ctx context.Context, m *platform.UserResourceMapping) error
- func (s *TelegrafConfigStore) DeleteTelegrafConfig(ctx context.Context, id platform.ID) error
- func (s *TelegrafConfigStore) DeleteUserResourceMapping(ctx context.Context, resourceID platform.ID, userID platform.ID) error
- func (s *TelegrafConfigStore) FindTelegrafConfig(ctx context.Context, filter platform.TelegrafConfigFilter) (*platform.TelegrafConfig, 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) FindUserResourceMappings(ctx context.Context, filter platform.UserResourceMappingFilter, ...) ([]*platform.UserResourceMapping, int, error)
- func (s *TelegrafConfigStore) UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, ...) (*platform.TelegrafConfig, error)
- type TokenGenerator
- 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) 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 ViewService
- func (s *ViewService) CreateView(ctx context.Context, b *platform.View) error
- func (s *ViewService) DeleteView(ctx context.Context, id platform.ID) error
- func (s *ViewService) FindViewByID(ctx context.Context, id platform.ID) (*platform.View, error)
- func (s *ViewService) FindViews(ctx context.Context, filter platform.ViewFilter) ([]*platform.View, int, error)
- func (s *ViewService) UpdateView(ctx context.Context, id platform.ID, upd platform.ViewUpdate) (*platform.View, error)
- type WriteService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthorizationService ¶
type AuthorizationService struct { // Methods for a retention.AuthorizationService OpenFn func() error CloseFn func() error WithLoggerFn func(l *zap.Logger) // 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 SetAuthorizationStatusFn func(context.Context, platform.ID, platform.Status) 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) SetAuthorizationStatus ¶
type BasicAuthService ¶
type BasicAuthService struct { SetPasswordFn func(context.Context, string, string) error ComparePasswordFn func(context.Context, string, string) error CompareAndSetPasswordFn func(context.Context, string, string, string) error }
BasicAuthService is a mock implementation of a retention.BasicAuthService, which also makes it a suitable mock to use wherever an platform.BasicAuthService is required.
func NewBasicAuthService ¶
func NewBasicAuthService(user, password string) *BasicAuthService
NewBasicAuthService returns a mock BasicAuthService where its methods will return zero values.
func (*BasicAuthService) CompareAndSetPassword ¶
func (s *BasicAuthService) CompareAndSetPassword(ctx context.Context, name string, old string, new string) error
CompareAndSetPassword compares the provided password and sets it to the new password.
func (*BasicAuthService) ComparePassword ¶
ComparePassword password compares the provided password.
func (*BasicAuthService) SetPassword ¶
SetPassword sets the users current password to be the provided password.
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 WithLoggerFn func(l *zap.Logger) // Methods for an platform.BucketService FindBucketByIDFn func(context.Context, platform.ID) (*platform.Bucket, error) FindBucketFn func(context.Context, platform.BucketFilter) (*platform.Bucket, error) FindBucketsFn func(context.Context, platform.BucketFilter, ...platform.FindOptions) ([]*platform.Bucket, int, error) CreateBucketFn func(context.Context, *platform.Bucket) error UpdateBucketFn func(context.Context, platform.ID, platform.BucketUpdate) (*platform.Bucket, error) DeleteBucketFn func(context.Context, platform.ID) error }
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) 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.
func (*BucketService) WithLogger ¶
func (s *BucketService) WithLogger(l *zap.Logger)
WithLogger sets the logger on the BucketService.
type DBRPMappingService ¶
type DBRPMappingService struct { FindByFn func(ctx context.Context, cluster string, db string, rp string) (*platform.DBRPMapping, error) FindFn func(ctx context.Context, filter platform.DBRPMappingFilter) (*platform.DBRPMapping, error) FindManyFn func(ctx context.Context, filter platform.DBRPMappingFilter, opt ...platform.FindOptions) ([]*platform.DBRPMapping, int, error) CreateFn func(ctx context.Context, dbrpMap *platform.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 *platform.DBRPMapping) error
func (*DBRPMappingService) Find ¶
func (s *DBRPMappingService) Find(ctx context.Context, filter platform.DBRPMappingFilter) (*platform.DBRPMapping, error)
func (*DBRPMappingService) FindBy ¶
func (s *DBRPMappingService) FindBy(ctx context.Context, cluster string, db string, rp string) (*platform.DBRPMapping, error)
func (*DBRPMappingService) FindMany ¶
func (s *DBRPMappingService) FindMany(ctx context.Context, filter platform.DBRPMappingFilter, opt ...platform.FindOptions) ([]*platform.DBRPMapping, int, 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 FindDashboardByIDF func(context.Context, platform.ID) (*platform.Dashboard, error) FindDashboardsF func(context.Context, platform.DashboardFilter, platform.FindOptions) ([]*platform.Dashboard, int, error) UpdateDashboardF func(context.Context, platform.ID, platform.DashboardUpdate) (*platform.Dashboard, error) DeleteDashboardF func(context.Context, platform.ID) error AddDashboardCellF func(ctx context.Context, id platform.ID, c *platform.Cell, opts platform.AddDashboardCellOptions) error RemoveDashboardCellF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID) error GetDashboardCellViewF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID) (*platform.View, error) UpdateDashboardCellViewF func(ctx context.Context, dashboardID platform.ID, cellID platform.ID, upd platform.ViewUpdate) (*platform.View, error) UpdateDashboardCellF func(ctx context.Context, dashbaordID platform.ID, cellID platform.ID, upd platform.CellUpdate) (*platform.Cell, error) CopyDashboardCellF func(ctx context.Context, dashbaordID platform.ID, cellID platform.ID) (*platform.Cell, error) ReplaceDashboardCellsF func(ctx context.Context, id platform.ID, cs []*platform.Cell) error }
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 GroupCursor ¶
type GroupCursor struct { NextFunc func() bool CursorFunc func() cursors.Cursor TagsFunc func() models.Tags KeysFunc func() [][]byte PartitionKeyValsFunc func() [][]byte CloseFunc func() ErrFunc func() error StatsFunc func() cursors.CursorStats }
func NewGroupCursor ¶
func NewGroupCursor() *GroupCursor
func (*GroupCursor) Close ¶
func (c *GroupCursor) Close()
func (*GroupCursor) Cursor ¶
func (c *GroupCursor) Cursor() cursors.Cursor
func (*GroupCursor) Err ¶
func (c *GroupCursor) Err() error
func (*GroupCursor) Keys ¶
func (c *GroupCursor) Keys() [][]byte
func (*GroupCursor) Next ¶
func (c *GroupCursor) Next() bool
func (*GroupCursor) PartitionKeyVals ¶
func (c *GroupCursor) PartitionKeyVals() [][]byte
func (*GroupCursor) Stats ¶
func (c *GroupCursor) Stats() cursors.CursorStats
func (*GroupCursor) Tags ¶
func (c *GroupCursor) Tags() models.Tags
type GroupResultSet ¶
type GroupResultSet struct { NextFunc func() reads.GroupCursor CloseFunc func() ErrFunc func() error }
func NewGroupResultSet ¶
func NewGroupResultSet() *GroupResultSet
func (*GroupResultSet) Close ¶
func (rs *GroupResultSet) Close()
func (*GroupResultSet) Err ¶
func (rs *GroupResultSet) Err() error
func (*GroupResultSet) Next ¶
func (rs *GroupResultSet) Next() reads.GroupCursor
type IDGenerator ¶
IDGenerator is mock implementation of platform.IDGenerator.
func NewIDGenerator ¶
func NewIDGenerator(s string, t *testing.T) IDGenerator
NewIDGenerator is a simple way to create immutable id generator
func (IDGenerator) ID ¶
func (g IDGenerator) ID() platform.ID
ID generates a new platform.ID from a mock function.
type IntegerArrayCursor ¶
type IntegerArrayCursor struct { CloseFunc func() Errfunc func() error StatsFunc func() cursors.CursorStats NextFunc func() *cursors.IntegerArray }
func NewIntegerArrayCursor ¶
func NewIntegerArrayCursor() *IntegerArrayCursor
func (*IntegerArrayCursor) Close ¶
func (c *IntegerArrayCursor) Close()
func (*IntegerArrayCursor) Err ¶
func (c *IntegerArrayCursor) Err() error
func (*IntegerArrayCursor) Next ¶
func (c *IntegerArrayCursor) Next() *cursors.IntegerArray
func (*IntegerArrayCursor) Stats ¶
func (c *IntegerArrayCursor) Stats() cursors.CursorStats
type LabelService ¶
type LabelService struct { FindLabelsFn func(context.Context, platform.LabelFilter) ([]*platform.Label, error) CreateLabelFn func(context.Context, *platform.Label) error UpdateLabelFn func(context.Context, *platform.Label, platform.LabelUpdate) (*platform.Label, error) DeleteLabelFn func(context.Context, platform.Label) error }
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) DeleteLabel ¶
DeleteLabel removes a Label.
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) UpdateLabel ¶
func (s *LabelService) UpdateLabel(ctx context.Context, l *platform.Label, upd platform.LabelUpdate) (*platform.Label, error)
UpdateLabel updates a label.
type LookupService ¶
type LookupService struct {
NameFn func(ctx context.Context, resource platform.Resource, id platform.ID) (string, error)
}
LookupService provides field lookup for the resource and ID.
type MacroService ¶
type MacroService struct { FindMacrosF func(context.Context) ([]*platform.Macro, error) FindMacroByIDF func(context.Context, platform.ID) (*platform.Macro, error) CreateMacroF func(context.Context, *platform.Macro) error UpdateMacroF func(ctx context.Context, id platform.ID, update *platform.MacroUpdate) (*platform.Macro, error) ReplaceMacroF func(context.Context, *platform.Macro) error DeleteMacroF func(context.Context, platform.ID) error }
func (*MacroService) CreateMacro ¶
func (*MacroService) DeleteMacro ¶
func (*MacroService) FindMacroByID ¶
func (*MacroService) FindMacros ¶
func (*MacroService) ReplaceMacro ¶
func (*MacroService) UpdateMacro ¶
func (s *MacroService) UpdateMacro(ctx context.Context, id platform.ID, update *platform.MacroUpdate) (*platform.Macro, error)
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 OnboardingService ¶
type OnboardingService struct { BasicAuthService BucketService OrganizationService UserService AuthorizationService IsOnboardingFn func(context.Context) (bool, error) GenerateFn 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) Generate ¶
func (s *OnboardingService) Generate(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error)
Generate OnboardingResults.
func (*OnboardingService) IsOnboarding ¶
func (s *OnboardingService) IsOnboarding(ctx context.Context) (bool, error)
IsOnboarding determine if onboarding request is allowed.
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 }
OrganizationService is a mock organization server.
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) 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 PointsWriter ¶
type PointsWriter struct { Points []models.Point Err 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(points []models.Point) error
WritePoints writes points to the PointsWriter that will be exposed in the Values.
type ProtoService ¶
type ProtoService struct { FindProtosFn func(context.Context) ([]*platform.Proto, error) CreateDashboardsFromProtoFn func(context.Context, platform.ID, platform.ID) ([]*platform.Dashboard, error) }
ProtoService is a mock implementation of a retention.ProtoService, which also makes it a suitable mock to use wherever an platform.ProtoService is required.
func (*ProtoService) CreateDashboardsFromProto ¶
func (s *ProtoService) CreateDashboardsFromProto(ctx context.Context, protoID, orgID platform.ID) ([]*platform.Dashboard, error)
CreateDashboardsFromProto creates a new set of dashboards for a proto
func (*ProtoService) FindProtos ¶
FindProtos returns a list of protos.
type ProxyQueryService ¶
type ProxyQueryService struct {
QueryFn func(context.Context, io.Writer, *query.ProxyRequest) (int64, error)
}
ProxyQueryService is a mock implementation of a query.ProxyQueryService.
func NewProxyQueryService ¶
func NewProxyQueryService() *ProxyQueryService
NewProxyQueryService returns a mock of ProxyQueryService where its methods will return zero values.
type ResponseStream ¶
type ResponseStream struct { SendFunc func(*datatypes.ReadResponse) error SetTrailerFunc func(metadata.MD) }
func NewResponseStream ¶
func NewResponseStream() *ResponseStream
func (*ResponseStream) Send ¶
func (s *ResponseStream) Send(r *datatypes.ReadResponse) error
func (*ResponseStream) SetTrailer ¶
func (s *ResponseStream) SetTrailer(m metadata.MD)
type ResultSet ¶
type ResultSet struct { NextFunc func() bool CursorFunc func() cursors.Cursor TagsFunc func() models.Tags CloseFunc func() ErrFunc func() error StatsFunc func() cursors.CursorStats }
func NewResultSet ¶
func NewResultSet() *ResultSet
func (*ResultSet) Stats ¶
func (rs *ResultSet) Stats() cursors.CursorStats
type RetentionService ¶
type RetentionService struct { WithLoggerFn func(l *zap.Logger) 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
func (*RetentionService) WithLogger ¶
func (s *RetentionService) WithLogger(log *zap.Logger)
type ScraperTargetStoreService ¶
type ScraperTargetStoreService struct { ListTargetsF func(ctx context.Context) ([]platform.ScraperTarget, error) AddTargetF func(ctx context.Context, t *platform.ScraperTarget) 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) (*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) 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) ([]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) (*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) }
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.
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 TaskService ¶
type TaskService struct { FindTaskByIDFn func(context.Context, platform.ID) (*platform.Task, error) FindTasksFn func(context.Context, platform.TaskFilter) ([]*platform.Task, int, error) CreateTaskFn func(context.Context, *platform.Task) error UpdateTaskFn func(context.Context, platform.ID, platform.TaskUpdate) (*platform.Task, error) DeleteTaskFn func(context.Context, platform.ID) error FindLogsFn func(context.Context, platform.LogFilter) ([]*platform.Log, int, error) FindRunsFn func(context.Context, platform.RunFilter) ([]*platform.Run, int, error) FindRunByIDFn func(context.Context, platform.ID, platform.ID) (*platform.Run, error) CancelRunFn func(context.Context, platform.ID, platform.ID) error RetryRunFn func(context.Context, platform.ID, platform.ID) (*platform.Run, error) ForceRunFn func(context.Context, platform.ID, int64) (*platform.Run, error) }
func (*TaskService) CreateTask ¶
func (*TaskService) DeleteTask ¶
func (*TaskService) FindRunByID ¶
func (*TaskService) FindTaskByID ¶
func (*TaskService) FindTasks ¶
func (s *TaskService) FindTasks(ctx context.Context, filter platform.TaskFilter) ([]*platform.Task, int, error)
func (*TaskService) UpdateTask ¶
func (s *TaskService) UpdateTask(ctx context.Context, id platform.ID, upd platform.TaskUpdate) (*platform.Task, error)
type TelegrafConfigStore ¶
type TelegrafConfigStore struct { FindUserResourceMappingsF func(ctx context.Context, filter platform.UserResourceMappingFilter, opt ...platform.FindOptions) ([]*platform.UserResourceMapping, int, error) CreateUserResourceMappingF func(ctx context.Context, m *platform.UserResourceMapping) error DeleteUserResourceMappingF func(ctx context.Context, resourceID platform.ID, userID platform.ID) error FindTelegrafConfigByIDF func(ctx context.Context, id platform.ID) (*platform.TelegrafConfig, error) FindTelegrafConfigF func(ctx context.Context, filter platform.TelegrafConfigFilter) (*platform.TelegrafConfig, error) FindTelegrafConfigsF func(ctx context.Context, filter platform.TelegrafConfigFilter, opt ...platform.FindOptions) ([]*platform.TelegrafConfig, int, error) CreateTelegrafConfigF func(ctx context.Context, tc *platform.TelegrafConfig, userID platform.ID) error UpdateTelegrafConfigF func(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, userID platform.ID) (*platform.TelegrafConfig, error) DeleteTelegrafConfigF func(ctx context.Context, id platform.ID) error }
TelegrafConfigStore represents a service for managing telegraf config data.
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) CreateUserResourceMapping ¶
func (s *TelegrafConfigStore) CreateUserResourceMapping(ctx context.Context, m *platform.UserResourceMapping) error
CreateUserResourceMapping creates a user resource mapping
func (*TelegrafConfigStore) DeleteTelegrafConfig ¶
DeleteTelegrafConfig removes a telegraf config by ID.
func (*TelegrafConfigStore) DeleteUserResourceMapping ¶
func (s *TelegrafConfigStore) DeleteUserResourceMapping(ctx context.Context, resourceID platform.ID, userID platform.ID) error
DeleteUserResourceMapping deletes a user resource mapping
func (*TelegrafConfigStore) FindTelegrafConfig ¶
func (s *TelegrafConfigStore) FindTelegrafConfig(ctx context.Context, filter platform.TelegrafConfigFilter) (*platform.TelegrafConfig, error)
FindTelegrafConfig returns the first telegraf config that matches filter.
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) FindUserResourceMappings ¶
func (s *TelegrafConfigStore) FindUserResourceMappings(ctx context.Context, filter platform.UserResourceMappingFilter, opt ...platform.FindOptions) ([]*platform.UserResourceMapping, int, error)
FindUserResourceMappings returns a list of UserResourceMappings that match filter and the total count of matching mappings.
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 TokenGenerator ¶
TokenGenerator is mock implementation of platform.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 platform.Token from a mock function.
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) }
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 NewUserService 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) 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 ViewService ¶
type ViewService struct { CreateViewF func(context.Context, *platform.View) error FindViewByIDF func(context.Context, platform.ID) (*platform.View, error) FindViewsF func(context.Context, platform.ViewFilter) ([]*platform.View, int, error) UpdateViewF func(context.Context, platform.ID, platform.ViewUpdate) (*platform.View, error) DeleteViewF func(context.Context, platform.ID) error }
func (*ViewService) CreateView ¶
func (*ViewService) DeleteView ¶
func (*ViewService) FindViewByID ¶
func (*ViewService) FindViews ¶
func (s *ViewService) FindViews(ctx context.Context, filter platform.ViewFilter) ([]*platform.View, int, error)
func (*ViewService) UpdateView ¶
func (s *ViewService) UpdateView(ctx context.Context, id platform.ID, upd platform.ViewUpdate) (*platform.View, error)
Source Files
¶
- auth_service.go
- basic_auth.go
- bucket_service.go
- dashboard_service.go
- dbrp_mapping.go
- generators.go
- label_service.go
- lookup_service.go
- macro_service.go
- nats.go
- onboarding_service.go
- operation_log_service.go
- org_service.go
- paging.go
- points_writer.go
- proto.go
- proxy_query_service.go
- retention_service.go
- scraper_service.go
- secret_service.go
- session_service.go
- source_service.go
- storage_reads.go
- task_service.go
- telegraf_service.go
- user_resource_mapping_service.go
- user_service.go
- view_service.go
- write_service.go