reflect

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package reflect contains an implementation of a parser for a reflected go structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.1.4

type Option = func(o *options)

type Parser added in v0.3.0

type Parser interface {
	goparse.Parser
	//Init initialises the parser with a value of reflected go structure.
	Init(value reflect.Value)
	Reset()
}

Parser is a parser for a reflected go structure.

func NewJSONSchemaParser added in v0.3.0

func NewJSONSchemaParser() Parser

NewJSONSchemaParser returns a new reflect parser that tags objects and arrays, so that the types can be checked by JSONSchema. The following json: `{"a": ["b", "c"]}` is parsed as: `{"object": {"a": {"array": {0: "b", 1: "c"}}}}`. The kind returned from the Token method for "object" and "array" will be parse.TagKind.

func NewParser added in v0.3.0

func NewParser(options ...Option) Parser

NewParser returns a new reflect parser.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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