common

package module
v0.0.0-...-5adb8dc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const (
	MaxInt64 int64 = 100000000
)

Variables

This section is empty.

Functions

func CheckIfFileExists

func CheckIfFileExists(path string) (bool, error)

func DelCookie

func DelCookie(writer http.ResponseWriter, cookie_name string)

func DownloadFile

func DownloadFile(rac *RestApiClient, url string, save_path string) error

func FileMd5Hash

func FileMd5Hash(path string) (hash string, err error)

func FormatByteSize

func FormatByteSize(n int64) (string, string)

func GetBingHomeWallpaper

func GetBingHomeWallpaper(rac *RestApiClient) (string, error)

func Md5Check

func Md5Check(hashedStr string, plain string) bool

func Md5Hash

func Md5Hash(plain string) string

func ReadAllFiles

func ReadAllFiles(path string, items *[]*FileInfoWrapper) error

func ReadAsMap

func ReadAsMap(r io.Reader) (map[string]interface{}, error)

func StringLimitLen

func StringLimitLen(str string, maxLen int) string

Types

type FileInfoWrapper

type FileInfoWrapper struct {
	Fi   os.FileInfo
	Path string
}

type RestApiClient

type RestApiClient struct {
	// contains filtered or unexported fields
}

func NewRestApiClient

func NewRestApiClient(skip_tls_verify bool) *RestApiClient

func (*RestApiClient) Do

func (rac *RestApiClient) Do(rar *RestApiRequest) (*http.Response, error)

type RestApiRequest

type RestApiRequest struct {
	Request *http.Request
}

func NewRestApiRequest

func NewRestApiRequest(method string, urlPath string, body []byte) *RestApiRequest

func (*RestApiRequest) SetAuthHeader

func (rar *RestApiRequest) SetAuthHeader(token *oauth2.Token) *RestApiRequest

Jump to

Keyboard shortcuts

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