add schema

This commit is contained in:
Boshi Lian 2022-04-17 10:37:47 +00:00
parent a815f30751
commit f4a64f1768
3 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
version: 1
# yaml-language-server: $schema=https://raw.githubusercontent.com/tg123/sshpiper/master/sshpiperd/upstream/yaml/schema.json
version: "0.1"
pipes:
- username: passthrough
upstream_host: host2

View file

@ -145,7 +145,7 @@ func (p *plugin) CreatePipe(opt upstream.CreatePipeOption) error {
fmt.Fprintln(&buf)
out, err := yaml.Marshal(piperConfig{
Version: 1,
Version: "0.1",
Pipes: []pipeConfig{toPipeConfig(opt)},
})

View file

@ -52,7 +52,7 @@ type pipeConfig struct {
}
type piperConfig struct {
Version int `yaml:"version"`
Version string `yaml:"version"`
Pipes []pipeConfig `yaml:"pipes,flow"`
}