apool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ATextsEqual added in v0.0.2

func ATextsEqual(atext1 AText, atext2 AText) bool

func CmpAttribute

func CmpAttribute(a, b Attribute) int

func CopyAText

func CopyAText(atext1 AText, atext2 *AText)

Types

type APool

type APool struct {
	NumToAttrib    map[int]Attribute `json:"-"`
	NumToAttribRaw map[int][]string  `json:"numToAttrib"`
	AttribToNum    map[Attribute]int `json:"-"`
	NextNum        int               `json:"nextNum"`
}

func NewAPool

func NewAPool() APool

func (*APool) Check added in v0.0.2

func (a *APool) Check() error

func (*APool) EachAttrib

func (a *APool) EachAttrib(f EachAttribFunc)

func (*APool) FromDB added in v0.0.2

func (a *APool) FromDB(obj db.PadPool) *APool

func (*APool) FromJsonable

func (a *APool) FromJsonable(obj APool) *APool

FromJsonable /**

func (*APool) GetAttrib

func (a *APool) GetAttrib(num int) (*Attribute, error)

func (*APool) PutAttrib

func (a *APool) PutAttrib(attrib Attribute, dontAddIfAbsent *bool) int

func (*APool) ToJsonable

func (a *APool) ToJsonable() APool

*

  • @returns {Jsonable} An object that can be passed to `fromJsonable` to reconstruct this
  • attribute pool. The returned object can be converted to JSON. WARNING: The returned object
  • has references to internal state (it is not a deep copy). Use the `clone()` method to copy
  • a pool -- do NOT do `new AttributePool().fromJsonable(pool.toJsonable())` to copy because
  • the resulting shared state will lead to pool corruption.

func (*APool) ToPadDB added in v0.0.2

func (a *APool) ToPadDB() db.PadPool

func (*APool) ToRevDB added in v0.0.2

func (a *APool) ToRevDB() db.RevPool

type AText

type AText struct {
	Text    string `json:"text"`
	Attribs string `json:"attribs"`
}

func FromDBAText added in v0.0.2

func FromDBAText(dbAtext db.AText) AText

func (*AText) ToDBAText added in v0.0.2

func (a *AText) ToDBAText() db.AText

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func FromJsonAble

func FromJsonAble(convertable []string) Attribute

func (*Attribute) String added in v0.0.2

func (a *Attribute) String() string

func (*Attribute) ToJsonAble

func (a *Attribute) ToJsonAble() []string

func (*Attribute) ToStringSlice added in v0.0.2

func (a *Attribute) ToStringSlice() []string

type AttributeIterator

type AttributeIterator func(attributeKey *string, attributeValue *string)

type EachAttribFunc

type EachAttribFunc func(attrib Attribute)

Jump to

Keyboard shortcuts

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