agent

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(options ...Option) (*Agent, error)

Creates a new Scope Agent instance

func (*Agent) Flush

func (a *Agent) Flush() error

Flushes the pending payloads to the scope backend

func (*Agent) Logger

func (a *Agent) Logger() *log.Logger

func (*Agent) PrintReport

func (a *Agent) PrintReport()

func (*Agent) SetTestingMode

func (a *Agent) SetTestingMode(enabled bool)

func (*Agent) Stop

func (a *Agent) Stop()

Stops the agent

func (*Agent) Tracer

func (a *Agent) Tracer() opentracing.Tracer

type Config

type Config struct {
	CurrentProfile string             `json:"currentProfile"`
	Profiles       map[string]Profile `json:"profiles"`
}

func GetConfig

func GetConfig() *Config

type DiffFileItem

type DiffFileItem struct {
	Path         string  `json:"path" msgpack:"path"`
	Added        int     `json:"added" msgpack:"added"`
	Removed      int     `json:"removed" msgpack:"removed"`
	Status       string  `json:"status" msgpack:"status"`
	PreviousPath *string `json:"previousPath" msgpack:"previousPath"`
}

type GitData

type GitData struct {
	Repository string
	Commit     string
	SourceRoot string
	Branch     string
}

type GitDiff

type GitDiff struct {
	Type    string         `json:"type" msgpack:"type"`
	Version string         `json:"version" msgpack:"version"`
	Uuid    string         `json:"uuid" msgpack:"uuid"`
	Files   []DiffFileItem `json:"files" msgpack:"files"`
}

type Option

type Option func(*Agent)

func WithAgentType

func WithAgentType(agentType string) Option

func WithApiEndpoint

func WithApiEndpoint(apiEndpoint string) Option

func WithApiKey

func WithApiKey(apiKey string) Option

func WithDebugEnabled

func WithDebugEnabled() Option

func WithGitInfo

func WithGitInfo(repository string, commitSha string, sourceRoot string) Option

func WithMetadata

func WithMetadata(values map[string]interface{}) Option

func WithServiceName

func WithServiceName(service string) Option

func WithSetGlobalTracer

func WithSetGlobalTracer() Option

func WithTestingModeEnabled

func WithTestingModeEnabled() Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

type Profile

type Profile struct {
	ApiEndpoint string `json:"apiEndpoint"`
	ApiKey      string `json:"apiKey"`
	OAuthToken  string `json:"oauthToken"`
}

func GetConfigCurrentProfile

func GetConfigCurrentProfile() *Profile

type SpanRecorder

type SpanRecorder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSpanRecorder

func NewSpanRecorder(agent *Agent) *SpanRecorder

func (*SpanRecorder) ChangeFlushFrequency

func (r *SpanRecorder) ChangeFlushFrequency(frequency time.Duration)

func (*SpanRecorder) RecordSpan

func (r *SpanRecorder) RecordSpan(span tracer.RawSpan)

Appends a span to the in-memory buffer for async processing

func (*SpanRecorder) SendSpans

func (r *SpanRecorder) SendSpans() error

Sends the spans in the buffer to Scope

Source Files

  • agent.go
  • ci.go
  • config.go
  • container.go
  • dependencies.go
  • git.go
  • ntp.go
  • recorder.go
  • report.go
  • util.go

Jump to

Keyboard shortcuts

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