Documentation ¶
Index ¶
- Constants
- func NewConfigWithFile(configFile string) error
- func NewConfigWithPaths() error
- type Component
- type ExecuteSyncFunc
- type Identifiable
- type InfraIntegrationArgs
- type LabsIntegration
- func NewInfraIntegration(name, id string, labsIntegrationOpts ...LabsIntegrationOpt) (*LabsIntegration, error)
- func NewLambdaIntegration(name, id, appName string, labsIntegrationOpts ...LabsIntegrationOpt) (*LabsIntegration, error)
- func NewStandaloneIntegration(name, id, appName string, labsIntegrationOpts ...LabsIntegrationOpt) (*LabsIntegration, error)
- func (i *LabsIntegration) AddComponent(c Component)
- func (i *LabsIntegration) AddEvent(ctx context.Context, eventType string, attributes map[string]interface{}) error
- func (i *LabsIntegration) AddEventImmediate(ctx context.Context, eventType string, attributes map[string]interface{}) error
- func (i *LabsIntegration) AddLastUpdateTimestamp(ctx context.Context, componentId string) error
- func (i *LabsIntegration) AddSchedule(crontab string, components []Component)
- func (i *LabsIntegration) GetAccountId() int
- func (i *LabsIntegration) GetApiKey() string
- func (i *LabsIntegration) GetLastUpdateTimestamp(ctx context.Context, componentId string) (*time.Time, error)
- func (i *LabsIntegration) GetLicenseKey() string
- func (i *LabsIntegration) GetRegion() region.Name
- func (i *LabsIntegration) Run(ctx context.Context) error
- func (i *LabsIntegration) Shutdown(ctx context.Context)
- func (i *LabsIntegration) UseLastUpdate(ctx context.Context, lastUpdateFunc LastUpdateFunc, componentId string) error
- type LabsIntegrationOpt
- func WithAccountId() LabsIntegrationOpt
- func WithApiKey() LabsIntegrationOpt
- func WithClient() LabsIntegrationOpt
- func WithEvents(ctx context.Context) LabsIntegrationOpt
- func WithInterval(defaultInterval int) LabsIntegrationOpt
- func WithLastUpdate() LabsIntegrationOpt
- func WithLicenseKey() LabsIntegrationOpt
- func WithLogs(ctx context.Context) LabsIntegrationOpt
- type LastUpdateFunc
- type SimpleComponent
- func (s *SimpleComponent) Execute(ctx context.Context) error
- func (s *SimpleComponent) ExecuteSync(ctx context.Context) error
- func (s *SimpleComponent) GetId() string
- func (t *SimpleComponent) Shutdown(ctx context.Context) error
- func (s *SimpleComponent) Start(ctx context.Context, wg *sync.WaitGroup) error
Constants ¶
View Source
const ( DEFAULT_INTERVAL = 60 LAST_UPDATE_EVENT_TYPE = "IntegrationLastUpdate" LAST_UPDATE_INTEGRATION_ID_ATTR_NAME = "integrationId" LAST_UPDATE_COMPONENT_ID_ATTR_NAME = "componentId" )
Variables ¶
This section is empty.
Functions ¶
func NewConfigWithFile ¶
func NewConfigWithPaths ¶
func NewConfigWithPaths() error
Types ¶
type ExecuteSyncFunc ¶ added in v2.1.0
type ExecuteSyncFunc func(ctx context.Context, li *LabsIntegration) error
type Identifiable ¶ added in v2.1.0
type Identifiable interface {
GetId() string
}
type InfraIntegrationArgs ¶
type InfraIntegrationArgs struct { nriSdkArgs.DefaultArgumentList ConfigPath string `help:"Path to configuration"` ShowVersion bool `default:"false" help:"Print build information and exit"` EnvPrefix string `default:"" help:"Prefix to use for environment variable lookup"` }
type LabsIntegration ¶
type LabsIntegration struct { Name string Id string BuildInfo build.BuildInfo App *newrelic.Application Integration *nriSdk.Integration Logger *logrus.Logger Interval time.Duration NrClient *nrClient.NewRelic RunAsService bool DryRun bool // contains filtered or unexported fields }
func NewInfraIntegration ¶
func NewInfraIntegration( name, id string, labsIntegrationOpts ...LabsIntegrationOpt, ) (*LabsIntegration, error)
func NewLambdaIntegration ¶
func NewLambdaIntegration( name, id, appName string, labsIntegrationOpts ...LabsIntegrationOpt, ) (*LabsIntegration, error)
func NewStandaloneIntegration ¶
func NewStandaloneIntegration( name, id, appName string, labsIntegrationOpts ...LabsIntegrationOpt, ) (*LabsIntegration, error)
func (*LabsIntegration) AddComponent ¶ added in v2.1.0
func (i *LabsIntegration) AddComponent( c Component, )
func (*LabsIntegration) AddEventImmediate ¶ added in v2.1.0
func (*LabsIntegration) AddLastUpdateTimestamp ¶ added in v2.1.0
func (i *LabsIntegration) AddLastUpdateTimestamp( ctx context.Context, componentId string, ) error
func (*LabsIntegration) AddSchedule ¶ added in v2.1.0
func (i *LabsIntegration) AddSchedule( crontab string, components []Component, )
func (*LabsIntegration) GetAccountId ¶ added in v2.1.0
func (i *LabsIntegration) GetAccountId() int
func (*LabsIntegration) GetApiKey ¶
func (i *LabsIntegration) GetApiKey() string
func (*LabsIntegration) GetLastUpdateTimestamp ¶ added in v2.1.0
func (*LabsIntegration) GetLicenseKey ¶
func (i *LabsIntegration) GetLicenseKey() string
func (*LabsIntegration) GetRegion ¶
func (i *LabsIntegration) GetRegion() region.Name
func (*LabsIntegration) Shutdown ¶
func (i *LabsIntegration) Shutdown(ctx context.Context)
func (*LabsIntegration) UseLastUpdate ¶ added in v2.1.0
func (i *LabsIntegration) UseLastUpdate( ctx context.Context, lastUpdateFunc LastUpdateFunc, componentId string, ) error
type LabsIntegrationOpt ¶
type LabsIntegrationOpt func(li *LabsIntegration) error
func WithAccountId ¶
func WithAccountId() LabsIntegrationOpt
func WithApiKey ¶
func WithApiKey() LabsIntegrationOpt
func WithClient ¶
func WithClient() LabsIntegrationOpt
func WithEvents ¶
func WithEvents(ctx context.Context) LabsIntegrationOpt
func WithInterval ¶
func WithInterval(defaultInterval int) LabsIntegrationOpt
func WithLastUpdate ¶ added in v2.1.0
func WithLastUpdate() LabsIntegrationOpt
func WithLicenseKey ¶
func WithLicenseKey() LabsIntegrationOpt
func WithLogs ¶
func WithLogs(ctx context.Context) LabsIntegrationOpt
type LastUpdateFunc ¶ added in v2.1.0
type SimpleComponent ¶ added in v2.1.0
type SimpleComponent struct {
// contains filtered or unexported fields
}
func NewSimpleComponent ¶ added in v2.1.0
func NewSimpleComponent( id string, i *LabsIntegration, executeFunc ExecuteSyncFunc, ) *SimpleComponent
func (*SimpleComponent) Execute ¶ added in v2.1.0
func (s *SimpleComponent) Execute( ctx context.Context, ) error
func (*SimpleComponent) ExecuteSync ¶ added in v2.1.0
func (s *SimpleComponent) ExecuteSync( ctx context.Context, ) error
func (*SimpleComponent) GetId ¶ added in v2.1.0
func (s *SimpleComponent) GetId() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.