annotation

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	// SkipInput indicates how to skip generating into *Input struct.
	SkipInput struct {
		// Query skips generating the field or edge into *QueryInput struct if true.
		Query bool `json:"Query,omitempty"`
		// Create skips generating the field or edge into *CreateInput struct if true.
		Create bool `json:"Create,omitempty"`
		// Update skips generating the field or edge into *UpdateInput struct if true.
		Update bool `json:"Update,omitempty"`
	} `json:"SkipInput,omitempty"`

	// Input indicates how to generate into *Input struct.
	Input struct {
		// Query generates the field into *QueryInput struct if true.
		Query bool `json:"Query,omitempty"`
		// Create generates the edge into *CreateInput struct if true.
		Create bool `json:"Create,omitempty"`
		// Update generates the immutable field or edge into *UpdateInput struct if true.
		Update bool `json:"Update,omitempty"`
	} `json:"Input,omitempty"`

	// ValidateContextFuncs indicates funcs to call before validating *Input struct.
	ValidateContextFuncs []string `json:"ValidateContextFuncs,omitempty"`

	// SkipOutput skips generating the field or edge into *Output struct.
	SkipOutput bool `json:"SkipOutput,omitempty"`

	// SkipClearing skips generating clearer if the mutable field is optional at updating.
	SkipClearing bool `json:"SkipClearing,omitempty"`

	// SkipStoring treats the field as additional field,
	// which is not stored in the database.
	SkipStoring bool `json:"SkipStoring,omitempty"`
}

func ExtractAnnotation

func ExtractAnnotation(ants gen.Annotations) (ant Annotation, err error)

ExtractAnnotation extracts the entx.Annotation or returns its empty value.

func MustExtractAnnotation

func MustExtractAnnotation(ants gen.Annotations) Annotation

MustExtractAnnotation extracts the entx.Annotation or panics.

func (*Annotation) Decode

func (a *Annotation) Decode(annotation any) error

func (Annotation) Merge

func (a Annotation) Merge(other schema.Annotation) schema.Annotation

func (Annotation) Name

func (Annotation) Name() string

Jump to

Keyboard shortcuts

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