argstruct

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Values added in v0.20.0

func Values(value any, options ...Option) litsql.ArgValues

Values returns a litsql.ArgValues from struct fields. If value is not a struct, returns nil.

Types

type Option

type Option func(*argValuesOptions)

func WithDerefPointer

func WithDerefPointer(deref bool) Option

WithDerefPointer dereferences pointers in struct field values.

func WithMapperFunc

func WithMapperFunc(mapperFunc func(string) string) Option

WithMapperFunc sets the field name mapper function.

func WithTagName

func WithTagName(tagName string) Option

WithTagName sets the struct tag name to use. Default is "json".

type ValuesFunc added in v0.21.0

type ValuesFunc func(value any) litsql.ArgValues

func ValuesProvider added in v0.21.0

func ValuesProvider(options ...Option) ValuesFunc

ValuesProvider returns a function that provides Values with fixed options.

Jump to

Keyboard shortcuts

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