emap

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package emap provides utility functions for maps

MergeMarshal/MergeUnmarshal are used to serialize/deserialize JSON object map which may have different required/known fields and possibly any number of extra parameters

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidJSON = errors.New("invalid JSON")

Functions

func MergeMarshal

func MergeMarshal(e interface{}, p map[string]interface{}) ([]byte, error)

func MergeUnmarshal

func MergeUnmarshal(data []byte, c Constructor, ext *map[string]interface{}) error

Types

type Constructor

type Constructor interface {
	Construct(map[string]interface{}) error
}

type Hmap

type Hmap map[string]interface{}

Hmap is used to parse through the JSON object from which to construct the actual JWK's. The only reason this exists is to allow the parser to decide which type of key to create based upon which keys are present in the parsed JSON object

func (Hmap) Get

func (h Hmap) Get(name string, t reflect.Type, consume ...bool) (interface{}, error)

func (Hmap) GetBuffer

func (h Hmap) GetBuffer(name string, consume ...bool) (buffer.Buffer, error)

func (Hmap) GetByteSlice

func (h Hmap) GetByteSlice(name string, consume ...bool) ([]byte, error)

func (Hmap) GetInt64

func (h Hmap) GetInt64(name string, consume ...bool) (int64, error)

func (Hmap) GetString

func (h Hmap) GetString(name string, consume ...bool) (string, error)

func (Hmap) GetStringSlice

func (h Hmap) GetStringSlice(name string, consume ...bool) ([]string, error)

Jump to

Keyboard shortcuts

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