Documentation ¶
Index ¶
- Constants
- Variables
- func NewService(st *Store) influxdb.LabelService
- type AuthedLabelService
- func (s *AuthedLabelService) CreateLabel(ctx context.Context, l *influxdb.Label) error
- func (s *AuthedLabelService) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *AuthedLabelService) DeleteLabel(ctx context.Context, id platform.ID) error
- func (s *AuthedLabelService) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *AuthedLabelService) FindLabelByID(ctx context.Context, id platform.ID) (*influxdb.Label, error)
- func (s *AuthedLabelService) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
- func (s *AuthedLabelService) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) ([]*influxdb.Label, error)
- func (s *AuthedLabelService) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
- type LabelClientService
- func (s *LabelClientService) CreateLabel(ctx context.Context, l *influxdb.Label) error
- func (s *LabelClientService) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *LabelClientService) DeleteLabel(ctx context.Context, id platform.ID) error
- func (s *LabelClientService) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *LabelClientService) FindLabelByID(ctx context.Context, id platform.ID) (*influxdb.Label, error)
- func (s *LabelClientService) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
- func (s *LabelClientService) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) ([]*influxdb.Label, error)
- func (s *LabelClientService) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
- type LabelEmbeddedHandler
- type LabelHandler
- type LabelLogger
- func (l *LabelLogger) CreateLabel(ctx context.Context, label *influxdb.Label) (err error)
- func (l *LabelLogger) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) (err error)
- func (l *LabelLogger) DeleteLabel(ctx context.Context, id platform.ID) (err error)
- func (l *LabelLogger) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) (err error)
- func (l *LabelLogger) FindLabelByID(ctx context.Context, id platform.ID) (label *influxdb.Label, err error)
- func (l *LabelLogger) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) (ls []*influxdb.Label, err error)
- func (l *LabelLogger) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) (ls []*influxdb.Label, err error)
- func (l *LabelLogger) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (lbl *influxdb.Label, err error)
- type LabelMetrics
- func (m *LabelMetrics) CreateLabel(ctx context.Context, l *influxdb.Label) (err error)
- func (m *LabelMetrics) CreateLabelMapping(ctx context.Context, lm *influxdb.LabelMapping) (err error)
- func (m *LabelMetrics) DeleteLabel(ctx context.Context, id platform.ID) (err error)
- func (m *LabelMetrics) DeleteLabelMapping(ctx context.Context, lm *influxdb.LabelMapping) (err error)
- func (m *LabelMetrics) FindLabelByID(ctx context.Context, id platform.ID) (label *influxdb.Label, err error)
- func (m *LabelMetrics) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) (ls []*influxdb.Label, err error)
- func (m *LabelMetrics) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) (ls []*influxdb.Label, err error)
- func (m *LabelMetrics) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (lbl *influxdb.Label, err error)
- type Service
- func (s *Service) CreateLabel(ctx context.Context, l *influxdb.Label) error
- func (s *Service) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *Service) DeleteLabel(ctx context.Context, id platform.ID) error
- func (s *Service) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
- func (s *Service) FindLabelByID(ctx context.Context, id platform.ID) (*influxdb.Label, error)
- func (s *Service) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
- func (s *Service) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) ([]*influxdb.Label, error)
- func (s *Service) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
- type Store
- func (s *Store) CreateLabel(ctx context.Context, tx kv.Tx, l *influxdb.Label) error
- func (s *Store) CreateLabelMapping(ctx context.Context, tx kv.Tx, m *influxdb.LabelMapping) error
- func (s *Store) DeleteLabel(ctx context.Context, tx kv.Tx, id platform.ID) error
- func (s *Store) DeleteLabelMapping(ctx context.Context, tx kv.Tx, m *influxdb.LabelMapping) error
- func (s *Store) FindResourceLabels(ctx context.Context, tx kv.Tx, filter influxdb.LabelMappingFilter, ...) error
- func (s *Store) GetLabel(ctx context.Context, tx kv.Tx, id platform.ID) (*influxdb.Label, error)
- func (s *Store) ListLabels(ctx context.Context, tx kv.Tx, filter influxdb.LabelFilter) ([]*influxdb.Label, error)
- func (s *Store) Update(ctx context.Context, fn func(kv.Tx) error) error
- func (s *Store) UpdateLabel(ctx context.Context, tx kv.Tx, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
- func (s *Store) View(ctx context.Context, fn func(kv.Tx) error) error
Constants ¶
const MaxIDGenerationN = 100
const ReservedIDs = 1000
Variables ¶
var ( // NotUniqueIDError occurs when attempting to create a Label with an ID that already belongs to another one NotUniqueIDError = &errors.Error{ Code: errors.EConflict, Msg: "ID already exists", } // ErrFailureGeneratingID occurs ony when the random number generator // cannot generate an ID in MaxIDGenerationN times. ErrFailureGeneratingID = &errors.Error{ Code: errors.EInternal, Msg: "unable to generate valid id", } // ErrLabelNotFound occurs when a label cannot be found by its ID ErrLabelNotFound = &errors.Error{ Code: errors.ENotFound, Msg: "label not found", } )
Functions ¶
func NewService ¶
func NewService(st *Store) influxdb.LabelService
Types ¶
type AuthedLabelService ¶
type AuthedLabelService struct {
// contains filtered or unexported fields
}
func NewAuthedLabelService ¶
func NewAuthedLabelService(s influxdb.LabelService, orgIDResolver authorizer.OrgIDResolver) *AuthedLabelService
NewAuthedLabelService constructs an instance of an authorizing label serivce.
func (*AuthedLabelService) CreateLabel ¶
func (s *AuthedLabelService) CreateLabel(ctx context.Context, l *influxdb.Label) error
func (*AuthedLabelService) CreateLabelMapping ¶
func (s *AuthedLabelService) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
CreateLabelMapping checks to see if the authorizer on context has write access to the label and the resource contained by the label mapping in creation.
func (*AuthedLabelService) DeleteLabel ¶
DeleteLabel checks to see if the authorizer on context has write access to the label provided.
func (*AuthedLabelService) DeleteLabelMapping ¶
func (s *AuthedLabelService) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
DeleteLabelMapping checks to see if the authorizer on context has write access to the label and the resource of the label mapping to delete.
func (*AuthedLabelService) FindLabelByID ¶
func (s *AuthedLabelService) FindLabelByID(ctx context.Context, id platform.ID) (*influxdb.Label, error)
FindLabelByID checks to see if the authorizer on context has read access to the label id provided.
func (*AuthedLabelService) FindLabels ¶
func (s *AuthedLabelService) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
func (*AuthedLabelService) FindResourceLabels ¶
func (s *AuthedLabelService) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) ([]*influxdb.Label, error)
FindResourceLabels retrieves all labels belonging to the filtering resource if the authorizer on context has read access to it. Then it filters the list down to only the labels that are authorized.
func (*AuthedLabelService) UpdateLabel ¶
func (s *AuthedLabelService) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
UpdateLabel checks to see if the authorizer on context has write access to the label provided.
type LabelClientService ¶
func (*LabelClientService) CreateLabel ¶
func (s *LabelClientService) CreateLabel(ctx context.Context, l *influxdb.Label) error
CreateLabel creates a new label.
func (*LabelClientService) CreateLabelMapping ¶
func (s *LabelClientService) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
CreateLabelMapping will create a label mapping
func (*LabelClientService) DeleteLabel ¶
DeleteLabel removes a label by ID.
func (*LabelClientService) DeleteLabelMapping ¶
func (s *LabelClientService) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error
func (*LabelClientService) FindLabelByID ¶
func (s *LabelClientService) FindLabelByID(ctx context.Context, id platform.ID) (*influxdb.Label, error)
FindLabelByID returns a single label by ID.
func (*LabelClientService) FindLabels ¶
func (s *LabelClientService) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
FindLabels is a client for the find labels response from the server.
func (*LabelClientService) FindResourceLabels ¶
func (s *LabelClientService) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) ([]*influxdb.Label, error)
FindResourceLabels returns a list of labels, derived from a label mapping filter.
func (*LabelClientService) UpdateLabel ¶
func (s *LabelClientService) UpdateLabel(ctx context.Context, id platform.ID, upd influxdb.LabelUpdate) (*influxdb.Label, error)
UpdateLabel updates a label and returns the updated label.
type LabelEmbeddedHandler ¶
func NewHTTPEmbeddedHandler ¶
func NewHTTPEmbeddedHandler(log *zap.Logger, rt influxdb.ResourceType, ls influxdb.LabelService) *LabelEmbeddedHandler
NewHTTPEmbeddedHandler create a label handler for embedding in other service apis
type LabelHandler ¶
func NewHTTPLabelHandler ¶
func NewHTTPLabelHandler(log *zap.Logger, ls influxdb.LabelService) *LabelHandler
func (*LabelHandler) Prefix ¶
func (h *LabelHandler) Prefix() string
type LabelLogger ¶
type LabelLogger struct {
// contains filtered or unexported fields
}
func NewLabelLogger ¶
func NewLabelLogger(log *zap.Logger, s influxdb.LabelService) *LabelLogger
func (*LabelLogger) CreateLabel ¶
func (l *LabelLogger) CreateLabel(ctx context.Context, label *influxdb.Label) (err error)
func (*LabelLogger) CreateLabelMapping ¶
func (l *LabelLogger) CreateLabelMapping(ctx context.Context, m *influxdb.LabelMapping) (err error)
func (*LabelLogger) DeleteLabel ¶
func (*LabelLogger) DeleteLabelMapping ¶
func (l *LabelLogger) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) (err error)
func (*LabelLogger) FindLabelByID ¶
func (*LabelLogger) FindLabels ¶
func (l *LabelLogger) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) (ls []*influxdb.Label, err error)
func (*LabelLogger) FindResourceLabels ¶
func (l *LabelLogger) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) (ls []*influxdb.Label, err error)
func (*LabelLogger) UpdateLabel ¶
type LabelMetrics ¶
type LabelMetrics struct {
// contains filtered or unexported fields
}
func NewLabelMetrics ¶
func NewLabelMetrics(reg prometheus.Registerer, s influxdb.LabelService, opts ...metric.ClientOptFn) *LabelMetrics
func (*LabelMetrics) CreateLabel ¶
func (m *LabelMetrics) CreateLabel(ctx context.Context, l *influxdb.Label) (err error)
func (*LabelMetrics) CreateLabelMapping ¶
func (m *LabelMetrics) CreateLabelMapping(ctx context.Context, lm *influxdb.LabelMapping) (err error)
func (*LabelMetrics) DeleteLabel ¶
func (*LabelMetrics) DeleteLabelMapping ¶
func (m *LabelMetrics) DeleteLabelMapping(ctx context.Context, lm *influxdb.LabelMapping) (err error)
func (*LabelMetrics) FindLabelByID ¶
func (*LabelMetrics) FindLabels ¶
func (m *LabelMetrics) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) (ls []*influxdb.Label, err error)
func (*LabelMetrics) FindResourceLabels ¶
func (m *LabelMetrics) FindResourceLabels(ctx context.Context, filter influxdb.LabelMappingFilter) (ls []*influxdb.Label, err error)
func (*LabelMetrics) UpdateLabel ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateLabel ¶
CreateLabel creates a new label.
func (*Service) CreateLabelMapping ¶
CreateLabelMapping creates a new mapping between a resource and a label.
func (*Service) DeleteLabel ¶
DeleteLabel deletes a label.
func (*Service) DeleteLabelMapping ¶
DeleteLabelMapping deletes a label mapping.
func (*Service) FindLabelByID ¶
FindLabelByID finds a label by its ID
func (*Service) FindLabels ¶
func (s *Service) FindLabels(ctx context.Context, filter influxdb.LabelFilter, opt ...influxdb.FindOptions) ([]*influxdb.Label, error)
FindLabels returns a list of labels that match a filter.
func (*Service) FindResourceLabels ¶
type Store ¶
type Store struct { IDGenerator platform.IDGenerator // contains filtered or unexported fields }