Search Apps Documentation Source Content File Folder Download Copy Actions Download

ringlog package

Overview

Package ringlog is an on-chain port of Go's container/ring: a fixed-capacity circular message board where new posts overwrite the oldest entries once full.

Functions

Len

func Len() int

Len returns the number of messages currently stored.

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/ringlog.Len()"

Result

Post

func Post(msg string)

Post adds a message to the ring buffer. Once Cap entries are stored, the oldest entry is overwritten.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/ringlog.Post()"

Result

Render

func Render(path string) string

Render displays the ring buffer as a Markdown page.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/ringlog.Render()"

Result

Entries

func Entries() []Entry

Entries returns all stored messages in chronological order (oldest first).

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/ringlog.Entries()"

Result