scan

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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