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



    This section is empty.


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


    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


    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)

      Source Files