parsers

package
v0.0.0-...-41ad4b5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YAML                           = "yaml"
	JSON                           = "json"
	BeforeToday DateComparisonType = iota
	AfterToday

	ParseFixedTimeFormat         = "2006-01-02 15:04:05.000"
	YearMonthFormat              = "2006-01"
	YearMonthDayFormat           = "2006-01-02"
	YearMonthDayHourMinuteSecond = "2006-01-02 15:04:05"
)

Variables

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

Functions

func CheckMonthInRange

func CheckMonthInRange(inputMonth string) bool

func CompareMonthToCurrent

func CompareMonthToCurrent(yearMonth string) (int, error)

CompareMonthToCurrent return -1(lt),0(eq),1(gt)

func FilterDates

func FilterDates(dates []string, comparisonType DateComparisonType) ([]string, error)

FilterDates 根据比较类型过滤出符合条件的日期

func GetAllDaysInMonth

func GetAllDaysInMonth(yearMonth string) ([]string, error)

func GetCurrentYearMonthDay

func GetCurrentYearMonthDay() string

func GetRecentDayList

func GetRecentDayList() []string

func GetTimeDifference

func GetTimeDifference(previousTime, currentTime string) string

func InterfaceToString

func InterfaceToString(in interface{}) string

func IsTodayFromString

func IsTodayFromString(dateStr string) (bool, error)

func NewExcel

func NewExcel(filename string) (*excelize.File, error)

func ParseDuration

func ParseDuration(durationStr string) (time.Duration, error)

func ParseInt64ByStr

func ParseInt64ByStr(strIds []string) ([]int64, error)

func ParseLogLevel

func ParseLogLevel(s string) log.Lvl

func ParserConfigurationByFile

func ParserConfigurationByFile(format, in string, out interface{}) error

func TimeNowFormat

func TimeNowFormat() string

func TimeParse

func TimeParse(times string) (time.Duration, error)

Types

type DateComparisonType

type DateComparisonType int

Jump to

Keyboard shortcuts

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