mirror of
https://github.com/alibaba/higress.git
synced 2026-04-22 04:27:26 +08:00
feat:add installation for higress standalone in local docker environment (#606)
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user