util

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YMDParseLayout   = "2006年1月2日"
	YMD02ParseLayout = "2006年01月02日"
	ShortDateLayout  = "200601"
	Day              = 24 * time.Hour // 24h0m0s
	Week             = 7 * Day
)

Variables

View Source
var Asia_Shanghai, _ = time.LoadLocation("Asia/Shanghai")

Functions

func CheckZhCn

func CheckZhCn(s string) bool

func ConvertZhCnNumbToa

func ConvertZhCnNumbToa(cnn string) string

func FileSeparatorConv

func FileSeparatorConv(path string) string

func GetExecutePath

func GetExecutePath() (string, error)

func IsJsonFile

func IsJsonFile(fn string) bool

func IsNumber

func IsNumber(s string) bool

func IsRegexp

func IsRegexp(str string) bool

func IsSubtitleFile

func IsSubtitleFile(fn string) bool

func IsVideofile

func IsVideofile(fn string) bool

func ParseShort02Time

func ParseShort02Time(strd string) (string, error)

func ParseShortTime

func ParseShortTime(strd string) (string, error)

func ParseTime

func ParseTime(strd, layout string) (time.Time, error)

func ParseTimeStr

func ParseTimeStr(t time.Time) string

func TrimExtensionAndGetEpi

func TrimExtensionAndGetEpi(fn string) string

TrimExtensionAndGetEpi trim the rename file ext and name eg: example xxxS01E02 => S01E02

Types

type Timer

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

func (*Timer) End

func (tr *Timer) End() time.Duration

func (*Timer) Start

func (tr *Timer) Start()

type Tuple

type Tuple[F, S any] struct {
	// contains filtered or unexported fields
}

func NewTuple

func NewTuple[F, S any](a1 F, a2 S) Tuple[F, S]

func (*Tuple[F, S]) Get0

func (t *Tuple[F, S]) Get0() F

func (*Tuple[F, S]) Get1

func (t *Tuple[F, S]) Get1() S

Jump to

Keyboard shortcuts

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