entity

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func JSONDefaultValue

func JSONDefaultValue[T any](val string) T

func JSONDefaultValueWithError

func JSONDefaultValueWithError[T any](val string) (T, error)

func ValidateEmail

func ValidateEmail(val string) error

func ValidateJSONDefaultValue

func ValidateJSONDefaultValue(val string) error

func ValidatePhone

func ValidatePhone(val string) error

Types

type CreateEdgeInput

type CreateEdgeInput struct {
	Caption          string
	RelatedEntity    *EntityConnectInput
	Required         *bool
	RelationType     RelationType
	Private          *bool
	BelongsToCaption *string
	Type             *string
	Ref              string
}

type CreateEntityInput

type CreateEntityInput struct {
	Caption      string
	DisplayField FieldWhereUniqueInput
	Fields       *CreateManyFieldsInput
	Edges        *CreateManyEdgesInput
}

type CreateFieldInput

type CreateFieldInput struct {
	Caption        string
	Type           string
	Required       *bool
	Unique         *bool
	DefaultValue   *string
	Min            *string
	Max            *string
	Private        *bool
	AcceptedValues []string
}

type CreateManyEdgesInput

type CreateManyEdgesInput struct {
	Create []*CreateEdgeInput
}

type CreateManyFieldsInput

type CreateManyFieldsInput struct {
	Create []*CreateFieldInput
}

type Edge

type Edge struct {
	Name             string
	EntName          string
	Caption          string
	Type             string
	BelongsToCaption *string
	Required         *bool
	RelationType     RelationType
	Private          *bool
	Ref              string
}

func (*Edge) ApplyUpdateInput

func (e *Edge) ApplyUpdateInput(data UpdateEdgeInput)

func (Edge) Equals

func (f Edge) Equals(uniqueInput EdgeWhereUniqueInput) bool

func (Edge) Validate

func (e Edge) Validate() error

type EdgeWhereUniqueInput

type EdgeWhereUniqueInput struct {
	Name    *string
	Caption *string
}

type Entity

type Entity struct {
	Name             string
	EntName          string
	Caption          string
	Owner            EntityOwner
	DisplayFieldName string
}

func (*Entity) ApplyUpdateInput

func (e *Entity) ApplyUpdateInput(data UpdateEntityInput)

func (Entity) Equals

func (f Entity) Equals(uniqueInput EntityWhereUniqueInput) bool

func (Entity) Validate

func (f Entity) Validate() error

type EntityConnectInput

type EntityConnectInput struct {
	Connect EntityWhereUniqueInput
}

type EntityOwner

type EntityOwner string
const (
	EntityOwnerAdmin EntityOwner = "Admin"
	EntityOwnerUser  EntityOwner = "User"
)

func (EntityOwner) IsValid

func (e EntityOwner) IsValid() bool

func (EntityOwner) MarshalGQL

func (e EntityOwner) MarshalGQL(w io.Writer)

func (EntityOwner) String

func (e EntityOwner) String() string

func (*EntityOwner) UnmarshalGQL

func (e *EntityOwner) UnmarshalGQL(v interface{}) error

type EntityWhereUniqueInput

type EntityWhereUniqueInput struct {
	Name    *string
	Caption *string
	EntName *string
}

type Field

type Field struct {
	Name           string
	EntName        string
	Caption        string
	Type           string
	Required       *bool
	Unique         *bool
	DefaultValue   *string
	Min            *string
	Max            *string
	Private        *bool
	Nillable       bool
	UpdateDefault  bool
	AcceptedValues []string
}

func (*Field) ApplyUpdateInput

func (f *Field) ApplyUpdateInput(data UpdateFieldInput)

func (Field) Equals

func (f Field) Equals(uniqueInput FieldWhereUniqueInput) bool

func (Field) Validate

func (f Field) Validate() error

type FieldType

type FieldType string
const (
	FieldTypeID             FieldType = "ID"
	FieldTypeShortText      FieldType = "ShortText"
	FieldTypeLongText       FieldType = "LongText"
	FieldTypeRichText       FieldType = "RichText"
	FieldTypeEmail          FieldType = "Email"
	FieldTypeInteger        FieldType = "Integer"
	FieldTypeDecimal        FieldType = "Decimal"
	FieldTypeFloat          FieldType = "Float"
	FieldTypeBoolean        FieldType = "Boolean"
	FieldTypeSingleChoice   FieldType = "SingleChoice"
	FieldTypeMultipleChoice FieldType = "MultipleChoice"
	FieldTypeDateTime       FieldType = "DateTime"
	FieldTypeDate           FieldType = "Date"
	FieldTypeTime           FieldType = "Time"
	FieldTypeJson           FieldType = "Json"
	FieldTypeEnum           FieldType = "Enum"
	FieldTypeEnums          FieldType = "Enums"
)

type FieldWhereUniqueInput

type FieldWhereUniqueInput struct {
	Name    *string
	Caption *string
}

type RelationType

type RelationType string
const (
	RelationTypeOne  RelationType = "One"
	RelationTypeMany RelationType = "Many"
	RelationTypeO2O  RelationType = "OneToOne"
	RelationTypeO2M  RelationType = "OneToMany"
	RelationTypeM2O  RelationType = "ManyToOne"
	RelationTypeM2M  RelationType = "ManyToMany"
)

func (RelationType) IsValid

func (e RelationType) IsValid() bool

func (RelationType) MarshalGQL

func (e RelationType) MarshalGQL(w io.Writer)

func (RelationType) String

func (e RelationType) String() string

func (*RelationType) UnmarshalGQL

func (e *RelationType) UnmarshalGQL(v interface{}) error

func (RelationType) VariableName

func (e RelationType) VariableName() string

type UpdateEdgeInput

type UpdateEdgeInput struct {
	Caption  *string
	Required *bool
	Private  *bool
}

type UpdateEntityInput

type UpdateEntityInput struct {
	Caption      *string
	DisplayField *FieldWhereUniqueInput
	Fields       *UpdateManyFieldsInput
	Edges        *UpdateManyEdgesInput
}

type UpdateFieldInput

type UpdateFieldInput struct {
	Caption        *string  `json:"caption"`
	Required       *bool    `json:"required"`
	Unique         *bool    `json:"unique"`
	DefaultValue   *string  `json:"defaultValue"`
	Min            *string  `json:"min"`
	Max            *string  `json:"max"`
	Private        *bool    `json:"private"`
	AcceptedValues []string `json:"acceptedValues"`
}

type UpdateManyEdgesInput

type UpdateManyEdgesInput struct {
	Create []*CreateEdgeInput      `json:"create"`
	Update []*UpdateOneEdgeInput   `json:"update"`
	Delete []*EdgeWhereUniqueInput `json:"delete"`
}

type UpdateManyFieldsInput

type UpdateManyFieldsInput struct {
	Create []*CreateFieldInput      `json:"create"`
	Update []*UpdateOneFieldInput   `json:"update"`
	Delete []*FieldWhereUniqueInput `json:"delete"`
}

type UpdateOneEdgeInput

type UpdateOneEdgeInput struct {
	Where EdgeWhereUniqueInput
	Data  UpdateEdgeInput
}

type UpdateOneFieldInput

type UpdateOneFieldInput struct {
	Where FieldWhereUniqueInput
	Data  UpdateFieldInput
}

Jump to

Keyboard shortcuts

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