tool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

tool/crypt.go

Index

Constants

This section is empty.

Variables

View Source
var HTTPClient = &http.Client{
	Timeout: 60 * time.Second,
	Transport: &http.Transport{
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 10,
		IdleConnTimeout:     90 * time.Second,
	},
}

Functions

func AES128Decrypt

func AES128Decrypt(crypted, key, iv []byte) ([]byte, error)

func AES128Encrypt

func AES128Encrypt(origData, key, iv []byte) ([]byte, error)

func CurrentDir

func CurrentDir() (string, error)

func DrawProgressBar

func DrawProgressBar(prefix string, proportion float32, width int, suffix ...string)

func Get

func Get(url string) (io.ReadCloser, error)

func GetContext added in v0.0.3

func GetContext(ctx context.Context, url string) (io.ReadCloser, error)

func ResolveURL

func ResolveURL(base *url.URL, ref string) string

ResolveURL safely resolves a relative URL against a base URL. Returns the absolute URL string if ref is absolute. Otherwise, resolves ref relative to base. If ref cannot be parsed as a URL (even relative), it returns base + ref (with proper path handling).

Types

This section is empty.

Jump to

Keyboard shortcuts

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