Versions in this module Expand all Collapse all v0 v0.1.1 Nov 18, 2021 v0.1.0 Mar 18, 2021 Changes in this version + const ErrCordCompleted + const ErrIllegalArguments + const ErrIllegalDelimiterPattern + const ErrIndexOutOfBounds + func ApplyMaterializedMetric(cord Cord, i, j uint64, metric MaterializedMetric) (MetricValue, Cord, error) + func Cord2Dot(text Cord, w io.Writer) + func Cut(cord Cord, i, l uint64) (Cord, Cord, error) + func Split(cord Cord, i uint64) (Cord, Cord, error) + func T() tracing.Trace + type Builder struct + func NewBuilder() *Builder + func (b *Builder) Append(leaf Leaf) error + func (b *Builder) Prepend(leaf Leaf) error + func (b *Builder) Reset() + func (b Builder) Cord() Cord + type Cord struct + func Concat(cord Cord, others ...Cord) Cord + func FromString(s string) Cord + func Insert(cord Cord, c Cord, i uint64) (Cord, error) + func Substr(cord Cord, i, l uint64) (Cord, error) + func (cord Cord) EachLeaf(f func(Leaf, uint64) error) error + func (cord Cord) FragmentCount() int + func (cord Cord) Index(i uint64) (Leaf, uint64, error) + func (cord Cord) IsVoid() bool + func (cord Cord) Len() uint64 + func (cord Cord) Reader() io.Reader + func (cord Cord) Report(i, l uint64) (string, error) + func (cord Cord) String() string + type CordError string + func (e CordError) Error() string + type Leaf interface + Split func(uint64) (Leaf, Leaf) + String func() string + Substring func(uint64, uint64) []byte + Weight func() uint64 + type MaterializedMetric interface + Leafs func(MetricValue, bool) []Leaf + type Metric interface + Apply func(frag []byte) MetricValue + Combine func(leftSibling, rightSibling MetricValue, metric Metric) MetricValue + type MetricValue interface + Len func() int + Unprocessed func() ([]byte, []byte) + func ApplyMetric(cord Cord, i, j uint64, metric Metric) (MetricValue, error) + type StringLeaf string + func (lstr StringLeaf) Split(i uint64) (Leaf, Leaf) + func (lstr StringLeaf) String() string + func (lstr StringLeaf) Substring(i, j uint64) []byte + func (lstr StringLeaf) Weight() uint64