structtag

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package structtag provides struct tag value extraction and cross-validation for Datapages handler parameters.

Index

Constants

This section is empty.

Variables

View Source
var ErrQueryReflectSignalNotInSignals = errors.New(
	"query reflectsignal tag references signal " +
		"not in signals parameter",
)

ErrQueryReflectSignalNotInSignals indicates a reflectsignal tag references a signal not present in the signals parameter.

Functions

func JSONTagExcluded added in v0.2.3

func JSONTagExcluded(tag string) bool

JSONTagExcluded reports whether the struct tag is `json:"-"`, which instructs encoding/json to always omit this field. Note: `json:"-,"` is distinct — it names the field "-" and is NOT treated as excluded.

func JSONTagValue

func JSONTagValue(tag string) string

JSONTagValue extracts the value from a `json:"value"` struct tag, stripping options like ",omitempty".

func PathTagValue

func PathTagValue(tag string) string

PathTagValue extracts the value from a `path:"value"` struct tag.

func QueryTagValue added in v0.2.3

func QueryTagValue(tag string) string

QueryTagValue extracts the value from a `query:"value"` struct tag.

func ReflectSignalTagValue

func ReflectSignalTagValue(tag string) string

ReflectSignalTagValue extracts the value from a `reflectsignal:"value"` struct tag.

func ValidateReflectSignal

func ValidateReflectSignal(
	h *model.Handler, recv, method string,
) error

ValidateReflectSignal checks that every reflectsignal tag on a query field references a json tag value in the signals struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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