hcl

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 2 Imported by: 8

Documentation

Overview

Package hcl implements a koanf.Parser that parses Hashicorp HCL bytes as conf maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HCL

type HCL struct {
	// contains filtered or unexported fields
}

HCL implements a Hashicorp HCL parser.

func Parser

func Parser(flattenSlices bool) *HCL

Parser returns an HCL Parser. flattenSlices flattens HCL structures where maps turn into lists of maps. Read more here: https://github.com/hashicorp/hcl/issues/162 It's recommended to turn this setting on.

func (*HCL) Marshal

func (p *HCL) Marshal(o map[string]interface{}) ([]byte, error)

Marshal marshals the given config map to HCL bytes.

func (*HCL) Unmarshal

func (p *HCL) Unmarshal(b []byte) (map[string]interface{}, error)

Unmarshal parses the given HCL bytes.

Jump to

Keyboard shortcuts

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