pict

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Version = "v0.8.1"
)

Variables

View Source
var ErrNotEqual = errors.New("not equal")
View Source
var ErrNotSupported = errors.New("not supported")

Functions

func DeepEqual added in v0.8.2

func DeepEqual(x, y any) error

DeepEqual returns an error if x and y are not equal.

Types

type Case

type Case []Elem

Case represents a PICT case.

type Elem added in v0.8.1

type Elem string

Elem represents a PICT element.

func (Elem) Cast added in v0.8.1

func (elem Elem) Cast(to any) (any, error)

Cast casts the element to the specified type.

func (Elem) CastType added in v0.8.1

func (elem Elem) CastType(t string) (any, error)

Cast casts the element to the specified type.

func (Elem) String added in v0.8.1

func (elem Elem) String() string

String returns the string representation of the element.

type Param

type Param string

Param represents a PICT parameter.

func (Param) String added in v0.8.1

func (param Param) String() string

String returns the string representation of the parameter.

type Parser

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

Parser represents a PICT parser.

func NewParserWithBytes

func NewParserWithBytes(msgBytes []byte) *Parser

NewParserWithBytes returns a new PICT parser with the specified bytes.

func NewParserWithReader

func NewParserWithReader(msgReader io.Reader) *Parser

NewParserWithReader returns a new PICT parser with the specified reader.

func NewParserWithString

func NewParserWithString(msgString string) *Parser

NewParserWithString returns a new PICT parser with the specified string.

func (*Parser) Case

func (parser *Parser) Case(n int) Case

Case returns the case at the specified index.

func (*Parser) Cases

func (parser *Parser) Cases() []Case

Cases returns the all cases.

func (*Parser) Param

func (parser *Parser) Param(n int) Param

Param returns the parameter at the specified index.

func (*Parser) Params

func (parser *Parser) Params() []Param

Params returns the parameters.

func (*Parser) Parse

func (parser *Parser) Parse() error

Jump to

Keyboard shortcuts

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