structfields

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe(field reflect.StructField) string

Describe returns a description for a field It looks for a 'description' tag. If it is not found it returns a generic description.

func FieldNameJSON

func FieldNameJSON(field reflect.StructField) (string, error)

FieldNameJSON resolves the name a field will have in JSON

func Flatten

func Flatten(typ reflect.Type) []reflect.StructField

Flatten resolves the exported fields of a struct

Fields in embedded structs are recursively resolved and promoted to 'top-level'

func IsRequired

func IsRequired(field reflect.StructField) bool

IsRequired checks whether a field is required or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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