goutil

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 20 Imported by: 3

README

Go Utils

Bitsnap shared utility code.

License

Bitsnap is a proprietary product developed by Yuriy Yarosh.

go-util package licensed under the terms of MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(camel string) string

func Capitalize

func Capitalize(s string) string

func GenerateInto

func GenerateInto(
	dir string,
	headerFunc func(string) string,
	templates map[string][]func() string,
)

func HasUpperCase

func HasUpperCase(s string) bool

func HttpGetDocument

func HttpGetDocument(url string) *goquery.Document

func IsDir

func IsDir(dir string, filename string) bool

func IsFile

func IsFile(dir string, filename string) bool

func Logger

func Logger() *otelzap.SugaredLogger

func MustParseTemplate

func MustParseTemplate(fs embed.FS, filename string) *template.Template

func MustReadFile

func MustReadFile(fs embed.FS, filename string) string

func RunCommandContainsCtx

func RunCommandContainsCtx(ctx context.Context, contains string, command string, args ...string) bool

func RunCommandCtx

func RunCommandCtx(ctx context.Context, command string, args ...string) (string, error)

func RunCommandCtxWithOutput

func RunCommandCtxWithOutput(ctx context.Context, command string, args ...string) (string, error)

func SetGlobalLogger

func SetGlobalLogger() func()

func SnakeToCamel

func SnakeToCamel(snake string, capitalize bool) string

func WriteTmpFile

func WriteTmpFile(prefix, extension, content string) (string, error)

Types

type Errors

type Errors []error

func (Errors) Error

func (e Errors) Error() error

func (Errors) String

func (e Errors) String() string

Jump to

Keyboard shortcuts

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