extractors

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 21 Imported by: ? 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

Index

Constants

This section is empty.

Variables

View Source
var (
	WithSchemaRegister  = contextx.With[tCtxRegister, SchemaRegister]
	MustSchemaRegister  = contextx.Must[tCtxRegister, SchemaRegister]
	CarrySchemaRegister = contextx.Carry[tCtxRegister, SchemaRegister]
)

Functions

func FieldShouldPick

func FieldShouldPick(t reflect.Type, fieldName string) bool

func PatchSchemaValidation

func PatchSchemaValidation(s jsonschema.Schema, opt validation.Option) (jsonschema.Schema, error)

func RegisterFieldFilter

func RegisterFieldFilter(t reflect.Type, fieldFilter FieldFilter)

func SchemaFrom

func SchemaFrom(ctx context.Context, v any, def bool) jsonschema.Schema

func SchemaFromType

func SchemaFromType(ctx context.Context, t reflect.Type, opt Opt) (s jsonschema.Schema)

SchemaFromType analyze schema from reflect.Type

func SetTitleOrDescription

func SetTitleOrDescription(metadata *jsonschema.Metadata, lines []string)

Types

type FieldExclude

type FieldExclude func(fields ...string)

type FieldFilter

type FieldFilter struct {
	Exclude []string
	Include []string
}

type K8sAPIVersionGetter

type K8sAPIVersionGetter interface {
	GetAPIVersion() string
}

type K8sKindGetter

type K8sKindGetter interface {
	GetKind() string
}

type K8sObjectKindGetter

type K8sObjectKindGetter interface {
	GetObjectKind() schema.ObjectKind
}

type Opt

type Opt struct {
	Decl      bool
	Doc       map[string]string
	EnumInDoc []string
}

func (Opt) WithDecl

func (o Opt) WithDecl(decl bool) Opt

func (Opt) WithDoc

func (o Opt) WithDoc(doc map[string]string) Opt

func (Opt) WithEnumInDoc

func (o Opt) WithEnumInDoc(enumInDoc []string) Opt

type SchemaRegister

type SchemaRegister interface {
	RegisterSchema(ref string, s jsonschema.Schema)
	RefString(ref string) string
	Record(typeRef string) bool
}

func SchemaRegisterFrom

func SchemaRegisterFrom(ctx context.Context) SchemaRegister

type TypeName

type TypeName string

func (TypeName) RefString

func (t TypeName) RefString() string

Jump to

Keyboard shortcuts

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