Documentation
¶
Index ¶
- Constants
- func Center(s string, width int, fill string) string
- func FindStringIndex(slice []string, target string, caseInsensitive bool, trim bool) int
- func GetEndpoint(addr string) string
- func GetFileContent(filepath string) ([]byte, error)
- func GetHTTPClient() *http.Client
- func IsDir(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func IsSRT(content []byte) bool
- func IsURLEncoded(u string) bool
- func MD5Hash(raw string) string
- func PathExists(path string) (bool, error)
- func RemoveColorCodes(line string) string
- func ResolveEmbyAPIKVPairs(urlString *string) (string, error)
- func SRT2ASS(srtText []byte, style []string) []byte
- func SplitHostPort(hostPort string) (host string, port string)
- type JsonChain
- func (json *JsonChain) Delete(path string) *JsonChain
- func (json *JsonChain) Get(path string) gjson.Result
- func (json *JsonChain) Result() ([]byte, error)
- func (json *JsonChain) ResultString() (string, error)
- func (json *JsonChain) ResultToWriter(writer io.Writer) error
- func (json *JsonChain) Set(path string, value any) *JsonChain
- type Set
- type SetInterface
Constants ¶
View Source
const ( ASSHeader1 = `` /* 137-byte string literal not displayed */ ASSHeader2 = `[Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text` )
Variables ¶
This section is empty.
Functions ¶
func FindStringIndex ¶
在 []string 中找到某个字符串的索引 如果未找到,返回 -1
slice: 目标切片 target: 目标字符串 caseInsensitive: 是否忽略大小写 trim: 是否去除空白字符
func GetEndpoint ¶
获取服务器入口
包含协议、主机域名(IP)、端口号(标准端口号可省略) Example1: https://example1.com:8920 Example2: http://example2.com:5224
func RemoveColorCodes ¶
RemoveColorCodes 移除字符串中的 ANSI 颜色代码
func SplitHostPort ¶
分离主机域名(IP)和端口号
示例: "example.com:8096" => "example.com", "8096" "[240e:da8:a801:5a47::316]:8096" => "240e:da8:a801:5a47::316" "8096" "192.168.1.1:8096" => "192.168.1.1" "8096"
Types ¶
type JsonChain ¶
type JsonChain struct {
// contains filtered or unexported fields
}
func NewJsonChainFromReader ¶
func (*JsonChain) ResultString ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
集合对象
func (*Set[T]) Equal ¶
func (s *Set[T]) Equal(other SetInterface[T]) bool
type SetInterface ¶
type SetInterface[T comparable] interface { Add(value T) // 添加元素 Adds(values ...T) // 添加多个元素 Remove(value T) // 删除元素 Contains(value T) bool // 判断元素是否存在 Len() int // 计算集合元素数量 Values() []T // 获取集合所有元素并排序 Equal(other SetInterface[T]) bool // 判断两个集合是否相等 }
func NewSet ¶
func NewSet[T comparable]() SetInterface[T]
Click to show internal directories.
Click to hide internal directories.