field

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Copyright (c) 2023 the go-mongr8 Authors and Contributors [@see Authors file]

Licensed under the MIT License (https://opensource.org/licenses/MIT)

Copyright (c) 2023 the go-mongr8 Authors and Contributors [@see Authors file]

Licensed under the MIT License (https://opensource.org/licenses/MIT)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LegacyCoordinateEmbeddedDocField

func LegacyCoordinateEmbeddedDocField(name string) *legacyCoordinateEmbeddedDocSpec

Types

type FieldSpec

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

func ArrayField

func ArrayField(name string, fields ...*FieldSpec) *FieldSpec

func BooleanField

func BooleanField(name string) *FieldSpec

func DoubleField

func DoubleField(name string) *FieldSpec

func FromFieldSpec

func FromFieldSpec(spec *Spec) *FieldSpec

func GeoJSONGeometryCollectionField

func GeoJSONGeometryCollectionField(name string) *FieldSpec

func GeoJSONLineStringField

func GeoJSONLineStringField(name string) *FieldSpec

func GeoJSONMultiLineStringField

func GeoJSONMultiLineStringField(name string) *FieldSpec

func GeoJSONMultiPointField

func GeoJSONMultiPointField(name string) *FieldSpec

func GeoJSONMultiPolygonField

func GeoJSONMultiPolygonField(name string) *FieldSpec

func GeoJSONPointField

func GeoJSONPointField(name string) *FieldSpec

func GeoJSONPolygonMultipleRingField

func GeoJSONPolygonMultipleRingField(name string) *FieldSpec

func GeoJSONPolygonSingleRingField

func GeoJSONPolygonSingleRingField(name string) *FieldSpec

func Int32Field

func Int32Field(name string) *FieldSpec

func Int64Field

func Int64Field(name string) *FieldSpec

func LegacyCoordinateArrayField

func LegacyCoordinateArrayField(name string) *FieldSpec

func ObjectField

func ObjectField(name string, fields ...*FieldSpec) *FieldSpec

func StringField

func StringField(name string) *FieldSpec

func TimestampField

func TimestampField(name string) *FieldSpec

func (*FieldSpec) ObjectHasKey

func (b *FieldSpec) ObjectHasKey(key string) bool

func (*FieldSpec) SetNullable

func (b *FieldSpec) SetNullable() *FieldSpec

func (*FieldSpec) Spec

func (b *FieldSpec) Spec() *Spec

type FieldType

type FieldType string
const (
	TypeString                      FieldType = "TypeString"
	TypeInt32                       FieldType = "TypeInt32"
	TypeInt64                       FieldType = "TypeInt64"
	TypeDouble                      FieldType = "TypeDouble"
	TypeBoolean                     FieldType = "TypeBoolean"
	TypeArray                       FieldType = "TypeArray"
	TypeObject                      FieldType = "TypeObject"
	TypeTimestamp                   FieldType = "TypeTimestamp"
	TypeGeoJSONPoint                FieldType = "TypeGeoJSONPoint"
	TypeGeoJSONLineString           FieldType = "TypeGeoJSONLineString"
	TypeGeoJSONPolygonSingleRing    FieldType = "TypeGeoJSONPolygonSingleRing"
	TypeGeoJSONPolygonMultipleRing  FieldType = "TypeGeoJSONPolygonMultipleRing"
	TypeGeoJSONMultiPoint           FieldType = "TypeGeoJSONMultiPoint"
	TypeGeoJSONMultiLineString      FieldType = "TypeGeoJSONMultiLineString"
	TypeGeoJSONMultiPolygon         FieldType = "TypeGeoJSONMultiPolygon"
	TypeGeoJSONGeometryCollection   FieldType = "TypeGeoJSONGeometryCollection"
	TypeLegacyCoordinateArray       FieldType = "TypeLegacyCoordinateArray"
	TypeLegacyCoordinateEmbeddedDoc FieldType = "TypeLegacyCoordinateEmbeddedDoc"
)

make sure constant name is exactly same as it's value

func GetTypePointer

func GetTypePointer(fieldType FieldType) *FieldType

func (FieldType) CompareTo

func (f FieldType) CompareTo(other FieldType) int

implement /internal/util/Comparable

func (FieldType) IsNumeric

func (f FieldType) IsNumeric() bool

func (FieldType) ToString

func (f FieldType) ToString() string

type Spec

type Spec struct {
	Name string
	// Type of the field
	Type FieldType

	// Array items, if current type is an array
	// this can be any field type
	ArrayFields *[]Spec

	// Children of object, if current type is an object
	Object *[]Spec

	// Nullable flag
	Nullable bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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