Documentation
¶
Overview ¶
Package util contains utility functions used by various commands.
Index ¶
- Constants
- func BinaryFileSystem(root string) *binaryFileSystem
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func Download(url, target string) error
- func LoadTemplates(path string, list ...string) (multitemplate.Render, error)
- func Unzip(archive, target string) error
- type PrefixWriter
- type ServerState
Constants ¶
const ( LEVEL_0 = iota LEVEL_1 LEVEL_2 LEVEL_3 )
Variables ¶
This section is empty.
Functions ¶
func BinaryFileSystem ¶
func BinaryFileSystem(root string) *binaryFileSystem
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func Download ¶
Download downloads resource given by url and writes it to target. target should not exist already, as it is created by the function.
func LoadTemplates ¶
func LoadTemplates(path string, list ...string) (multitemplate.Render, error)
Types ¶
type PrefixWriter ¶
type PrefixWriter interface { // Write writes text with the specified indentation level. Write(level int, format string, a ...interface{}) // WriteLine writes an entire line with no indentation level. WriteLine(a ...interface{}) // Flush forces indendation to be reset. Flush() }
PrefixWriter can write text at various indentation levels.
func NewPrefixWriter ¶
func NewPrefixWriter(out io.Writer) PrefixWriter
NewPrefixWriter creates a new PrefixWriter.
type ServerState ¶
ServerState is the state of Hasura stored on the server.
func GetServerState ¶
func GetServerState(endpoint, adminSecret string, serverVersion *semver.Version, log *logrus.Logger) *ServerState
GetServerState queries a server for the state.