logs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logs provides structs for working with AWS CloudWatch Logs records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h Handler)

Handle Logs events with handler.

func HandleFunc

func HandleFunc(h HandlerFunc)

HandleFunc handles Logs events with callback function.

Types

type Event

type Event struct {
	Owner               string      `json:"owner"`
	LogGroup            string      `json:"logGroup"`
	LogStream           string      `json:"logStream"`
	SubscriptionFilters []string    `json:"subscriptionFilters"`
	MessageType         string      `json:"messageType"`
	LogEvents           []*LogEvent `json:"logEvents"`
}

Event represents a single log record.

type Handler

type Handler interface {
	HandleLogs(*Event, *apex.Context) error
}

Handler handles Logs events.

type HandlerFunc

type HandlerFunc func(*Event, *apex.Context) error

HandlerFunc unmarshals Logs events before passing control.

func (HandlerFunc) Handle

func (h HandlerFunc) Handle(data json.RawMessage, ctx *apex.Context) (interface{}, error)

Handle implements apex.Handler.

type LogEvent

type LogEvent struct {
	ID        string `json:"id"`
	Timestamp int64  `json:"timestamp"`
	Message   string `json:"message"`
}

LogEvent represents a single log event.

type Record

type Record struct {
	AWSLogs struct {
		Data []byte `json:"data"`
	} `json:"awslogs"`
}

Record represents a Cloudwatch logs event with one or more records.

Jump to

Keyboard shortcuts

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