utils

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNestedExpressionsNotSupported = fmt.Errorf("nested expressions are not supported, use the `+` operator instead")
	ErrFailedToCompileExpression     = fmt.Errorf("failed to compile expression")
	ErrFailedToRunExpression         = fmt.Errorf("failed to run expression")
	ErrorUnfinishedExpression        = fmt.Errorf("unfinished expression found")
)
View Source
var CopyFile = copyFile

CopyFile is a utility function to copy a file from the source path to the destination path.

View Source
var CreateDirsIfNotExist = createDirsIfNotExist

CreateDirsIfNotExist is a utility function to create directories if they do not already exist.

View Source
var EvaluateExpression = evaluateExpression
View Source
var ParseTemplate = parseTemplate

ParseTemplate is a utility function that parses a given template string with the provided data.

Functions

func DeepCopy

func DeepCopy[T any](input T) (T, error)

func OpenFile

func OpenFile(path string) (*os.File, error)

OpenFile opens a file for appending. If the file does not exist, it creates it with write permissions. It returns a pointer to the opened file and an error if any occurs during the file opening process.

Types

type DefaultClient

type DefaultClient struct {
	Client *http.Client
}

func (*DefaultClient) Do

func (c *DefaultClient) Do(req *http.Request) (*http.Response, error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

func NewHTTPClient

func NewHTTPClient() HTTPClient

Jump to

Keyboard shortcuts

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