utils

package
v0.0.0-...-a56eff2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkedCopy

func ChunkedCopy(dst io.Writer, src io.Reader) error

func Contains

func Contains(s []string, str string) bool

contains checks if a string is present in a slice

func Find

func Find(source []string, match string) []string

finds a string present in a slice

func GetDefaultTemplatePath

func GetDefaultTemplatePath() (string, error)

Types

type OsUtil

type OsUtil struct{}

func (*OsUtil) Getwd

func (*OsUtil) Getwd() (dir string, err error)

func (*OsUtil) Hostname

func (*OsUtil) Hostname() (name string, err error)

func (*OsUtil) WriteString

func (*OsUtil) WriteString(w io.Writer, s string) (n int, err error)

type OsUtilI

type OsUtilI interface {
	Hostname() (name string, err error)
	WriteString(w io.Writer, s string) (n int, err error)
	Getwd() (dir string, err error)
}

type UtilsHelper

type UtilsHelper struct{}

func (*UtilsHelper) Dir

func (u *UtilsHelper) Dir() (string, error)

func (*UtilsHelper) IsModuleRoot

func (u *UtilsHelper) IsModuleRoot() (string, error)

Check if we're currently in the module root dir. Return the sanitized file path if we are in a module root, otherwise an empty string.

type UtilsHelperI

type UtilsHelperI interface {
	IsModuleRoot() (string, error)
	Dir() (string, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL