plugin

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ApplicationType = "go"
View Source
const AwsDefaultRegion = "AWS_DEFAULT_REGION"

AWS

View Source
const DefaultProfile = "default"

const TimeFormat = "2006-01-02 15:04:05.000 -0700"

View Source
const ThundraApplicationProfile = "thundra_applicationProfile"

Thundra Environment

Variables

View Source
var ApplicationId string
View Source
var ApplicationName string
View Source
var ApplicationProfile string
View Source
var ApplicationVersion string
View Source
var ContextId string
View Source
var FunctionARN string
View Source
var LogGroupName string
View Source
var LogStreamName string
View Source
var MemorySize int
View Source
var Region string
View Source
var TransactionId string

Functions

func GenerateNewContextId

func GenerateNewContextId()

func GenerateNewId

func GenerateNewId() string

GenerateNewId generates new uuid.

func GenerateNewTransactionId

func GenerateNewTransactionId()

func GetAwsRequestID

func GetAwsRequestID(ctx context.Context) string

GetFromContext returns InvokedFunctionArn and AwsRequestID if available.

func GetErrorMessage

func GetErrorMessage(err interface{}) string

GetErrorMessage returns error message

func GetErrorType

func GetErrorType(err interface{}) string

GetErrorType returns type of the error

func GetInvokedFunctionArn

func GetInvokedFunctionArn(ctx context.Context) string

GetFromContext returns InvokedFunctionArn and AwsRequestID if available.

func GetThisProcess

func GetThisProcess() *process.Process

GetThisProcess returns process info about this process.

func GetTimestamp

func GetTimestamp() int64

GetTimestamp returns current unix timestamp in msec.

Types

type Data

type Data interface{}

type Message

type Message struct {
	Data              Data   `json:"data"`
	Type              string `json:"type"`
	ApiKey            string `json:"apiKey"`
	DataFormatVersion string `json:"dataFormatVersion"`
}

Message defines the structure that given dataformat follows by Thundra. In here data could be a trace, metric or log data.

type Plugin

type Plugin interface {
	BeforeExecution(ctx context.Context, request json.RawMessage, wg *sync.WaitGroup)
	AfterExecution(ctx context.Context, request json.RawMessage, response interface{}, err interface{}) ([]interface{}, string)
	OnPanic(ctx context.Context, request json.RawMessage, err interface{}, stackTrace []byte) ([]interface{}, string)
}

Source Files

  • base.go
  • constants.go
  • message.go
  • plugin.go
  • util.go

Jump to

Keyboard shortcuts

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