ff

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package ff contains a struct flattening utility.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlattenedField

type FlattenedField struct {
	Path  []int
	Field reflect.StructField
}

FlattenedField is a struct that contains the path indices and the field.

func (*FlattenedField) Get

func (f *FlattenedField) Get(target reflect.Value) reflect.Value

Get the value of embedding struct field.

func (*FlattenedField) Set

func (f *FlattenedField) Set(target reflect.Value, val reflect.Value)

Set the value of embedding struct field.

type FlattenedStruct

type FlattenedStruct struct {
	Type   reflect.Type
	Fields []*FlattenedField
}

FlattenedStruct is a struct that contains the flattened fields.

func Parse

func Parse(t reflect.Type) *FlattenedStruct

Parse is to parse the embedding struct and return the flattened struct.

Jump to

Keyboard shortcuts

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