apool

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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) EachAttrib

func (a *APool) EachAttrib(f EachAttribFunc)

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.

type AText

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

type Attribute

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

func FromJsonAble

func FromJsonAble(convertable []string) Attribute

func (*Attribute) ToJsonAble

func (a *Attribute) ToJsonAble() []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