jsonflags

package
v0.0.0-...-8e79357 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

copy from https://github.com/go-json-experiment/json/blob/master/fields.go

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

Index

Constants

This section is empty.

Variables

View Source
var Structs = &cache{}

Functions

func Implements

func Implements(t reflect.Type, ifaceType reflect.Type) bool

func UnmarshalFromString

func UnmarshalFromString(typ reflect.Type) bool

func Unwrap

func Unwrap(v any) any

func ValueWithStructField

func ValueWithStructField(v any, sf *StructField) any

Types

type Casing

type Casing int
const (
	NoCase     Casing = 1
	StrictCase Casing = 2
)

func (*Casing) RuntimeDoc

func (*Casing) RuntimeDoc(names ...string) ([]string, bool)

type FieldOptions

type FieldOptions struct {
	Name       string
	QuotedName string
	HasName    bool
	Casing     Casing
	Inline     bool
	Unknown    bool
	Omitzero   bool
	Omitempty  bool
	String     bool
	Format     string

	StringItem bool
}

func ParseFieldOptions

func ParseFieldOptions(sf reflect.StructField) (FieldOptions, bool, error)

func (*FieldOptions) RuntimeDoc

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

type StructField

type StructField struct {
	FieldOptions

	FieldName string
	Tag       reflect.StructTag
	Type      reflect.Type
	// contains filtered or unexported fields
}

func (*StructField) GetOrNewAt

func (f *StructField) GetOrNewAt(v reflect.Value) reflect.Value

func (*StructField) RuntimeDoc

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

type StructFields

type StructFields struct {
	// contains filtered or unexported fields
}

func (*StructFields) InlinedFallback

func (s *StructFields) InlinedFallback() (*StructField, bool)

func (*StructFields) Len

func (s *StructFields) Len() int

func (*StructFields) LocatedStructField

func (s *StructFields) LocatedStructField(location string) iter.Seq[*StructField]

func (*StructFields) Lookup

func (s *StructFields) Lookup(name string) (*StructField, bool)

func (*StructFields) LookupLocated

func (s *StructFields) LookupLocated(location string, name string) (*StructField, bool)

func (*StructFields) StructField

func (s *StructFields) StructField() iter.Seq[*StructField]

type Wrapper

type Wrapper interface {
	Unwrap() any
	StructField() *StructField
}

Jump to

Keyboard shortcuts

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