warmer

package module
v0.0.0-...-9723e73 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 9 Imported by: 0

README

lambda-warmer

AWS Lambda warmer for Golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Warm indicates if the Lambda is warm
	Warm = false

	// LastAccess indicates the last Lambda access
	LastAccess = time.Time{}
)

Functions

func Handler

func Handler(ctx context.Context, event map[string]interface{}, cfg ...Config) bool

Handler handles AWS and returns if event is a warmer event

Types

type Config

type Config struct {
	CorrelationID string
}

Config defines Lambda warmer configurations

type Event

type Event struct {
	Warmer            bool   `json:"warmer"`
	Concurrency       int    `json:"concurrency"`
	WarmerInvocation  int    `json:"warmerinvocation"`
	WarmerConcurrency int    `json:"warmerConcurrency"`
	CorrelationID     string `json:"correlationId"`
}

Event defines Lambda warmer event

type Log

type Log struct {
	Action                string    `json:"action"`
	Function              string    `json:"function"`
	CorrelationID         string    `json:"correlationId"`
	Count                 int       `json:"count"`
	Concurrency           int       `json:"concurrency"`
	Warm                  bool      `json:"warm"`
	LastAccessed          time.Time `json:"lastAccessed"`
	LastAccessedInSeconds float64   `json:"lastAccessedInSeconds"`
}

Log defines log message

Jump to

Keyboard shortcuts

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