Skip to content

Commit b41530c

Browse files
Mark Fosterapparentlymart
authored andcommitted
hcl: Fix the simple example in the README
1 parent 9603bea commit b41530c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,25 @@ package main
3333

3434
import (
3535
"log"
36+
3637
"github.com/hashicorp/hcl/v2/hclsimple"
3738
)
3839

3940
type Config struct {
40-
LogLevel string `hcl:"log_level"`
41+
IOMode string `hcl:"io_mode"`
42+
Service ServiceConfig `hcl:"service,block"`
43+
}
44+
45+
type ServiceConfig struct {
46+
Protocol string `hcl:"protocol,label"`
47+
Type string `hcl:"type,label"`
48+
ListenAddr string `hcl:"listen_addr"`
49+
Processes []ProcessConfig `hcl:"process,block"`
50+
}
51+
52+
type ProcessConfig struct {
53+
Type string `hcl:"type,label"`
54+
Command []string `hcl:"command"`
4155
}
4256

4357
func main() {

0 commit comments

Comments
 (0)