logs

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 16 Imported by: 32

Documentation

Overview

Package logs implements decision log buffering and uploading.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Service       string          `json:"service"`
	PartitionName string          `json:"partition_name,omitempty"`
	Reporting     ReportingConfig `json:"reporting"`
}

Config represents the plugin configuration.

type EventV1

type EventV1 struct {
	Labels      map[string]string `json:"labels"`
	DecisionID  string            `json:"decision_id"`
	Revision    string            `json:"revision,omitempty"`
	Path        string            `json:"path"`
	Input       *interface{}      `json:"input,omitempty"`
	Result      *interface{}      `json:"result,omitempty"`
	RequestedBy string            `json:"requested_by"`
	Timestamp   time.Time         `json:"timestamp"`
}

EventV1 represents a decision log event.

type Plugin

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

Plugin implements decision log buffering and uploading.

func New

func New(config []byte, manager *plugins.Manager) (*Plugin, error)

New returns a new Plugin with the given config.

func (*Plugin) Log

func (p *Plugin) Log(ctx context.Context, decision *server.Info)

Log appends a decision log event to the buffer for uploading.

func (*Plugin) Start

func (p *Plugin) Start(ctx context.Context) error

Start starts the plugin.

func (*Plugin) Stop

func (p *Plugin) Stop(ctx context.Context)

Stop stops the plugin.

type ReportingConfig

type ReportingConfig struct {
	BufferSizeLimitBytes *int64 `json:"buffer_size_limit_bytes,omitempty"` // max size of in-memory buffer
	UploadSizeLimitBytes *int64 `json:"upload_size_limit_bytes,omitempty"` // max size of upload payload
	MinDelaySeconds      *int64 `json:"min_delay_seconds,omitempty"`       // min amount of time to wait between successful poll attempts
	MaxDelaySeconds      *int64 `json:"max_delay_seconds,omitempty"`       // max amount of time to wait between poll attempts
}

ReportingConfig represents configuration for the plugin's reporting behaviour.

Jump to

Keyboard shortcuts

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