message_cache

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StackCache

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

func NewStackCache

func NewStackCache(maxLen int) *StackCache

NewStackCache returns a new StackCache, ready to use

func (*StackCache) Append

func (c *StackCache) Append(entry *tb.Message)

Append adds an entry to the cache, if the cache is already full, then the oldest (first) entry in the cache is evicted before appending.

func (*StackCache) LoggerUpdate

func (c *StackCache) LoggerUpdate(logger *logrus.Entry) *logrus.Entry

Logger computes some values about the StackCache, fills them into the fields then returns a logger

func (*StackCache) Pop

func (c *StackCache) Pop() (*tb.Message, error)

Pop is a wrapper around pop purely for mutex locking

func (*StackCache) Read

func (c *StackCache) Read() []*tb.Message

Read uses a RLock to return the contents of the StackCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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