debugger

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Cache

type Cache[E any] struct {
	KeyTTL      time.Duration // Time after which the data will be expired and removed from the cache
	CleanupFreq time.Duration // This is the time at which a cleaner goroutines  checks whether the data is expired in cache
	Size        int           // This is the size upto which this cache can store a value corresponding to any key
	// contains filtered or unexported fields
}
Cache is an in-memory cache. Each key-value pair stored in this cache have a TTL and one goroutine removes the

key-value pair form the cache which is older than TTL time.

func (*Cache[E]) ReadAndPopData

func (cache *Cache[E]) ReadAndPopData(key string) []E
ReadAndPopData reads the data by taking a string key,

if there is any data available corresponding to the given key then it removes the data from the cache and returns it in the form of []byte

func (*Cache[E]) Update

func (cache *Cache[E]) Update(key string, value E)

Update Inserts the data in the cache, This method expects a string as a key and []byte as the data

type Transformer

type Transformer[E any] interface {
	Transform(data []E) ([]byte, error)
}

type TransformerAny added in v1.5.0

type TransformerAny interface {
	Transformer[any]
}

type Uploader

type Uploader[E any] interface {
	Start()
	Stop()
	RecordEvent(data E)
}

func New

func New[E any](url string, transformer Transformer[E]) Uploader[E]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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