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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址