catpages

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-cbor-cat-paged

Prints paged CBOR(e.g, keep printing CBOR documents by skipping broken pages)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPage     error = errors.New("invalid page")
	ErrInvalidPageSize error = errors.New("invalid page size")
)
View Source
var PageSizeNameMap map[string]PageSize = map[string]PageSize{
	"Tiny":   PageSizeTiny,
	"Small":  PageSizeSmall,
	"Normal": PageSizeNormal,
	"Large":  PageSizeLarge,
	"LARGE":  PageSizeLARGE,
	"Huge":   PageSizeHuge,
	"HUGE":   PageSizeHUGE,
}

Functions

func LogErrorSimple

func LogErrorSimple(e error)

Types

type CatAll

type CatAll func(context.Context, iter.Seq[Page]) error

func (CatAll) ProcessAll

func (a CatAll) ProcessAll(ctx context.Context, s PageSource) error

type CatPage

type CatPage func(context.Context, Page) error

func (CatPage) ToCatAll

func (c CatPage) ToCatAll(ie IgnoreError, le LogError) CatAll

type IgnoreError

type IgnoreError func(error) (ignore bool)

type LogError

type LogError func(error)
var LogErrorDefault LogError = LogErrorSimple

type Page

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

func (Page) Content

func (p Page) Content() []byte

func (Page) Err

func (p Page) Err() error

type PageFactory

type PageFactory struct {
	PageSize
}

func PageFactoryNew

func PageFactoryNew(psz PageSize) PageFactory

func (PageFactory) NewPage

func (f PageFactory) NewPage(content []byte, err error) Page

type PageSize

type PageSize uint32
const (
	PageSizeTiny   PageSize = 8
	PageSizeSmall  PageSize = 64
	PageSizeNormal PageSize = 512
	PageSizeLarge  PageSize = 4096
	PageSizeLARGE  PageSize = 32768
	PageSizeHuge   PageSize = 262144
	PageSizeHUGE   PageSize = 2097152
)

func PageSizeFromString

func PageSizeFromString(psname string) (PageSize, error)

type PageSource

type PageSource func(context.Context) iter.Seq[Page]

Directories

Path Synopsis
app
cmd
io

Jump to

Keyboard shortcuts

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