field

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	Field
	String string
}

Character field is a string of characters.

func DecodeCharacter

func DecodeCharacter(buf []byte, name string, decoder *encoding.Decoder) (*Character, error)

DecodeCharacter decodes a single character field with the specified encoding.

func (Character) Equal

func (c Character) Equal(v string) bool

Equal returns true if v contains the same value as c.

func (Character) Value

func (c Character) Value() interface{}

Value returns the field value.

type Date added in v1.0.0

type Date struct {
	Field
	Date *time.Time
}

Date field is a date with no time component.

func DecodeDate added in v1.0.0

func DecodeDate(buf []byte, name string) (*Date, error)

DecodeDate decodes a single date field.

func (Date) Equal added in v1.0.0

func (d Date) Equal(v string) bool

Equal returns true if v contains the same value as c.

func (Date) Value added in v1.0.0

func (d Date) Value() interface{}

Value returns the field value.

type Field

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

Field base type.

func (Field) Name

func (f Field) Name() string

Name returns the field name.

type FloatingPoint

type FloatingPoint Numeric

FloatingPoint field.

func DecodeFloatingPoint

func DecodeFloatingPoint(buf []byte, name string) (*FloatingPoint, error)

DecodeFloatingPoint decodes a single floating point field.

func (FloatingPoint) Equal

func (f FloatingPoint) Equal(v string) bool

Equal returns true if v contains the same value as f.

func (FloatingPoint) Value

func (f FloatingPoint) Value() interface{}

Value returns the field value.

type Numeric

type Numeric struct {
	Field
	Number float64
}

Numeric field.

func DecodeNumeric

func DecodeNumeric(buf []byte, name string) (*Numeric, error)

DecodeNumeric decodes a single numeric field.

func (Numeric) Equal

func (n Numeric) Equal(v string) bool

Equal returns true if v contains the same value as n.

func (Numeric) Value

func (n Numeric) Value() interface{}

Value returns the field value.

Jump to

Keyboard shortcuts

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