models

package
v0.0.0-...-8d831a5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagNone           uint64 = 6
	TagTable          uint64 = 7
	TagRecordID       uint64 = 8
	TagCustomDatetime uint64 = 12
	TagCustomDuration uint64 = 14
	TagFuture         uint64 = 15

	TagStringUUID     uint64 = 9
	TagStringDecimal  uint64 = 10
	TagStringDuration uint64 = 13

	TagSpecBinaryUUID uint64 = 37

	TagRange         uint64 = 49
	TagBoundIncluded uint64 = 50
	TagBoundExcluded uint64 = 51

	TagGeometryPoint        uint64 = 88
	TagGeometryLine         uint64 = 89
	TagGeometryPolygon      uint64 = 90
	TagGeometryMultiPoint   uint64 = 91
	TagGeometryMultiLine    uint64 = 92
	TagGeometryMultiPolygon uint64 = 93
	TagGeometryCollection   uint64 = 94
)
View Source
var None = CustomNil{}

Functions

func FormatDuration

func FormatDuration(ns int64) string

func ParseDuration

func ParseDuration(duration string) (int64, error)

Types

type Bound

type Bound[T any] interface {
	BoundIncluded[T] | BoundExcluded[T]
}

type BoundExcluded

type BoundExcluded[T any] struct {
	Value T
}

func (*BoundExcluded[T]) MarshalCBOR

func (be *BoundExcluded[T]) MarshalCBOR() ([]byte, error)

func (*BoundExcluded[T]) UnmarshalCBOR

func (be *BoundExcluded[T]) UnmarshalCBOR(data []byte) error

type BoundIncluded

type BoundIncluded[T any] struct {
	Value T
}

func (*BoundIncluded[T]) MarshalCBOR

func (bi *BoundIncluded[T]) MarshalCBOR() ([]byte, error)

func (*BoundIncluded[T]) UnmarshalCBOR

func (bi *BoundIncluded[T]) UnmarshalCBOR(data []byte) error

type CborMarshaler

type CborMarshaler struct {
}

func (CborMarshaler) Marshal

func (c CborMarshaler) Marshal(v interface{}) ([]byte, error)

func (CborMarshaler) NewEncoder

func (c CborMarshaler) NewEncoder(w io.Writer) codec.Encoder

type CborUnmarshaler

type CborUnmarshaler struct {
}

func (CborUnmarshaler) NewDecoder

func (c CborUnmarshaler) NewDecoder(r io.Reader) codec.Decoder

func (CborUnmarshaler) Unmarshal

func (c CborUnmarshaler) Unmarshal(data []byte, dst interface{}) error

type CustomDateTime

type CustomDateTime struct {
	time.Time
}

CustomDateTime embeds time.Time

func (*CustomDateTime) MarshalCBOR

func (d *CustomDateTime) MarshalCBOR() ([]byte, error)

func (*CustomDateTime) String

func (d *CustomDateTime) String() string

func (*CustomDateTime) SurrealString

func (d *CustomDateTime) SurrealString() string

func (*CustomDateTime) UnmarshalCBOR

func (d *CustomDateTime) UnmarshalCBOR(data []byte) error

type CustomDuration

type CustomDuration struct {
	time.Duration
}

func (*CustomDuration) MarshalCBOR

func (d *CustomDuration) MarshalCBOR() ([]byte, error)

func (*CustomDuration) String

func (d *CustomDuration) String() string

func (*CustomDuration) ToCustomDurationString

func (d *CustomDuration) ToCustomDurationString() CustomDurationString

func (*CustomDuration) UnmarshalCBOR

func (d *CustomDuration) UnmarshalCBOR(data []byte) error

type CustomDurationString

type CustomDurationString string

func (*CustomDurationString) String

func (d *CustomDurationString) String() string

func (*CustomDurationString) ToCustomDuration

func (d *CustomDurationString) ToCustomDuration() CustomDuration

func (*CustomDurationString) ToDuration

func (d *CustomDurationString) ToDuration() time.Duration

type CustomNil

type CustomNil struct {
}

func (*CustomNil) MarshalCBOR

func (c *CustomNil) MarshalCBOR() ([]byte, error)

func (*CustomNil) UnMarshalCBOR

func (c *CustomNil) UnMarshalCBOR(data []byte) error

type DecimalString

type DecimalString string

type Future

type Future struct {
	// contains filtered or unexported fields
}

func (*Future) String

func (f *Future) String() string

func (*Future) SurrealString

func (f *Future) SurrealString() string

type GeometryCollection

type GeometryCollection []any

type GeometryLine

type GeometryLine []GeometryPoint

type GeometryMultiLine

type GeometryMultiLine []GeometryLine

type GeometryMultiPoint

type GeometryMultiPoint []GeometryPoint

type GeometryMultiPolygon

type GeometryMultiPolygon []GeometryPolygon

type GeometryPoint

type GeometryPoint struct {
	Latitude  float64
	Longitude float64
}

func NewGeometryPoint

func NewGeometryPoint(latitude, longitude float64) GeometryPoint

func (*GeometryPoint) GetCoordinates

func (gp *GeometryPoint) GetCoordinates() [2]float64

func (*GeometryPoint) MarshalCBOR

func (gp *GeometryPoint) MarshalCBOR() ([]byte, error)

func (*GeometryPoint) UnmarshalCBOR

func (gp *GeometryPoint) UnmarshalCBOR(data []byte) error

type GeometryPolygon

type GeometryPolygon []GeometryLine

type Range

type Range[T any, TBeg Bound[T], TEnd Bound[T]] struct {
	Begin *TBeg
	End   *TEnd
}

func (*Range[T, TBeg, TEnd]) GetJoinString

func (r *Range[T, TBeg, TEnd]) GetJoinString() string

func (*Range[T, TBeg, TEnd]) MarshalCBOR

func (r *Range[T, TBeg, TEnd]) MarshalCBOR() ([]byte, error)

func (*Range[T, TBeg, TEnd]) String

func (r *Range[T, TBeg, TEnd]) String() string

func (*Range[T, TBeg, TEnd]) UnmarshalCBOR

func (r *Range[T, TBeg, TEnd]) UnmarshalCBOR(data []byte) error

type RecordID

type RecordID struct {
	Table string
	ID    any
}

func NewRecordID

func NewRecordID(tableName string, id any) RecordID

func ParseRecordID

func ParseRecordID(idStr string) *RecordID

func (*RecordID) MarshalCBOR

func (r *RecordID) MarshalCBOR() ([]byte, error)

func (*RecordID) String

func (r *RecordID) String() string

func (*RecordID) SurrealString

func (r *RecordID) SurrealString() string

func (*RecordID) UnmarshalCBOR

func (r *RecordID) UnmarshalCBOR(data []byte) error

type RecordIDType

type RecordIDType interface {
	~int | ~string | []any | map[string]any
}

type RecordRangeID

type RecordRangeID[T any, TBeg Bound[T], TEnd Bound[T]] struct {
	Range[T, TBeg, TEnd]
	Table Table
}

func (*RecordRangeID[T, TBeg, TEnd]) String

func (rr *RecordRangeID[T, TBeg, TEnd]) String() string

type Table

type Table string

func (Table) String

func (t Table) String() string

type UUID

type UUID struct {
	uuid.UUID
}

type UUIDString

type UUIDString string

Jump to

Keyboard shortcuts

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