utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsShortSHA

func ContainsShortSHA(input string) bool

func CreatePath

func CreatePath(path string) error

create path recursively

func DownloadGithubZip

func DownloadGithubZip(url string, path string) error

func ExtractZip

func ExtractZip(pathZip string, extractPath string) error

func FileExists

func FileExists(relativePath string) bool

func GetDirectories

func GetDirectories(path string) (out []string, err error)

func HTTPRequest

func HTTPRequest(reqModel *RequestModel) (string, int, error)

func ParseURL

func ParseURL(urlStr string) *url.URL

Types

type BasicCredentials

type BasicCredentials struct {
	Username string
	Password string
}

type RequestModel

type RequestModel struct {
	URL            string            // Mandatory: URL to send request to
	Method         string            // Mandatory: http method
	Body           []byte            // Optional: body of request
	Headers        map[string]string // Optional: headers
	Params         map[string]string // Optional: params
	BasicAuth      *BasicCredentials // Optional: basic auth1
	Context        context.Context   // Optional: context
	TimeoutSeconds int               // Optional: timeout in seconds
	Files          []string          // Optional: list of paths to files
}

Jump to

Keyboard shortcuts

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