scan

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package scan defines scanning responsibilities for struct/DQL inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Path                string
	Name                string
	Index               []int
	Type                reflect.Type
	QuerySelector       string
	ComponentInputType  reflect.Type
	ComponentOutputType reflect.Type
	ComponentInputName  string
	ComponentOutputName string
	Tag                 reflect.StructTag
	Anonymous           bool
	ViewTypeName        string
	ViewDest            string

	HasViewTag      bool
	HasStateTag     bool
	HasComponentTag bool
	ViewTag         *tags.Tag
	StateTag        *tags.Tag
	ComponentTag    *componenttag.Tag
}

Field describes one scanned struct field.

type Result

type Result struct {
	RootType        reflect.Type
	EmbedFS         *embed.FS
	Fields          []*Field
	ByPath          map[string]*Field
	ViewFields      []*Field
	StateFields     []*Field
	ComponentFields []*Field
}

Result holds scan output produced from a struct source.

func DescriptorsFrom added in v0.38.0

func DescriptorsFrom(a *shape.ScanResult) (*Result, bool)

DescriptorsFrom extracts the typed scan result from a ScanResult. Returns (nil, false) when a is nil or contains an unexpected concrete type.

func (*Result) ShapeSpecKind added in v0.38.0

func (r *Result) ShapeSpecKind() string

ShapeSpecKind implements shape.ScanSpec.

type StructScanner

type StructScanner struct{}

StructScanner scans arbitrary struct types and extracts Datly-relevant tags.

func New

func New() *StructScanner

New returns a Scanner implementation for shape facade.

func (*StructScanner) Scan

func (s *StructScanner) Scan(ctx context.Context, source *shape.Source, _ ...shape.ScanOption) (*shape.ScanResult, error)

Scan implements shape.Scanner.

Jump to

Keyboard shortcuts

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