recent

package
v0.0.0-...-8aeb11b Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package recent tracks the last 20 incoming JSON request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recent

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

Recent tracks the last MAX_RECENT Requests.

func New

func New() *Recent

New returns a new Recent instance.

func (*Recent) AddBad

func (r *Recent) AddBad(b []byte, msg string)

AddBad the JSON body that was POST'd to the server.

func (*Recent) AddGood

func (r *Recent) AddGood(b []byte)

AddGood the JSON body that was POST'd to the server.

func (*Recent) List

func (r *Recent) List() ([]*Request, []*Request)

List returns the last MAX_RECENT Good and Bad Requests, with the most recent Requests first.

type Request

type Request struct {
	TS     string
	JSON   string
	Reason string
}

Request is a record of a single POST request.

Jump to

Keyboard shortcuts

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