hcl: Fix the simple example in the README
This commit is contained in:
parent
9603bea74b
commit
b41530cb36
16
README.md
16
README.md
@ -33,11 +33,25 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/hashicorp/hcl/v2/hclsimple"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
LogLevel string `hcl:"log_level"`
|
||||
IOMode string `hcl:"io_mode"`
|
||||
Service ServiceConfig `hcl:"service,block"`
|
||||
}
|
||||
|
||||
type ServiceConfig struct {
|
||||
Protocol string `hcl:"protocol,label"`
|
||||
Type string `hcl:"type,label"`
|
||||
ListenAddr string `hcl:"listen_addr"`
|
||||
Processes []ProcessConfig `hcl:"process,block"`
|
||||
}
|
||||
|
||||
type ProcessConfig struct {
|
||||
Type string `hcl:"type,label"`
|
||||
Command []string `hcl:"command"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user