field

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldSliceToJSON

func FieldSliceToJSON(e []Field) json.RawMessage

func FieldToJSON

func FieldToJSON(e Field) json.RawMessage

func StatusSliceToJSON

func StatusSliceToJSON(in []Status) json.RawMessage

func TypeSliceToJSON

func TypeSliceToJSON(in []Type) json.RawMessage

Types

type Field

type Field struct {
	UUID             uuid.UUID                         `json:"uuid"`
	Version          int64                             `json:"version"`
	Identifier       string                            `json:"identifier"`
	Description      string                            `json:"description"`
	Type             Type                              `json:"type"`
	TypeConfig       field_type_config.FieldTypeConfig `json:"type_config"`
	Required         bool                              `json:"required"`
	Key              bool                              `json:"key"`
	KeyAutoIncrement bool                              `json:"key_auto_increment"`
	Unique           bool                              `json:"unique"`
	Deprecated       bool                              `json:"deprecated"`
	Generated        bool                              `json:"generated"`
	Status           Status                            `json:"status"`
	CreatedAt        time.Time                         `json:"created_at"`
	UpdatedAt        time.Time                         `json:"updated_at"`
	CreatedByUUID    uuid.UUID                         `json:"created_by_uuid"`
	UpdatedByUUID    uuid.UUID                         `json:"updated_by_uuid"`
}

func FieldFromJSON

func FieldFromJSON(data json.RawMessage) Field

func FieldSliceFromJSON

func FieldSliceFromJSON(data json.RawMessage) []Field

func NewFieldSliceWithRandomValues

func NewFieldSliceWithRandomValues(n int) []Field

func NewFieldWithRandomValues

func NewFieldWithRandomValues() Field

func (Field) ArrayFieldIdentifierToType

func (e Field) ArrayFieldIdentifierToType() map[string]types.FieldType

func (Field) EntityIdentifier

func (e Field) EntityIdentifier() string

func (Field) FieldIdentfierToTypeMap

func (e Field) FieldIdentfierToTypeMap() map[string]types.FieldType

func (Field) IsDependant

func (e Field) IsDependant() bool

func (Field) String

func (e Field) String() string

func (Field) ToJSON

func (e Field) ToJSON() json.RawMessage

type Status

type Status int64
const (
	STATUS_INVALID Status = iota
	STATUS_ACTIVE
	STATUS_INACTIVE
)

func JSONToStatusSlice

func JSONToStatusSlice(in json.RawMessage) []Status

func StatusFromPointerString

func StatusFromPointerString(in *string) Status

func StatusFromString

func StatusFromString(in string) Status

func (Status) String

func (e Status) String() string

func (Status) StringPtr

func (e Status) StringPtr() *string

func (Status) ToInt64

func (e Status) ToInt64() int64

type Type

type Type int64
const (
	TYPE_INVALID Type = iota
	TYPE_UUID
	TYPE_INTEGER
	TYPE_FLOAT
	TYPE_DECIMAL
	TYPE_BOOLEAN
	TYPE_CHAR
	TYPE_VARCHAR
	TYPE_TEXT
	TYPE_ENCRYPTED
	TYPE_EMAIL
	TYPE_PHONE
	TYPE_URL
	TYPE_LOCATION
	TYPE_COLOR
	TYPE_RICHTEXT
	TYPE_CODE
	TYPE_MARKDOWN
	TYPE_FILE
	TYPE_IMAGE
	TYPE_AUDIO
	TYPE_VIDEO
	TYPE_ENUM
	TYPE_JSON
	TYPE_ARRAY
	TYPE_DATE
	TYPE_DATETIME
	TYPE_TIME
	TYPE_SLUG
)

func JSONToTypeSlice

func JSONToTypeSlice(in json.RawMessage) []Type

func TypeFromPointerString

func TypeFromPointerString(in *string) Type

func TypeFromString

func TypeFromString(in string) Type

func (Type) String

func (e Type) String() string

func (Type) StringPtr

func (e Type) StringPtr() *string

func (Type) ToInt64

func (e Type) ToInt64() int64

Jump to

Keyboard shortcuts

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