common

package
v0.44.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(s string, opts FormatOptions) string

func FormatSimple

func FormatSimple(s string, c tcell.Color) string

Types

type FallbackParser

type FallbackParser func(key, value []byte) (SchemaEntry, Parser)

func (FallbackParser) ToParser

func (fp FallbackParser) ToParser() Parser

type FilterResult

type FilterResult byte
const (
	No FilterResult = iota
	Maybe
	Yes
)

func IfThenElse

func IfThenElse(condition bool, onSuccess, onFailure FilterResult) FilterResult

type FormatOptions

type FormatOptions struct {
	Color tcell.Color

	Bold,
	Italic,
	Underline,
	StrikeThrough bool
}

type Parser

type Parser func(key, value []byte) (SchemaEntry, Parser, error)
var RawParser Parser = rawParser

func Any

func Any(parsers ...Parser) Parser

func WithFallback

func WithFallback(parser Parser, fallback FallbackParser) Parser

func (Parser) ToFallbackParser

func (p Parser) ToFallbackParser() FallbackParser

type RawEntry

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

func (*RawEntry) DetailedString

func (r *RawEntry) DetailedString() string

func (*RawEntry) Filter

func (r *RawEntry) Filter(string, any) FilterResult

func (*RawEntry) String

func (r *RawEntry) String() string

type SchemaEntry

type SchemaEntry interface {
	String() string
	DetailedString() string
	Filter(typ string, val any) FilterResult
}

Jump to

Keyboard shortcuts

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