Documentation ¶
Index ¶
- func AssertOptionsExist(params Params, opts ...string) []string
- func CopyIf[T comparable](s []T, condition func(t T) bool) []T
- func CreateArchive(files []string, buf io.Writer) error
- func Get[T any](params Params, key string) *T
- func GetOpt[T any](opts []Option, key string) *T
- func GitCommit() string
- func IsDirectory(path string) (bool, error)
- func MakeRequest(url string, httpMethod string, body []byte, headers map[string]string) (*http.Response, []byte, error)
- func PathExists(path string) (bool, error)
- func RemoveDuplicates[T cmp.Ordered](s []T) []T
- func RemoveIndex[T comparable](s []T, index int) []T
- type Option
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertOptionsExist ¶
Assert that the options exists within the params map
func CopyIf ¶
func CopyIf[T comparable](s []T, condition func(t T) bool) []T
General function to copy elements from slice if condition is true.
func GitCommit ¶
func GitCommit() string
Returns the git commit string by executing command. NOTE: This currently requires git to be installed. TODO: Change how this is done to not require executing a command.
func IsDirectory ¶
Wrapper function to simplify checking if a path is a directory.
func MakeRequest ¶
func MakeRequest(url string, httpMethod string, body []byte, headers map[string]string) (*http.Response, []byte, error)
Wrapper function to confine making a HTTP request into a single function instead of multiple.
func PathExists ¶
Wrapper function to simplify checking if a path exists.
func RemoveDuplicates ¶
func RemoveIndex ¶
func RemoveIndex[T comparable](s []T, index int) []T
General function to remove element by a given index. NOTE: would it be better to use slices.DeleteFunc instead?
Types ¶
Click to show internal directories.
Click to hide internal directories.