property

package
v0.4.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAny

func GetAny[T any](i Value) (T, bool, error)

GetAny returns the underlay value as the given generic type, if not found or parse error, returns false.

func GetBool added in v0.4.0

func GetBool(i Value) (bool, bool, error)

func GetDuration added in v0.4.0

func GetDuration(i Value) (time.Duration, bool, error)

func GetFloat32 added in v0.4.0

func GetFloat32(i Value) (float32, bool, error)

func GetFloat64 added in v0.4.0

func GetFloat64(i Value) (float64, bool, error)

func GetInt added in v0.4.0

func GetInt(i Value) (int, bool, error)

func GetInt16 added in v0.4.0

func GetInt16(i Value) (int16, bool, error)

func GetInt32 added in v0.4.0

func GetInt32(i Value) (int32, bool, error)

func GetInt64 added in v0.4.0

func GetInt64(i Value) (int64, bool, error)

func GetInt8 added in v0.4.0

func GetInt8(i Value) (int8, bool, error)

func GetMap

func GetMap[T any](i Value) (map[string]T, bool, error)

GetMap returns the underlay value as a string map with the given generic type, if not found or parse error, returns false.

func GetNumber added in v0.4.0

func GetNumber(i Value) (any, bool, error)

func GetObject

func GetObject[T any](i Value) (T, bool, error)

GetObject returns the underlay value as a T object with the given generic type, if not found or parse error, returns false.

func GetSlice

func GetSlice[T any](i Value) ([]T, bool, error)

GetSlice returns the underlay value as a slice with the given generic type, if not found or parse error, returns false.

func GetString added in v0.4.0

func GetString(i Value) (string, bool, error)

func GetUint added in v0.4.0

func GetUint(i Value) (uint, bool, error)

func GetUint16 added in v0.4.0

func GetUint16(i Value) (uint16, bool, error)

func GetUint32 added in v0.4.0

func GetUint32(i Value) (uint32, bool, error)

func GetUint64 added in v0.4.0

func GetUint64(i Value) (uint64, bool, error)

func GetUint8 added in v0.4.0

func GetUint8(i Value) (uint8, bool, error)

func ValuesField

func ValuesField(name string) *otherBuilder

ValuesField returns a new ent.Field with type Values.

Types

type Value

type Value = json.RawMessage

Value indicates the value of property.

type Values

type Values map[string]Value

Values holds the Value collection in map, the key of map is the name of Property, stores into json.

func (*Values) Scan

func (i *Values) Scan(src any) error

Scan implements sql.Scanner.

func (Values) ValidateWith

func (i Values) ValidateWith(schema *openapi3.Schema) error

ValidateWith validates the property value with the given schemas.

func (Values) Value

func (i Values) Value() (driver.Value, error)

Value implements driver.Valuer.

Jump to

Keyboard shortcuts

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