codec

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 4 Imported by: 0

README

go-codec

utility functions to help with parsing different encoding formats and datatypes

Documentation

Overview

Package codec helps with encoding/decoding data => acknowledgement:

  • github.com/hashicorp/vault/sdk/helper/jsonutil
  • github.com/hashicorp/vault/sdk/helper/hclutil

=> [TODO] :

  • Update Readme
  • hcl.go tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(data []byte, out interface{}) error

DecodeJSON -

func DecodeJSONFromReader

func DecodeJSONFromReader(r io.Reader, out interface{}) error

DecodeJSONFromReader - Decodes/Unmarshals the given io.Reader pointing to a JSON, into a desired object

func EncodeJSON

func EncodeJSON(in interface{}) ([]byte, error)

EncodeJSON - Encodes/Marshals the given object into JSON

func EncodeJSONToWriter

func EncodeJSONToWriter(w io.Writer, in interface{}, prefix, indent string) error

EncodeJSONToWriter - encodes/marshals a given interface to an io writer. it can also indent the output

func EncodeJSONWithIndentation

func EncodeJSONWithIndentation(in interface{}) ([]byte, error)

EncodeJSONWithIndentation - Encodes/Marshals the given object into JSON DEPRACATED

func EncodeJSONWithoutErr

func EncodeJSONWithoutErr(in interface{}) []byte

EncodeJSONWithoutErr - Encodes/Marshals the given object into JSON but does not return an err

Types

This section is empty.

Jump to

Keyboard shortcuts

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