lysmeta

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 Imported by: 2

README

lysmeta

Functions that analyze structs.

Documentation

Overview

Package lysmeta contains functions that analyze structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate[T any](validate *validator.Validate, input T) (err error)

Validate uses the validator lib to validate the supplied T returns all errors joined by pipe (|)

Types

type Result added in v0.1.3

type Result struct {
	DbTags         []string          // all combined "db" tags in the struct(s) passed
	JsonTags       []string          // all combined "json" tags in the struct(s) passed, excluding "-"
	JsonTagTypeMap map[string]string // a map of [json tag]type name
}

Result contains struct metadata

func AnalyzeStructs added in v0.1.3

func AnalyzeStructs(reflVals ...reflect.Value) (res Result, err error)

AnalyzeStructs reflects the supplied struct(s) and returns a Result checks for duplicate db and json tags

Jump to

Keyboard shortcuts

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