common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const UInt32Max = uint32(^uint32(0))
View Source
const UInt32Mid = (uint32(^uint32(0)) - uint32(0)) / 2
View Source
const UInt32Min = uint32(0)

Variables

This section is empty.

Functions

func UTF16Length

func UTF16Length(s string) uint32

func UTF16Slice

func UTF16Slice(s string, start, end uint32) string

Types

type BlockID

type BlockID = uuid.UUID

type BlockPath

type BlockPath struct {
	NoteID  NoteID
	BlockID BlockID
}

type ClosedRange

type ClosedRange struct {
	Lower  uint32
	Length uint32
}

func (ClosedRange) Compare

func (cr ClosedRange) Compare(other ClosedRange) Order

func (ClosedRange) Intersection

func (cr ClosedRange) Intersection(other ClosedRange) (ClosedRange, error)

func (ClosedRange) Upper

func (cr ClosedRange) Upper() uint32

type FatalError

type FatalError string
const (
	NoIntersection                   FatalError = "NoIntersection"
	ExistingSpanOverwrite            FatalError = "ExistingSpanOverwrite"
	UnAppendable                     FatalError = "UnAppendable"
	UnPrependable                    FatalError = "UnPrependable"
	InvalidDistanceBetweenNoRelation FatalError = "InvalidDistanceBetweenNoRelation"
)

func (FatalError) Error

func (fatal FatalError) Error() string

type Nonce

type Nonce = uint32

type NoteID

type NoteID = BlockID

type Order

type Order int
const (
	Splitting Order = iota + 1
	Tagging
	Less
	Prependable
	RightOverlap
	IncludingRight
	IncludingMiddle
	IncludingLeft
	Equal
	IncludedLeft
	IncludedMiddle
	IncludedRight
	LeftOverlap
	Appendable
	Greater
	Tagged
	Splitted
)

func CompareNumber

func CompareNumber[T ~uint32 | ~int](a, b T) Order

type Priority

type Priority = uint32

type ReplicaID

type ReplicaID = uint32

type Stamp

type Stamp struct {
	ReplicaID ReplicaID
	Timestamp Timestamp
}

func (*Stamp) IsOlderThan

func (s *Stamp) IsOlderThan(other *Stamp) bool

func (*Stamp) MarshalJSON

func (s *Stamp) MarshalJSON() ([]byte, error)

func (*Stamp) UnmarshalJSON

func (s *Stamp) UnmarshalJSON(data []byte) error

type Timestamp

type Timestamp = uint64

Jump to

Keyboard shortcuts

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