feat:add installation for higress standalone in local docker environment (#606)

Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
Jun
2023-11-02 14:02:23 +08:00
committed by GitHub
parent de1dd3bfbc
commit 9136908354
42 changed files with 21149 additions and 422 deletions

View File

@@ -15,8 +15,10 @@
package util
import (
"bufio"
"fmt"
"net/url"
"os"
"strconv"
"strings"
)
@@ -76,3 +78,18 @@ func ParseValue(valueStr string) any {
}
return value
}
// WriteFileString write string content to file
func WriteFileString(fileName string, content string, perm os.FileMode) error {
file, err := os.OpenFile(fileName, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, perm)
if err != nil {
return err
}
defer file.Close()
writer := bufio.NewWriter(file)
if _, err := writer.WriteString(content); err != nil {
return err
}
writer.Flush()
return nil
}