Documentation ¶
Index ¶
- Variables
- func CorruptTelegrafError(err error) *influxdb.Error
- func ErrUnprocessableTelegraf(err error) *influxdb.Error
- func InternalTelegrafServiceError(err error) *influxdb.Error
- func UnavailableTelegrafServiceError(err error) *influxdb.Error
- type Service
- func (s *Service) CreateTelegrafConfig(ctx context.Context, tc *influxdb.TelegrafConfig, userID influxdb.ID) error
- func (s *Service) DeleteTelegrafConfig(ctx context.Context, id influxdb.ID) error
- func (s *Service) FindTelegrafConfigByID(ctx context.Context, id influxdb.ID) (*influxdb.TelegrafConfig, error)
- func (s *Service) FindTelegrafConfigs(ctx context.Context, filter influxdb.TelegrafConfigFilter, ...) (tcs []*influxdb.TelegrafConfig, n int, err error)
- func (s *Service) PutTelegrafConfig(ctx context.Context, tc *influxdb.TelegrafConfig) error
- func (s *Service) UpdateTelegrafConfig(ctx context.Context, id influxdb.ID, tc *influxdb.TelegrafConfig, ...) (*influxdb.TelegrafConfig, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTelegrafNotFound is used when the telegraf configuration is not found. ErrTelegrafNotFound = &influxdb.Error{ Msg: "telegraf configuration not found", Code: influxdb.ENotFound, } // ErrInvalidTelegrafID is used when the service was provided // an invalid ID format. ErrInvalidTelegrafID = &influxdb.Error{ Code: influxdb.EInvalid, Msg: "provided telegraf configuration ID has invalid format", } // ErrInvalidTelegrafOrgID is the error message for a missing or invalid organization ID. ErrInvalidTelegrafOrgID = &influxdb.Error{ Code: influxdb.EEmptyValue, Msg: "provided telegraf configuration organization ID is missing or invalid", } )
Functions ¶
func CorruptTelegrafError ¶
CorruptTelegrafError is used when the config cannot be unmarshalled from the bytes stored in the kv.
func ErrUnprocessableTelegraf ¶
ErrUnprocessableTelegraf is used when a telegraf is not able to be converted to JSON.
func InternalTelegrafServiceError ¶
InternalTelegrafServiceError is used when the error comes from an internal system.
func UnavailableTelegrafServiceError ¶
UnavailableTelegrafServiceError is used if we aren't able to interact with the store, it means the store is not available at the moment (e.g. network).
Types ¶
type Service ¶
type Service struct { IDGenerator influxdb.IDGenerator // contains filtered or unexported fields }
Service is a telegraf config service.
func (*Service) CreateTelegrafConfig ¶
func (s *Service) CreateTelegrafConfig(ctx context.Context, tc *influxdb.TelegrafConfig, userID influxdb.ID) error
CreateTelegrafConfig creates a new telegraf config and sets b.ID with the new identifier.
func (*Service) DeleteTelegrafConfig ¶
DeleteTelegrafConfig removes a telegraf config by ID.
func (*Service) FindTelegrafConfigByID ¶
func (s *Service) FindTelegrafConfigByID(ctx context.Context, id influxdb.ID) (*influxdb.TelegrafConfig, error)
FindTelegrafConfigByID returns a single telegraf config by ID.
func (*Service) FindTelegrafConfigs ¶
func (s *Service) FindTelegrafConfigs(ctx context.Context, filter influxdb.TelegrafConfigFilter, opt ...influxdb.FindOptions) (tcs []*influxdb.TelegrafConfig, n int, err 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 (*Service) PutTelegrafConfig ¶
PutTelegrafConfig put a telegraf config to storage.
func (*Service) UpdateTelegrafConfig ¶
func (s *Service) UpdateTelegrafConfig(ctx context.Context, id influxdb.ID, tc *influxdb.TelegrafConfig, userID influxdb.ID) (*influxdb.TelegrafConfig, error)
UpdateTelegrafConfig updates a single telegraf config. Returns the new telegraf config after update.