Documentation ¶
Overview ¶
mae.earth/pkg/card/card.go * mae 12016
mae.earth/pkg/card/compound.go * mae 12016
mae.earth/pkg/card/primitives.go * mae 12016
Index ¶
- Constants
- Variables
- func Compact(root *cell.Cell) string
- func DeregisterUserParser(name string) bool
- func Fuzz(data []byte) int
- func Output(card *Card) (string, error)
- func RegisterUserParser(name string, p UserParser) bool
- func S(h cell.Stringer) *cell.Cell
- func Strip(s string) string
- type Attributer
- type Boolean
- type Byte
- type Card
- func (c *Card) Get(key string) Attributer
- func (c *Card) IsData() bool
- func (c *Card) Names() []string
- func (c *Card) Set(key string, val Attributer) *Card
- func (c *Card) SetAsData() *Card
- func (c *Card) SetAsFilter() *Card
- func (c *Card) SetAsView() *Card
- func (c *Card) Sexpr() *cell.Cell
- func (c *Card) String() string
- type Compound
- func (c *Compound) Add(val Attributer) *Compound
- func (c Compound) Blank() Attributer
- func (c Compound) Copy() Attributer
- func (c Compound) Equal(other Attributer) bool
- func (c Compound) Name() Name
- func (c Compound) Sexpr() *cell.Cell
- func (c Compound) String() string
- func (c Compound) Update(interface{}) Attributer
- type Datetime
- type DelimitedString
- func (s DelimitedString) Blank() Attributer
- func (s DelimitedString) Copy() Attributer
- func (s DelimitedString) Delimit() []string
- func (s DelimitedString) Equal(other Attributer) bool
- func (s DelimitedString) Name() Name
- func (ds DelimitedString) Sexpr() *cell.Cell
- func (s DelimitedString) String() string
- func (s DelimitedString) Update(u interface{}) Attributer
- type Identifier
- type Literal
- type Name
- type Number
- type Part
- type Plain
- type Real
- type String
- type Sumer
- type Type
- type UserParser
Constants ¶
View Source
const ( UPID = 4 /* Unique Project IDentifier */ PID = 4 /* Process IDentifier */ )
View Source
const ( NameCard = Name("card") NameAttributes = Name("A") //Name("attributes") NameAttribute = Name("a") //Name("attribute") NameCompound = Name("C") )
View Source
const ( DataCard = Type("data") FilterCard = Type("filter") ViewCard = Type("view") )
View Source
const ( NameByte = Name("uint8") NameNumber = Name("int") NameString = Name("string") NameDelimitedString = Name("delimited-string") NameBoolean = Name("boolean") NameReal = Name("real") NameDatetime = Name("datetime") )
View Source
const DefaultReal = Real(0.0)
View Source
const PartDelimiter string = "@"
Variables ¶
View Source
var ( ErrRootIsNil = fmt.Errorf("Root is nil") ErrRootIsInvalid = fmt.Errorf("Root is Invalid") ErrInvalidValue = fmt.Errorf("Value is invalid") ErrCardIsInvalid = fmt.Errorf("Card is invalid") )
View Source
var (
EmptyDatetime = Datetime(time.Now())
)
Functions ¶
func RegisterUserParser ¶
func RegisterUserParser(name string, p UserParser) bool
RegisterUserParser
Types ¶
type Attributer ¶
type Attributer interface { Sexpr() *cell.Cell String() string Name() Name Copy() Attributer Update(interface{}) Attributer Blank() Attributer Equal(Attributer) bool }
type Boolean ¶
type Boolean bool
Boolean
func (Boolean) Blank ¶
func (b Boolean) Blank() Attributer
func (Boolean) Copy ¶
func (b Boolean) Copy() Attributer
func (Boolean) Equal ¶
func (b Boolean) Equal(other Attributer) bool
func (Boolean) Update ¶
func (b Boolean) Update(u interface{}) Attributer
type Byte ¶
type Byte byte
byte
func (Byte) Blank ¶
func (b Byte) Blank() Attributer
func (Byte) Copy ¶
func (b Byte) Copy() Attributer
func (Byte) Equal ¶
func (b Byte) Equal(other Attributer) bool
func (Byte) Update ¶
func (b Byte) Update(u interface{}) Attributer
type Card ¶
type Card struct { Identifier Type Version int Created time.Time Attributes map[string]Attributer }
func CloneBlank ¶
func New ¶
func New(id Identifier) (*Card, error)
func (*Card) Get ¶
func (c *Card) Get(key string) Attributer
func (*Card) SetAsFilter ¶
type Compound ¶
type Compound struct { Label string Attributes []Attributer }
func NewCompound ¶
func NewCompound() *Compound
func (*Compound) Add ¶
func (c *Compound) Add(val Attributer) *Compound
func (Compound) Blank ¶
func (c Compound) Blank() Attributer
func (Compound) Copy ¶
func (c Compound) Copy() Attributer
func (Compound) Equal ¶
func (c Compound) Equal(other Attributer) bool
func (Compound) Update ¶
func (c Compound) Update(interface{}) Attributer
type Datetime ¶
Datetime
func DatetimeNow ¶
func DatetimeNow() Datetime
func (Datetime) Blank ¶
func (dt Datetime) Blank() Attributer
func (Datetime) Copy ¶
func (dt Datetime) Copy() Attributer
func (Datetime) Equal ¶
func (dt Datetime) Equal(other Attributer) bool
func (Datetime) Update ¶
func (dt Datetime) Update(u interface{}) Attributer
type DelimitedString ¶
func ParseDelimitedString ¶
func ParseDelimitedString(root *cell.Cell) (DelimitedString, error)
func (DelimitedString) Blank ¶
func (s DelimitedString) Blank() Attributer
func (DelimitedString) Copy ¶
func (s DelimitedString) Copy() Attributer
func (DelimitedString) Delimit ¶
func (s DelimitedString) Delimit() []string
func (DelimitedString) Equal ¶
func (s DelimitedString) Equal(other Attributer) bool
func (DelimitedString) Name ¶
func (s DelimitedString) Name() Name
func (DelimitedString) Sexpr ¶
func (ds DelimitedString) Sexpr() *cell.Cell
func (DelimitedString) String ¶
func (s DelimitedString) String() string
func (DelimitedString) Update ¶
func (s DelimitedString) Update(u interface{}) Attributer
type Identifier ¶
type Identifier string
func (Identifier) IsInvalid ¶
func (id Identifier) IsInvalid() bool
func (Identifier) String ¶
func (id Identifier) String() string
func (Identifier) Sum ¶
func (id Identifier) Sum() uint
type Number ¶
type Number int
number
func (Number) Blank ¶
func (n Number) Blank() Attributer
func (Number) Copy ¶
func (n Number) Copy() Attributer
func (Number) Equal ¶
func (n Number) Equal(other Attributer) bool
func (Number) Update ¶
func (n Number) Update(u interface{}) Attributer
type Part ¶
type Part struct { Name string Attributes map[string]Attributer Children map[string]*Part }
func Partition ¶
Go through the attributes of a card and partition into logical parts based on * the attributes name - pretty much like a file in a path
func (*Part) AddAttribute ¶
func (p *Part) AddAttribute(key string, attr Attributer) *Part
func (*Part) GetAttribute ¶
func (p *Part) GetAttribute(key string) Attributer
type Real ¶
type Real float64
real
func (Real) Blank ¶
func (r Real) Blank() Attributer
func (Real) Copy ¶
func (r Real) Copy() Attributer
func (Real) Equal ¶
func (r Real) Equal(other Attributer) bool
func (Real) Update ¶
func (r Real) Update(u interface{}) Attributer
type String ¶
type String string
String
func (String) Blank ¶
func (s String) Blank() Attributer
func (String) Copy ¶
func (s String) Copy() Attributer
func (String) Equal ¶
func (s String) Equal(other Attributer) bool
func (String) Update ¶
func (s String) Update(u interface{}) Attributer
type UserParser ¶
type UserParser interface {
Parse(root *cell.Cell) (Attributer, error)
}
Click to show internal directories.
Click to hide internal directories.