encoding

package
v0.0.0-...-b349366 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 9 Imported by: 13

Documentation

Overview

Package encoding is responsible for encoding and decoding of structs. `squash` option assumes that field names are unique in structs, otherwise results are unpredictable

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromStringStringMap

func FromStringStringMap(tagName string, base interface{}, input map[string]string) (output interface{}, err error)

FromStringStringMap decodes input into output with the same type as base. Only fields tagged by tagName get decoded. Optional argument properties specifies fields to decode.

func ToStringInterfaceMap

func ToStringInterfaceMap(tagName string, input interface{}, properties ...string) (map[string]interface{}, error)

ToStringInterfaceMap encodes fields tagged with tagName in input into map[string]interface{}. Optional argument properties specifies fields to encode.

func ToStringStringMap

func ToStringStringMap(tagName string, input interface{}, properties ...string) (map[string]string, error)

ToStringStringMap encodes fields tagged with tagName in input into map[string]string. Optional argument properties specifies fields to encode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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