Documentation ¶
Index ¶
- func CheckDirectory(ctx context.Context, dir string) (bool, error)
- func CheckDirectoryOrCreate(ctx context.Context, dir string) (bool, error)
- func CheckEmptyDirectoryOrCreate(ctx context.Context, dir string) (bool, error)
- func CopyFile(_ context.Context, from string, to string) error
- func DefaultTo(s string, defaultValue string) string
- func DirectoryExists(p string) bool
- func FileExists(file string) bool
- func ForwardLogs(r io.ReadCloser, w io.Writer)
- func Must[T any](t T, err error) T
- func Pointer[T any](t T) *T
- func PointerEqual[T comparable](t *T, target T) bool
- func ProtoType(m proto.Message) string
- func RequireExec(bins ...string) ([]string, bool)
- func ToCamelCase(s string) string
- func ToDNSCase(s string) string
- func ToKebabCase(str string) string
- func ToLowerCase(s string) string
- func ToSnakeCase(s string) string
- func ToTitle(s string) string
- func TypeOf[T any]() string
- func WithIgnore(ctx context.Context, ignore Ignore) context.Context
- func WithOverride(ctx context.Context, override Override) context.Context
- type Case
- type ContextIgnoreKey
- type ContextOverrideKey
- type CopyInstruction
- type Dir
- type DirReader
- type Event
- type FSReader
- func (fr *FSReader) Absolute(dir Dir) string
- func (fr *FSReader) AbsoluteDir(dir Dir) string
- func (fr *FSReader) AbsoluteFile(f File) string
- func (fr *FSReader) At(root string) *FSReader
- func (fr *FSReader) Copy(s string, file string) error
- func (fr *FSReader) ReadDir(dir Dir) ([]os.DirEntry, error)
- func (fr *FSReader) ReadFile(f File) ([]byte, error)
- type File
- type FileSystem
- type Ignore
- type IgnoreNoneHandler
- type IgnorePatterns
- type Override
- type Replacement
- type S
- type SilentOverrideHandler
- type SkipOverrideHandler
- type WrappedCmd
- type WrappedCmdOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDirectory ¶
CheckDirectory is a safer version of DirectoryExists return bool, err err only for unexpected behavior
func CheckDirectoryOrCreate ¶
CheckDirectoryOrCreate checks if a directory exists or create it if it doesn't bool: created err: only for unexpected behavior
func CheckEmptyDirectoryOrCreate ¶
CheckEmptyDirectoryOrCreate checks if a directory exists and is empty bool if created err only for unexpected behavior or if exists
func DirectoryExists ¶ added in v0.0.13
func FileExists ¶
func ForwardLogs ¶
func ForwardLogs(r io.ReadCloser, w io.Writer)
func PointerEqual ¶ added in v0.0.51
func PointerEqual[T comparable](t *T, target T) bool
PointerEqual returns true if pointer is not nil and value is equal
func RequireExec ¶ added in v0.0.15
func ToCamelCase ¶ added in v0.0.51
ToCamelCase converts a string to camelCase
func ToKebabCase ¶ added in v0.0.51
ToKebabCase converts a string to kebab-case
func ToLowerCase ¶ added in v0.0.51
func ToSnakeCase ¶ added in v0.0.51
ToSnakeCase converts a string to snake_case
func WithIgnore ¶ added in v0.0.51
Types ¶
type Case ¶ added in v0.0.51
type ContextIgnoreKey ¶ added in v0.0.51
type ContextIgnoreKey string
const (
IgnoreKey ContextIgnoreKey = "ignore"
)
type ContextOverrideKey ¶ added in v0.0.51
type ContextOverrideKey string
const (
OverrideKey ContextOverrideKey = "override"
)
type CopyInstruction ¶
type DirReader ¶ added in v0.0.13
type DirReader struct {
// contains filtered or unexported fields
}
func NewDirReader ¶ added in v0.0.13
func NewDirReader() *DirReader
func (*DirReader) AbsoluteDir ¶ added in v0.0.13
func (*DirReader) AbsoluteFile ¶ added in v0.0.13
type FSReader ¶ added in v0.0.13
func (*FSReader) AbsoluteDir ¶ added in v0.0.13
func (*FSReader) AbsoluteFile ¶ added in v0.0.13
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) RelativePath ¶
type FileSystem ¶ added in v0.0.13
type Ignore ¶ added in v0.0.51
func IgnoreNone ¶ added in v0.0.51
func IgnoreNone() Ignore
type IgnoreNoneHandler ¶ added in v0.0.51
type IgnoreNoneHandler struct{}
func (IgnoreNoneHandler) Skip ¶ added in v0.0.51
func (i IgnoreNoneHandler) Skip(string) bool
type IgnorePatterns ¶ added in v0.0.51
type IgnorePatterns struct {
// contains filtered or unexported fields
}
func NewIgnore ¶ added in v0.0.51
func NewIgnore(patterns ...string) IgnorePatterns
func (IgnorePatterns) Skip ¶ added in v0.0.51
func (ign IgnorePatterns) Skip(file string) bool
type Override ¶ added in v0.0.13
func GetOverride ¶ added in v0.0.51
func SilentOverride ¶ added in v0.0.51
func SilentOverride() Override
type Replacement ¶
type SilentOverrideHandler ¶ added in v0.0.51
type SilentOverrideHandler struct{}
func (SilentOverrideHandler) Replace ¶ added in v0.0.51
func (s SilentOverrideHandler) Replace(string) bool
type SkipOverrideHandler ¶ added in v0.0.51
type SkipOverrideHandler struct{}
func (SkipOverrideHandler) Replace ¶ added in v0.0.51
func (s SkipOverrideHandler) Replace(string) bool
type WrappedCmd ¶ added in v0.0.67
type WrappedCmd struct {
// contains filtered or unexported fields
}
func NewWrappedCmd ¶ added in v0.0.67
func (*WrappedCmd) Start ¶ added in v0.0.67
func (run *WrappedCmd) Start() (*WrappedCmdOutput, error)
type WrappedCmdOutput ¶ added in v0.0.67
Click to show internal directories.
Click to hide internal directories.