types

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]interface{}

Map is a map from string to interface

func CreateMapFromReader

func CreateMapFromReader(reader io.Reader) (Map, error)

CreateMapFromReader creates map from a JSON reader

func CreateMapFromStruct

func CreateMapFromStruct(obj interface{}) (Map, error)

CreateMapFromStruct creates map from struct

func (Map) ForceJSON

func (m Map) ForceJSON() string

ForceJSON converts map to JSON string

func (Map) ForceMap

func (m Map) ForceMap(key string) Map

ForceMap returns value of key as a map, ignores error

func (Map) ForceString

func (m Map) ForceString(key string) string

ForceString returns value of key as a string, ignores error

func (Map) GetArrayString

func (m Map) GetArrayString(key string) ([]string, bool)

GetArrayString returns value of key as an array of string

func (Map) GetMap

func (m Map) GetMap(key string) (Map, bool)

GetMap returns value of key as map

func (Map) GetString

func (m Map) GetString(key string) (string, bool)

GetString returns value of a key as string

func (Map) JSON

func (m Map) JSON() ([]byte, error)

JSON converts map to JSON string

func (*Map) Scan

func (m *Map) Scan(val interface{}) error

Scan sqlx JSON scan method

func (Map) Value

func (m Map) Value() (driver.Value, error)

Value sqlx JSON value method

Jump to

Keyboard shortcuts

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