taint

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

README

Taint Go objects

Go PkgGoDev NewReleases

Installation

Run go get resenje.org/taint from command line.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTagKey is a key for Go struct tags that this module will check.
	DefaultTagKey = "taint"
)

Functions

func Inject

func Inject(src, dst interface{}) error

Inject will inject fields of source object into destination object.

func InjectWithTag

func InjectWithTag(src, dst interface{}, tagKey string) error

InjectWithTag will inject fields of source object into destination object using a custom Go struct tag.

Types

type FieldRequiredError

type FieldRequiredError struct {
	FieldName string
}

FieldRequiredError defines an errors type for missing required field.

func (*FieldRequiredError) Error

func (e *FieldRequiredError) Error() string

type InvalidInjectError

type InvalidInjectError struct {
	Type reflect.Type
}

InvalidInjectError defines an error type for invalid inject type.

func (*InvalidInjectError) Error

func (e *InvalidInjectError) Error() string

type InvalidTypeError

type InvalidTypeError struct {
	TypeSrc reflect.Type
	TypeDst reflect.Type
}

InvalidTypeError defines an error type for errors where source and destination types are not the same.

func (*InvalidTypeError) Error

func (e *InvalidTypeError) Error() string

Jump to

Keyboard shortcuts

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