add http2 transport

This commit is contained in:
ginuerzh
2021-12-14 21:52:11 +08:00
parent 15f9aa091b
commit c651743ea2
33 changed files with 1647 additions and 266 deletions

View File

@ -2,7 +2,6 @@ package config
import (
"io"
"os"
"time"
"github.com/spf13/viper"
@ -138,14 +137,8 @@ func (c *Config) ReadFile(file string) error {
return v.Unmarshal(c)
}
func (c *Config) WriteFile(file string) error {
f, err := os.Create(file)
if err != nil {
return err
}
defer f.Close()
enc := yaml.NewEncoder(f)
func (c *Config) Write(w io.Writer) error {
enc := yaml.NewEncoder(w)
defer enc.Close()
return enc.Encode(c)