forked from hashicorp/hcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
34 lines (34 loc) · 1.15 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Package hcl contains the main modelling types and general utility functions
// for HCL.
//
// For a simple entry point into HCL, see the package in the subdirectory
// "hclsimple", which has an opinionated function Decode that can decode HCL
// configurations in either native HCL syntax or JSON syntax into a Go struct
// type:
//
// package main
//
// import (
// "log"
// "github.com/hashicorp/hcl/v2/hclsimple"
// )
//
// type Config struct {
// LogLevel string `hcl:"log_level"`
// }
//
// func main() {
// var config Config
// err := hclsimple.DecodeFile("config.hcl", nil, &config)
// if err != nil {
// log.Fatalf("Failed to load configuration: %s", err)
// }
// log.Printf("Configuration is %#v", config)
// }
//
// If your application needs more control over the evaluation of the
// configuration, you can use the functions in the subdirectories hclparse,
// gohcl, hcldec, etc. Splitting the handling of configuration into multiple
// phases allows for advanced patterns such as allowing expressions in one
// part of the configuration to refer to data defined in another part.
package hcl