container

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode[Record any](container *Container[Record]) (bytes.Buffer, error)

func Sha256

func Sha256(data []byte) string

Types

type Container

type Container[Record any] struct {
	Data  Record
	Hash  string
	Time  time.Time
	Next  *Container[Record]
	Index uint64
}

func Create

func Create[Record any](data Record, index uint64) *Container[Record]

func Decode

func Decode[Record any](buffer bytes.Buffer) (*Container[Record], error)

func (*Container[Record]) Fill

func (c *Container[Record]) Fill(data Record, index uint64)

func (*Container[Record]) Save

func (c *Container[Record]) Save() error

type Freighter

type Freighter[Record any] struct {
	Head *Container[Record]
	Tail *Container[Record]
	Size uint64
}

func (*Freighter[Record]) Append

func (f *Freighter[Record]) Append(data Record)

Jump to

Keyboard shortcuts

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