estype

package
v0.0.0-...-879d843 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StructTag = "esjson"
	// If a struct fields has this tag set (as `esjson:"single"`),
	// it will always marshal into single value, even if the field has many values.
	TagSingle = "single"
)

Variables

View Source
var ErrIncorrectType = errors.New("incorrect")

Functions

func IsEmpty

func IsEmpty[T any](val *[]T) bool

IsEmpty determines if f would be treated as null in Elasticsearch. In its search context, null field is one of null, undefined (nonexistent), or an empty array.

func IsNull

func IsNull[T any](val *[]T) bool

func IsUndefined

func IsUndefined[T any](val *[]T) bool

func MarshalFieldsJSON

func MarshalFieldsJSON(v any) ([]byte, error)

MarshalFieldsJSON encodes v into JSON. Some or all fields of v are expected to be Field[T any]. There's no point using this function if v has no Field[T], only being a bit more expensive.

It outputs `null` for null Field, skips for an undefined Field.

v must:

  • be a struct type
  • have no unexported fields

If v:

  • is not struct, returns ErrIncorrectType.
  • has any unexported field, then its behavior is undefined.

MarshalFieldsJSON retrieves underlying values of Field type by calling ValueAny. Then value will be unmarshalled with json.Unmarshal. If unmarshalling returns err, then MarshalFieldsJSON returns the error.

func ParseUnixSec

func ParseUnixSec(v int64) time.Time

func UnmarshalEsTime

func UnmarshalEsTime(data []byte, strParser StrParser, numParser NumParser, typeNames ...string) (time.Time, error)

func UnwrapValue

func UnwrapValue[T any](val *[]T) []T

Types

type AggregateMetricDouble

type AggregateMetricDouble struct {
	Min        float64 `json:"min"`
	Max        float64 `json:"max"`
	Sum        float64 `json:"sum"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleMax

type AggregateMetricDoubleMax struct {
	Max float64 `json:"max"`
}

type AggregateMetricDoubleMaxSum

type AggregateMetricDoubleMaxSum struct {
	Max float64 `json:"max"`
	Sum float64 `json:"sum"`
}

type AggregateMetricDoubleMaxSumValueCount

type AggregateMetricDoubleMaxSumValueCount struct {
	Max        float64 `json:"max"`
	Sum        float64 `json:"sum"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleMaxValueCount

type AggregateMetricDoubleMaxValueCount struct {
	Max        float64 `json:"max"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleMin

type AggregateMetricDoubleMin struct {
	Min float64 `json:"min"`
}

type AggregateMetricDoubleMinMax

type AggregateMetricDoubleMinMax struct {
	Min float64 `json:"min"`
	Max float64 `json:"max"`
}

type AggregateMetricDoubleMinMaxSum

type AggregateMetricDoubleMinMaxSum struct {
	Min float64 `json:"min"`
	Max float64 `json:"max"`
	Sum float64 `json:"sum"`
}

type AggregateMetricDoubleMinMaxValueCount

type AggregateMetricDoubleMinMaxValueCount struct {
	Min        float64 `json:"min"`
	Max        float64 `json:"max"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleMinSum

type AggregateMetricDoubleMinSum struct {
	Min float64 `json:"min"`
	Sum float64 `json:"sum"`
}

type AggregateMetricDoubleMinSumValueCount

type AggregateMetricDoubleMinSumValueCount struct {
	Min        float64 `json:"min"`
	Sum        float64 `json:"sum"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleMinValueCount

type AggregateMetricDoubleMinValueCount struct {
	Min        float64 `json:"min"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleSum

type AggregateMetricDoubleSum struct {
	Sum float64 `json:"sum"`
}

type AggregateMetricDoubleSumValueCount

type AggregateMetricDoubleSumValueCount struct {
	Sum        float64 `json:"sum"`
	ValueCount uint64  `json:"value_count"`
}

type AggregateMetricDoubleValueCount

type AggregateMetricDoubleValueCount struct {
	ValueCount uint64 `json:"value_count"`
}

type BasicDate

type BasicDate time.Time

func (BasicDate) MarshalJSON

func (t BasicDate) MarshalJSON() ([]byte, error)

func (BasicDate) String

func (t BasicDate) String() string

func (*BasicDate) UnmarshalJSON

func (t *BasicDate) UnmarshalJSON(data []byte) error

type BasicDateTime

type BasicDateTime time.Time

func (BasicDateTime) MarshalJSON

func (t BasicDateTime) MarshalJSON() ([]byte, error)

func (BasicDateTime) String

func (t BasicDateTime) String() string

func (*BasicDateTime) UnmarshalJSON

func (t *BasicDateTime) UnmarshalJSON(data []byte) error

type BasicDateTimeNoMillis

type BasicDateTimeNoMillis time.Time

func (BasicDateTimeNoMillis) MarshalJSON

func (t BasicDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (BasicDateTimeNoMillis) String

func (t BasicDateTimeNoMillis) String() string

func (*BasicDateTimeNoMillis) UnmarshalJSON

func (t *BasicDateTimeNoMillis) UnmarshalJSON(data []byte) error

type BasicOrdinalDate

type BasicOrdinalDate time.Time

func (BasicOrdinalDate) MarshalJSON

func (t BasicOrdinalDate) MarshalJSON() ([]byte, error)

func (BasicOrdinalDate) String

func (t BasicOrdinalDate) String() string

func (*BasicOrdinalDate) UnmarshalJSON

func (t *BasicOrdinalDate) UnmarshalJSON(data []byte) error

type BasicOrdinalDateTime

type BasicOrdinalDateTime time.Time

func (BasicOrdinalDateTime) MarshalJSON

func (t BasicOrdinalDateTime) MarshalJSON() ([]byte, error)

func (BasicOrdinalDateTime) String

func (t BasicOrdinalDateTime) String() string

func (*BasicOrdinalDateTime) UnmarshalJSON

func (t *BasicOrdinalDateTime) UnmarshalJSON(data []byte) error

type BasicOrdinalDateTimeNoMillis

type BasicOrdinalDateTimeNoMillis time.Time

func (BasicOrdinalDateTimeNoMillis) MarshalJSON

func (t BasicOrdinalDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (BasicOrdinalDateTimeNoMillis) String

func (*BasicOrdinalDateTimeNoMillis) UnmarshalJSON

func (t *BasicOrdinalDateTimeNoMillis) UnmarshalJSON(data []byte) error

type BasicTTime

type BasicTTime time.Time

func (BasicTTime) MarshalJSON

func (t BasicTTime) MarshalJSON() ([]byte, error)

func (BasicTTime) String

func (t BasicTTime) String() string

func (*BasicTTime) UnmarshalJSON

func (t *BasicTTime) UnmarshalJSON(data []byte) error

type BasicTTimeNoMillis

type BasicTTimeNoMillis time.Time

func (BasicTTimeNoMillis) MarshalJSON

func (t BasicTTimeNoMillis) MarshalJSON() ([]byte, error)

func (BasicTTimeNoMillis) String

func (t BasicTTimeNoMillis) String() string

func (*BasicTTimeNoMillis) UnmarshalJSON

func (t *BasicTTimeNoMillis) UnmarshalJSON(data []byte) error

type BasicTime

type BasicTime time.Time

func (BasicTime) MarshalJSON

func (t BasicTime) MarshalJSON() ([]byte, error)

func (BasicTime) String

func (t BasicTime) String() string

func (*BasicTime) UnmarshalJSON

func (t *BasicTime) UnmarshalJSON(data []byte) error

type BasicTimeNoMillis

type BasicTimeNoMillis time.Time

func (BasicTimeNoMillis) MarshalJSON

func (t BasicTimeNoMillis) MarshalJSON() ([]byte, error)

func (BasicTimeNoMillis) String

func (t BasicTimeNoMillis) String() string

func (*BasicTimeNoMillis) UnmarshalJSON

func (t *BasicTimeNoMillis) UnmarshalJSON(data []byte) error

type BasicWeekDate

type BasicWeekDate time.Time

func (BasicWeekDate) MarshalJSON

func (t BasicWeekDate) MarshalJSON() ([]byte, error)

func (BasicWeekDate) String

func (t BasicWeekDate) String() string

func (*BasicWeekDate) UnmarshalJSON

func (t *BasicWeekDate) UnmarshalJSON(data []byte) error

type BasicWeekDateTime

type BasicWeekDateTime time.Time

func (BasicWeekDateTime) MarshalJSON

func (t BasicWeekDateTime) MarshalJSON() ([]byte, error)

func (BasicWeekDateTime) String

func (t BasicWeekDateTime) String() string

func (*BasicWeekDateTime) UnmarshalJSON

func (t *BasicWeekDateTime) UnmarshalJSON(data []byte) error

type BasicWeekDateTimeNoMillis

type BasicWeekDateTimeNoMillis time.Time

func (BasicWeekDateTimeNoMillis) MarshalJSON

func (t BasicWeekDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (BasicWeekDateTimeNoMillis) String

func (t BasicWeekDateTimeNoMillis) String() string

func (*BasicWeekDateTimeNoMillis) UnmarshalJSON

func (t *BasicWeekDateTimeNoMillis) UnmarshalJSON(data []byte) error

type Boolean

type Boolean bool

Boolean is elastic boolean type. It can be unmarshalled from boolean literal or string literal of "true" / "false" or "" (empty string). see: https://www.elastic.co/guide/en/elasticsearch/reference/8.4/boolean.html

It marshals into boolean literal.

func (Boolean) MarshalJSON

func (b Boolean) MarshalJSON() ([]byte, error)

MarshalJSON marshals this type into byte slice representing JSON boolean literal, true or false.

func (Boolean) String

func (b Boolean) String() string

func (*Boolean) UnmarshalJSON

func (b *Boolean) UnmarshalJSON(data []byte) error

type BooleanStr

type BooleanStr bool

BooleanStr is elastic boolean type. It can be unmarshalled from boolean literal of string literal of "true" / "false" or "" (empty string). see: https://www.elastic.co/guide/en/elasticsearch/reference/8.4/boolean.html

It marshals into string literal, "true" or "false".

func (BooleanStr) MarshalJSON

func (b BooleanStr) MarshalJSON() ([]byte, error)

MarshalJSON marshals this type into byte slice representing JSON string literal, "true" or "false". This never converts to an empty string.

func (BooleanStr) String

func (b BooleanStr) String() string

func (*BooleanStr) UnmarshalJSON

func (b *BooleanStr) UnmarshalJSON(data []byte) error

type Date

type Date time.Time

func (Date) MarshalJSON

func (t Date) MarshalJSON() ([]byte, error)

func (Date) String

func (t Date) String() string

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(data []byte) error

type DateHour

type DateHour time.Time

func (DateHour) MarshalJSON

func (t DateHour) MarshalJSON() ([]byte, error)

func (DateHour) String

func (t DateHour) String() string

func (*DateHour) UnmarshalJSON

func (t *DateHour) UnmarshalJSON(data []byte) error

type DateHourMinute

type DateHourMinute time.Time

func (DateHourMinute) MarshalJSON

func (t DateHourMinute) MarshalJSON() ([]byte, error)

func (DateHourMinute) String

func (t DateHourMinute) String() string

func (*DateHourMinute) UnmarshalJSON

func (t *DateHourMinute) UnmarshalJSON(data []byte) error

type DateHourMinuteSecond

type DateHourMinuteSecond time.Time

func (DateHourMinuteSecond) MarshalJSON

func (t DateHourMinuteSecond) MarshalJSON() ([]byte, error)

func (DateHourMinuteSecond) String

func (t DateHourMinuteSecond) String() string

func (*DateHourMinuteSecond) UnmarshalJSON

func (t *DateHourMinuteSecond) UnmarshalJSON(data []byte) error

type DateHourMinuteSecondFraction

type DateHourMinuteSecondFraction time.Time

func (DateHourMinuteSecondFraction) MarshalJSON

func (t DateHourMinuteSecondFraction) MarshalJSON() ([]byte, error)

func (DateHourMinuteSecondFraction) String

func (*DateHourMinuteSecondFraction) UnmarshalJSON

func (t *DateHourMinuteSecondFraction) UnmarshalJSON(data []byte) error

type DateHourMinuteSecondMillis

type DateHourMinuteSecondMillis time.Time

func (DateHourMinuteSecondMillis) MarshalJSON

func (t DateHourMinuteSecondMillis) MarshalJSON() ([]byte, error)

func (DateHourMinuteSecondMillis) String

func (*DateHourMinuteSecondMillis) UnmarshalJSON

func (t *DateHourMinuteSecondMillis) UnmarshalJSON(data []byte) error

type DateOptionalTime

type DateOptionalTime time.Time

func (DateOptionalTime) MarshalJSON

func (t DateOptionalTime) MarshalJSON() ([]byte, error)

func (DateOptionalTime) String

func (t DateOptionalTime) String() string

func (*DateOptionalTime) UnmarshalJSON

func (t *DateOptionalTime) UnmarshalJSON(data []byte) error

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (DateTime) String

func (t DateTime) String() string

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(data []byte) error

type DateTimeNoMillis

type DateTimeNoMillis time.Time

func (DateTimeNoMillis) MarshalJSON

func (t DateTimeNoMillis) MarshalJSON() ([]byte, error)

func (DateTimeNoMillis) String

func (t DateTimeNoMillis) String() string

func (*DateTimeNoMillis) UnmarshalJSON

func (t *DateTimeNoMillis) UnmarshalJSON(data []byte) error

type EpochMillis

type EpochMillis time.Time

func (EpochMillis) MarshalJSON

func (t EpochMillis) MarshalJSON() ([]byte, error)

func (EpochMillis) String

func (t EpochMillis) String() string

func (*EpochMillis) UnmarshalJSON

func (t *EpochMillis) UnmarshalJSON(data []byte) error

type EpochSecond

type EpochSecond time.Time

func (EpochSecond) MarshalJSON

func (t EpochSecond) MarshalJSON() ([]byte, error)

func (EpochSecond) String

func (t EpochSecond) String() string

func (*EpochSecond) UnmarshalJSON

func (t *EpochSecond) UnmarshalJSON(data []byte) error

type Field

type Field[T any] struct {
	// contains filtered or unexported fields
}

Field is a helper type to store an Elasticsearch JSON field. Field supports only undefined, null, T and T[], while Elasticsearch allows it to be one of undefined, null, null[], (null | T)[], T, T[] or T[][]. see: https://www.elastic.co/guide/en/elasticsearch/reference/8.4/array.html

func MapField

func MapField[T, U any](field Field[T], mapper func(v T) U) Field[U]

MapField returns a new Field[T] whose values are elements of field mapped through mapper.

func NewField

func NewField[T any](v *[]T) Field[T]

NewField returns a new Field. The returned Field does not points to the data that v does. Instead Field will use cloned content of v if not nil.

func NewFieldNull

func NewFieldNull[T any]() Field[T]

func NewFieldSinglePointer

func NewFieldSinglePointer[T any](v *T, nilIsNull bool) Field[T]

func NewFieldSingleValue

func NewFieldSingleValue[T any](v T) Field[T]

func NewFieldSlice

func NewFieldSlice[T any](v []T, nilIsNull bool) Field[T]

NewFieldSlice returns a new Field. The returned Field uses cloned v.

func NewFieldUnsafe

func NewFieldUnsafe[T any](v *[]T) Field[T]

NewFieldUnsafe returns a new Field. This does not clone v.

func (Field[T]) IsEmpty

func (f Field[T]) IsEmpty() bool

func (Field[T]) IsNull

func (f Field[T]) IsNull() bool

func (Field[T]) IsUndefined

func (f Field[T]) IsUndefined() bool

func (Field[T]) MarshalJSON

func (f Field[T]) MarshalJSON() ([]byte, error)

MarshalJSON encodes f into a json format. It always marshalls as []T.

For most cases, a struct that contains Field[T] should be marshalled through MarshalFieldsJSON.

func (*Field[T]) SetEmpty

func (f *Field[T]) SetEmpty()

SetEmpty sets the empty []T to f.

func (*Field[T]) SetNull

func (f *Field[T]) SetNull()

func (*Field[T]) SetSingleValue

func (f *Field[T]) SetSingleValue(value T)

func (*Field[T]) SetUndefined

func (f *Field[T]) SetUndefined()

func (*Field[T]) SetValue

func (f *Field[T]) SetValue(value []T)

SetValue sets cloned value.

func (*Field[T]) UnmarshalJSON

func (b *Field[T]) UnmarshalJSON(data []byte) error

func (Field[T]) Unwrap

func (f Field[T]) Unwrap() []T

func (Field[T]) UnwrapSingle

func (f Field[T]) UnwrapSingle() T

func (Field[T]) Value

func (f Field[T]) Value() *[]T

func (Field[T]) ValueAny

func (f Field[T]) ValueAny(single bool) any

ValueAny returns inner value in any type. This can be used without any instantiation.

ValueAny returns nil if f is null or undefined. For other cases:

  • If single is true, it returns either single T or zero value of T if and only if inner value is zero length.
  • If single is false, it returns []T. It could be length of zero.

func (Field[T]) ValueSingle

func (f Field[T]) ValueSingle() *T

func (Field[T]) ValueSingleZero

func (f Field[T]) ValueSingleZero() T

ValueSingleZero gets the inner value of f, or falls back to zero value for T. If the inner value non-empty, it returns that value. Otherwise, returns zero value of T.

func (Field[T]) ValueZero

func (f Field[T]) ValueZero() []T

ValueZero gets the inner value of f, or zero value for T. A returned value must be non-nil []T. If the inner value is non-empty, it returns that value. Otherwise, returns newly created zero-length []T.

type Geopoint

type Geopoint struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

Elasticsearch geopoint type.

For historical reason, it has 6 formats to represent same data type. This type marshal into only one format, simple json consists of lat and lon keys populated with Number, namely, `{"lat":123, "lon":456}`.

see: https://www.elastic.co/guide/en/elasticsearch/reference/8.4/geo-point.html

func UnmarshalEsGeopointJSON

func UnmarshalEsGeopointJSON(data []byte) (Geopoint, error)

func UnmarshalEsGeopointText

func UnmarshalEsGeopointText(text []byte) (Geopoint, error)

func (*Geopoint) UnmarshalJSON

func (g *Geopoint) UnmarshalJSON(data []byte) error

func (*Geopoint) UnmarshalText

func (g *Geopoint) UnmarshalText(text []byte) error

type Geoshape

type Geoshape struct {
	// avoid embedding this because it could confuse user when re-defined type is made in user code.
	Geometry geom.Geometry
}

TODO: test against elasticsearch 8.4

func (Geoshape) MarshalJSON

func (g Geoshape) MarshalJSON() ([]byte, error)

func (*Geoshape) UnmarshalJSON

func (g *Geoshape) UnmarshalJSON(data []byte) error

type Hour

type Hour time.Time

func (Hour) MarshalJSON

func (t Hour) MarshalJSON() ([]byte, error)

func (Hour) String

func (t Hour) String() string

func (*Hour) UnmarshalJSON

func (t *Hour) UnmarshalJSON(data []byte) error

type HourMinute

type HourMinute time.Time

func (HourMinute) MarshalJSON

func (t HourMinute) MarshalJSON() ([]byte, error)

func (HourMinute) String

func (t HourMinute) String() string

func (*HourMinute) UnmarshalJSON

func (t *HourMinute) UnmarshalJSON(data []byte) error

type HourMinuteSecond

type HourMinuteSecond time.Time

func (HourMinuteSecond) MarshalJSON

func (t HourMinuteSecond) MarshalJSON() ([]byte, error)

func (HourMinuteSecond) String

func (t HourMinuteSecond) String() string

func (*HourMinuteSecond) UnmarshalJSON

func (t *HourMinuteSecond) UnmarshalJSON(data []byte) error

type HourMinuteSecondFraction

type HourMinuteSecondFraction time.Time

func (HourMinuteSecondFraction) MarshalJSON

func (t HourMinuteSecondFraction) MarshalJSON() ([]byte, error)

func (HourMinuteSecondFraction) String

func (t HourMinuteSecondFraction) String() string

func (*HourMinuteSecondFraction) UnmarshalJSON

func (t *HourMinuteSecondFraction) UnmarshalJSON(data []byte) error

type HourMinuteSecondMillis

type HourMinuteSecondMillis time.Time

func (HourMinuteSecondMillis) MarshalJSON

func (t HourMinuteSecondMillis) MarshalJSON() ([]byte, error)

func (HourMinuteSecondMillis) String

func (t HourMinuteSecondMillis) String() string

func (*HourMinuteSecondMillis) UnmarshalJSON

func (t *HourMinuteSecondMillis) UnmarshalJSON(data []byte) error

type InvalidTypeError

type InvalidTypeError struct {
	// name of Go type
	Type         string
	SupposedToBe []any
	InputValue   []byte
}

func (*InvalidTypeError) Error

func (e *InvalidTypeError) Error() string

type NumParser

type NumParser = func(value int64) time.Time

type OrdinalDate

type OrdinalDate time.Time

func (OrdinalDate) MarshalJSON

func (t OrdinalDate) MarshalJSON() ([]byte, error)

func (OrdinalDate) String

func (t OrdinalDate) String() string

func (*OrdinalDate) UnmarshalJSON

func (t *OrdinalDate) UnmarshalJSON(data []byte) error

type OrdinalDateTime

type OrdinalDateTime time.Time

func (OrdinalDateTime) MarshalJSON

func (t OrdinalDateTime) MarshalJSON() ([]byte, error)

func (OrdinalDateTime) String

func (t OrdinalDateTime) String() string

func (*OrdinalDateTime) UnmarshalJSON

func (t *OrdinalDateTime) UnmarshalJSON(data []byte) error

type OrdinalDateTimeNoMillis

type OrdinalDateTimeNoMillis time.Time

func (OrdinalDateTimeNoMillis) MarshalJSON

func (t OrdinalDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (OrdinalDateTimeNoMillis) String

func (t OrdinalDateTimeNoMillis) String() string

func (*OrdinalDateTimeNoMillis) UnmarshalJSON

func (t *OrdinalDateTimeNoMillis) UnmarshalJSON(data []byte) error

type StrParser

type StrParser = func(value string) (time.Time, error)

type StrictBasicWeekDate

type StrictBasicWeekDate time.Time

func (StrictBasicWeekDate) MarshalJSON

func (t StrictBasicWeekDate) MarshalJSON() ([]byte, error)

func (StrictBasicWeekDate) String

func (t StrictBasicWeekDate) String() string

func (*StrictBasicWeekDate) UnmarshalJSON

func (t *StrictBasicWeekDate) UnmarshalJSON(data []byte) error

type StrictBasicWeekDateTime

type StrictBasicWeekDateTime time.Time

func (StrictBasicWeekDateTime) MarshalJSON

func (t StrictBasicWeekDateTime) MarshalJSON() ([]byte, error)

func (StrictBasicWeekDateTime) String

func (t StrictBasicWeekDateTime) String() string

func (*StrictBasicWeekDateTime) UnmarshalJSON

func (t *StrictBasicWeekDateTime) UnmarshalJSON(data []byte) error

type StrictBasicWeekDateTimeNoMillis

type StrictBasicWeekDateTimeNoMillis time.Time

func (StrictBasicWeekDateTimeNoMillis) MarshalJSON

func (t StrictBasicWeekDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (StrictBasicWeekDateTimeNoMillis) String

func (*StrictBasicWeekDateTimeNoMillis) UnmarshalJSON

func (t *StrictBasicWeekDateTimeNoMillis) UnmarshalJSON(data []byte) error

type StrictDate

type StrictDate time.Time

func (StrictDate) MarshalJSON

func (t StrictDate) MarshalJSON() ([]byte, error)

func (StrictDate) String

func (t StrictDate) String() string

func (*StrictDate) UnmarshalJSON

func (t *StrictDate) UnmarshalJSON(data []byte) error

type StrictDateHour

type StrictDateHour time.Time

func (StrictDateHour) MarshalJSON

func (t StrictDateHour) MarshalJSON() ([]byte, error)

func (StrictDateHour) String

func (t StrictDateHour) String() string

func (*StrictDateHour) UnmarshalJSON

func (t *StrictDateHour) UnmarshalJSON(data []byte) error

type StrictDateHourMinute

type StrictDateHourMinute time.Time

func (StrictDateHourMinute) MarshalJSON

func (t StrictDateHourMinute) MarshalJSON() ([]byte, error)

func (StrictDateHourMinute) String

func (t StrictDateHourMinute) String() string

func (*StrictDateHourMinute) UnmarshalJSON

func (t *StrictDateHourMinute) UnmarshalJSON(data []byte) error

type StrictDateHourMinuteSecond

type StrictDateHourMinuteSecond time.Time

func (StrictDateHourMinuteSecond) MarshalJSON

func (t StrictDateHourMinuteSecond) MarshalJSON() ([]byte, error)

func (StrictDateHourMinuteSecond) String

func (*StrictDateHourMinuteSecond) UnmarshalJSON

func (t *StrictDateHourMinuteSecond) UnmarshalJSON(data []byte) error

type StrictDateHourMinuteSecondFraction

type StrictDateHourMinuteSecondFraction time.Time

func (StrictDateHourMinuteSecondFraction) MarshalJSON

func (t StrictDateHourMinuteSecondFraction) MarshalJSON() ([]byte, error)

func (StrictDateHourMinuteSecondFraction) String

func (*StrictDateHourMinuteSecondFraction) UnmarshalJSON

func (t *StrictDateHourMinuteSecondFraction) UnmarshalJSON(data []byte) error

type StrictDateHourMinuteSecondMillis

type StrictDateHourMinuteSecondMillis time.Time

func (StrictDateHourMinuteSecondMillis) MarshalJSON

func (t StrictDateHourMinuteSecondMillis) MarshalJSON() ([]byte, error)

func (StrictDateHourMinuteSecondMillis) String

func (*StrictDateHourMinuteSecondMillis) UnmarshalJSON

func (t *StrictDateHourMinuteSecondMillis) UnmarshalJSON(data []byte) error

type StrictDateOptionalTime

type StrictDateOptionalTime time.Time

func (StrictDateOptionalTime) MarshalJSON

func (t StrictDateOptionalTime) MarshalJSON() ([]byte, error)

func (StrictDateOptionalTime) String

func (t StrictDateOptionalTime) String() string

func (*StrictDateOptionalTime) UnmarshalJSON

func (t *StrictDateOptionalTime) UnmarshalJSON(data []byte) error

type StrictDateOptionalTimeEpochMillis

type StrictDateOptionalTimeEpochMillis time.Time

func (StrictDateOptionalTimeEpochMillis) MarshalJSON

func (t StrictDateOptionalTimeEpochMillis) MarshalJSON() ([]byte, error)

func (StrictDateOptionalTimeEpochMillis) String

func (*StrictDateOptionalTimeEpochMillis) UnmarshalJSON

func (t *StrictDateOptionalTimeEpochMillis) UnmarshalJSON(data []byte) error

type StrictDateOptionalTimeNanos

type StrictDateOptionalTimeNanos time.Time

func (StrictDateOptionalTimeNanos) MarshalJSON

func (t StrictDateOptionalTimeNanos) MarshalJSON() ([]byte, error)

func (StrictDateOptionalTimeNanos) String

func (*StrictDateOptionalTimeNanos) UnmarshalJSON

func (t *StrictDateOptionalTimeNanos) UnmarshalJSON(data []byte) error

type StrictDateOptionalTimeNanosEpochMillis

type StrictDateOptionalTimeNanosEpochMillis time.Time

func (StrictDateOptionalTimeNanosEpochMillis) MarshalJSON

func (t StrictDateOptionalTimeNanosEpochMillis) MarshalJSON() ([]byte, error)

func (StrictDateOptionalTimeNanosEpochMillis) String

func (*StrictDateOptionalTimeNanosEpochMillis) UnmarshalJSON

func (t *StrictDateOptionalTimeNanosEpochMillis) UnmarshalJSON(data []byte) error

type StrictDateTime

type StrictDateTime time.Time

func (StrictDateTime) MarshalJSON

func (t StrictDateTime) MarshalJSON() ([]byte, error)

func (StrictDateTime) String

func (t StrictDateTime) String() string

func (*StrictDateTime) UnmarshalJSON

func (t *StrictDateTime) UnmarshalJSON(data []byte) error

type StrictDateTimeNoMillis

type StrictDateTimeNoMillis time.Time

func (StrictDateTimeNoMillis) MarshalJSON

func (t StrictDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (StrictDateTimeNoMillis) String

func (t StrictDateTimeNoMillis) String() string

func (*StrictDateTimeNoMillis) UnmarshalJSON

func (t *StrictDateTimeNoMillis) UnmarshalJSON(data []byte) error

type StrictHour

type StrictHour time.Time

func (StrictHour) MarshalJSON

func (t StrictHour) MarshalJSON() ([]byte, error)

func (StrictHour) String

func (t StrictHour) String() string

func (*StrictHour) UnmarshalJSON

func (t *StrictHour) UnmarshalJSON(data []byte) error

type StrictHourMinute

type StrictHourMinute time.Time

func (StrictHourMinute) MarshalJSON

func (t StrictHourMinute) MarshalJSON() ([]byte, error)

func (StrictHourMinute) String

func (t StrictHourMinute) String() string

func (*StrictHourMinute) UnmarshalJSON

func (t *StrictHourMinute) UnmarshalJSON(data []byte) error

type StrictHourMinuteSecond

type StrictHourMinuteSecond time.Time

func (StrictHourMinuteSecond) MarshalJSON

func (t StrictHourMinuteSecond) MarshalJSON() ([]byte, error)

func (StrictHourMinuteSecond) String

func (t StrictHourMinuteSecond) String() string

func (*StrictHourMinuteSecond) UnmarshalJSON

func (t *StrictHourMinuteSecond) UnmarshalJSON(data []byte) error

type StrictHourMinuteSecondFraction

type StrictHourMinuteSecondFraction time.Time

func (StrictHourMinuteSecondFraction) MarshalJSON

func (t StrictHourMinuteSecondFraction) MarshalJSON() ([]byte, error)

func (StrictHourMinuteSecondFraction) String

func (*StrictHourMinuteSecondFraction) UnmarshalJSON

func (t *StrictHourMinuteSecondFraction) UnmarshalJSON(data []byte) error

type StrictHourMinuteSecondMillis

type StrictHourMinuteSecondMillis time.Time

func (StrictHourMinuteSecondMillis) MarshalJSON

func (t StrictHourMinuteSecondMillis) MarshalJSON() ([]byte, error)

func (StrictHourMinuteSecondMillis) String

func (*StrictHourMinuteSecondMillis) UnmarshalJSON

func (t *StrictHourMinuteSecondMillis) UnmarshalJSON(data []byte) error

type StrictOrdinalDate

type StrictOrdinalDate time.Time

func (StrictOrdinalDate) MarshalJSON

func (t StrictOrdinalDate) MarshalJSON() ([]byte, error)

func (StrictOrdinalDate) String

func (t StrictOrdinalDate) String() string

func (*StrictOrdinalDate) UnmarshalJSON

func (t *StrictOrdinalDate) UnmarshalJSON(data []byte) error

type StrictOrdinalDateTime

type StrictOrdinalDateTime time.Time

func (StrictOrdinalDateTime) MarshalJSON

func (t StrictOrdinalDateTime) MarshalJSON() ([]byte, error)

func (StrictOrdinalDateTime) String

func (t StrictOrdinalDateTime) String() string

func (*StrictOrdinalDateTime) UnmarshalJSON

func (t *StrictOrdinalDateTime) UnmarshalJSON(data []byte) error

type StrictOrdinalDateTimeNoMillis

type StrictOrdinalDateTimeNoMillis time.Time

func (StrictOrdinalDateTimeNoMillis) MarshalJSON

func (t StrictOrdinalDateTimeNoMillis) MarshalJSON() ([]byte, error)

func (StrictOrdinalDateTimeNoMillis) String

func (*StrictOrdinalDateTimeNoMillis) UnmarshalJSON

func (t *StrictOrdinalDateTimeNoMillis) UnmarshalJSON(data []byte) error

type StrictTTime

type StrictTTime time.Time

func (StrictTTime) MarshalJSON

func (t StrictTTime) MarshalJSON() ([]byte, error)

func (StrictTTime) String

func (t StrictTTime) String() string

func (*StrictTTime) UnmarshalJSON

func (t *StrictTTime) UnmarshalJSON(data []byte) error

type StrictTTimeNoMillis

type StrictTTimeNoMillis time.Time

func (StrictTTimeNoMillis) MarshalJSON

func (t StrictTTimeNoMillis) MarshalJSON() ([]byte, error)

func (StrictTTimeNoMillis) String

func (t StrictTTimeNoMillis) String() string

func (*StrictTTimeNoMillis) UnmarshalJSON

func (t *StrictTTimeNoMillis) UnmarshalJSON(data []byte) error

type StrictTime

type StrictTime time.Time

func (StrictTime) MarshalJSON

func (t StrictTime) MarshalJSON() ([]byte, error)

func (StrictTime) String

func (t StrictTime) String() string

func (*StrictTime) UnmarshalJSON

func (t *StrictTime) UnmarshalJSON(data []byte) error

type StrictTimeNoMillis

type StrictTimeNoMillis time.Time

func (StrictTimeNoMillis) MarshalJSON

func (t StrictTimeNoMillis) MarshalJSON() ([]byte, error)

func (StrictTimeNoMillis) String

func (t StrictTimeNoMillis) String() string

func (*StrictTimeNoMillis) UnmarshalJSON

func (t *StrictTimeNoMillis) UnmarshalJSON(data []byte) error

type StrictYear

type StrictYear time.Time

func (StrictYear) MarshalJSON

func (t StrictYear) MarshalJSON() ([]byte, error)

func (StrictYear) String

func (t StrictYear) String() string

func (*StrictYear) UnmarshalJSON

func (t *StrictYear) UnmarshalJSON(data []byte) error

type StrictYearMonth

type StrictYearMonth time.Time

func (StrictYearMonth) MarshalJSON

func (t StrictYearMonth) MarshalJSON() ([]byte, error)

func (StrictYearMonth) String

func (t StrictYearMonth) String() string

func (*StrictYearMonth) UnmarshalJSON

func (t *StrictYearMonth) UnmarshalJSON(data []byte) error

type StrictYearMonthDay

type StrictYearMonthDay time.Time

func (StrictYearMonthDay) MarshalJSON

func (t StrictYearMonthDay) MarshalJSON() ([]byte, error)

func (StrictYearMonthDay) String

func (t StrictYearMonthDay) String() string

func (*StrictYearMonthDay) UnmarshalJSON

func (t *StrictYearMonthDay) UnmarshalJSON(data []byte) error

type TTime

type TTime time.Time

func (TTime) MarshalJSON

func (t TTime) MarshalJSON() ([]byte, error)

func (TTime) String

func (t TTime) String() string

func (*TTime) UnmarshalJSON

func (t *TTime) UnmarshalJSON(data []byte) error

type TTimeNoMillis

type TTimeNoMillis time.Time

func (TTimeNoMillis) MarshalJSON

func (t TTimeNoMillis) MarshalJSON() ([]byte, error)

func (TTimeNoMillis) String

func (t TTimeNoMillis) String() string

func (*TTimeNoMillis) UnmarshalJSON

func (t *TTimeNoMillis) UnmarshalJSON(data []byte) error

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type TimeNoMillis

type TimeNoMillis time.Time

func (TimeNoMillis) MarshalJSON

func (t TimeNoMillis) MarshalJSON() ([]byte, error)

func (TimeNoMillis) String

func (t TimeNoMillis) String() string

func (*TimeNoMillis) UnmarshalJSON

func (t *TimeNoMillis) UnmarshalJSON(data []byte) error

type UninstantiatedField

type UninstantiatedField interface {
	ValueAny(mustSingle bool) any
	IsNull() bool
	IsUndefined() bool
}

Parts of Field[T] that can be used without an instantiation.

type Year

type Year time.Time

func (Year) MarshalJSON

func (t Year) MarshalJSON() ([]byte, error)

func (Year) String

func (t Year) String() string

func (*Year) UnmarshalJSON

func (t *Year) UnmarshalJSON(data []byte) error

type YearMonth

type YearMonth time.Time

func (YearMonth) MarshalJSON

func (t YearMonth) MarshalJSON() ([]byte, error)

func (YearMonth) String

func (t YearMonth) String() string

func (*YearMonth) UnmarshalJSON

func (t *YearMonth) UnmarshalJSON(data []byte) error

type YearMonthDay

type YearMonthDay time.Time

func (YearMonthDay) MarshalJSON

func (t YearMonthDay) MarshalJSON() ([]byte, error)

func (YearMonthDay) String

func (t YearMonthDay) String() string

func (*YearMonthDay) UnmarshalJSON

func (t *YearMonthDay) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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