util

package
v0.0.0-...-b7020ef Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloudClown string
View Source
var UserAgent string = "Mozilla/5.0 (Windows NT 10.0; rv:122.0) Gecko/20100101 Firefox/122.0"

Functions

func DetermineEncodingFromReader

func DetermineEncodingFromReader(r io.Reader) (encoding.Encoding, string, bool, error)

DetermineEncodingFromReader 偵測 reader 的編碼

func FormatText

func FormatText(text string) string

FormatText 格式化內文

func HTTPGetwithContext

func HTTPGetwithContext(ctx context.Context, URL string) (*http.Response, error)

HTTPGetwithContext 將 http.Get 加入 context

func MergeTitle

func MergeTitle(text, chapterTitle string) string

MergeTitle 合併標題

func ToAbsoluteURL

func ToAbsoluteURL(baseURI, uri string) (string, error)

ToAbsoluteURL 將 url 轉為絕對路徑

func ToUTF8Encoding

func ToUTF8Encoding(r io.Reader) (io.Reader, string, bool, error)

ToUTF8Encoding 將 reader 轉換為 UTF8

func URLHTMLToUTF8Encoding

func URLHTMLToUTF8Encoding(URL string) (io.Reader, string, bool, error)

URLHTMLToUTF8Encoding 將網頁編碼為 UTF8 並回傳 reader

Types

This section is empty.

Jump to

Keyboard shortcuts

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