extractors

package
v0.0.0-...-95995d7 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package extractors GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var RuntimeDocerContext = contextx.New[RuntimeDocer]()
View Source
var SchemaRegisterContext = contextx.New[SchemaRegister](contextx.WithDefaultsFunc(func() SchemaRegister {
	return &defaultSchemaRegister{}
}))

Functions

func FieldShouldPick

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

func PatchSchemaValidation

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

func PatchSchemaValidationByValidator

func PatchSchemaValidationByValidator(s jsonschema.Schema, v validator.Validator) jsonschema.Schema

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)

func SetTitleOrDescription

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

Types

type FieldExclude

type FieldExclude func(fields ...string)

func (FieldExclude) RuntimeDoc

func (FieldExclude) RuntimeDoc(names ...string) ([]string, bool)

type FieldFilter

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

func (FieldFilter) RuntimeDoc

func (v FieldFilter) RuntimeDoc(names ...string) ([]string, bool)

type Opt

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

func (Opt) RuntimeDoc

func (v Opt) RuntimeDoc(names ...string) ([]string, bool)

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 RuntimeDocer

type RuntimeDocer interface {
	RuntimeDoc(names ...string) ([]string, bool)
}

type SchemaRegister

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

type TypeName

type TypeName string

func (TypeName) RefString

func (t TypeName) RefString() string

func (TypeName) RuntimeDoc

func (TypeName) RuntimeDoc(names ...string) ([]string, bool)

Jump to

Keyboard shortcuts

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