cmdintegration

package
v3.1.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package cmdintegration contains common code for export, validate-config, export-onboard-data. Mainly around configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentDelegateMinFactory

func AgentDelegateMinFactory(logger hclog.Logger, min AgentDelegateMinimal) func(exp expin.Export) rpcdef.Agent

Types

type AgentConfig

type AgentConfig struct {
	CustomerID   string `json:"customer_id"`
	PinpointRoot string `json:"pinpoint_root"`

	// SkipGit is a flag for skipping git repo cloning, ripsrc processing, useful when developing
	SkipGit bool `json:"skip_git"`
	// IntegrationsDir is a custom location of the integrations binaries
	IntegrationsDir string `json:"integrations_dir"`
	// DevUseCompiledIntegrations set to true to use compiled integrations in dev build. They are used by default in prod builds.
	DevUseCompiledIntegrations bool `json:"dev_use_compiled_integrations"`

	Backend struct {
		// Enable enables calls to pinpoint backend. It is disabled by default, but is required for the following features:
		// - sending progress data to backend
		// - using OAuth with refresh token
		Enable bool `json:"enable"`

		// ExportJobID is passed to backend in progress event
		ExportJobID string `json:"export_job_id"`
	} `json:"backend"`
}

func (AgentConfig) Locs

func (s AgentConfig) Locs() (res fsconf.Locs, _ error)

type AgentDelegateMinimal

type AgentDelegateMinimal interface {
	OAuthNewAccessToken(ind expin.Export) (token string, _ error)
}

type Command

type Command struct {
	Opts   Opts
	Logger hclog.Logger

	StartTime time.Time
	Locs      fsconf.Locs

	Integrations map[expin.Export]Integration

	EnrollConf agentconf.Config
	Deviceinfo deviceinfo.CommonInfo
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(opts Opts) (*Command, error)

func (*Command) CaptureShutdown

func (s *Command) CaptureShutdown()

func (*Command) CloseOnlyIntegrationAndHandlePanic

func (s *Command) CloseOnlyIntegrationAndHandlePanic(integration *iloader.Integration) error

func (*Command) OAuthNewAccessToken

func (s *Command) OAuthNewAccessToken(exp expin.Export) (accessToken string, _ error)

func (*Command) OnlyIntegration

func (s *Command) OnlyIntegration() Integration

func (*Command) SendPauseEvent

func (s *Command) SendPauseEvent(export expin.Export, msg string, resumeDate time.Time) error

func (*Command) SendResumeEvent

func (s *Command) SendResumeEvent(export expin.Export, msg string) error

func (*Command) SetupIntegrations

func (s *Command) SetupIntegrations(
	agentDelegates func(ind expin.Export) rpcdef.Agent) error

type Integration

type Integration struct {
	Export       expin.Export
	ExportConfig rpcdef.ExportConfig
	// OAuthRefreshTokens contains refresh token for integrations
	// using OAuth. These are allow getting new access tokens using
	// pinpoint backend. Do not pass them to integrations, these are handled in agent instead.
	OauthRefreshToken string

	ILoader *iloader.Integration
}

type Opts

type Opts struct {
	Logger       hclog.Logger
	AgentConfig  AgentConfig
	Integrations []inconfig.Integration
}

Jump to

Keyboard shortcuts

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