Documentation ¶
Overview ¶
Package internal Time : 2022/9/5 20:51 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2023/1/14 14:24 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2023/1/15 10:58 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2023/1/15 17:43 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2022/11/7 21:53 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2022/9/7 22:01 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2022/9/11 16:24 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package internal Time : 2023/2/13 22:10 Author : xushiyin contact : yuqingxushiyin@gmail.com
Index ¶
- Constants
- Variables
- func CheckDateFormat(date string) (*time.Time, error)
- func CopyFile(src, dst string, perm os.FileMode) error
- func GetDateList(start string, r int) ([]string, error)
- func GetMonthList(dates []string) []string
- func GetNowMonthNumber() string
- func IsFileDirExist(d string) error
- func PrintQrCode2TTY(frontColor, backgroundColor, levelStr, content string) error
- func SortVersion(vList []string) []string
- func StrSliceJoin(gbk bool, s ...string) string
- func SysType() string
- type AreaCodeMode
- type AreaNameMode
- type CategoryMode
- type Files
- type FilterStr
- type GitClient
- type IsCompletedMode
- type Mover
- type OaWeb
- func (o *OaWeb) ClickBtnX(selector string) error
- func (o *OaWeb) ClickWorkingReportBtn() error
- func (o *OaWeb) ElementAttribute(selector, name string) (value *string, err error)
- func (o *OaWeb) FindDefaultBrowserPath() error
- func (o *OaWeb) GetAttrUrl(selector, name, host string) (*url.URL, error)
- func (o *OaWeb) GetCaptchaStr(u *url.URL) (string, error)
- func (o *OaWeb) GoLoginPage(ctx context.Context) error
- func (o *OaWeb) HasX(selector string) (*rod.Element, error)
- func (o *OaWeb) InputTextX(selector, input string) error
- func (o *OaWeb) LogErr(err error, message string, args ...interface{}) error
- func (o *OaWeb) LoginOa(ctx context.Context) error
- func (o *OaWeb) RetryLoginBtn(retryCnt int) error
- func (o *OaWeb) SelectCopyTo(rType ReportType, copyTo []string) error
- func (o *OaWeb) Start() error
- func (o *OaWeb) Stop() error
- func (o *OaWeb) StuffLoginInfo(ctx context.Context) error
- func (o *OaWeb) StuffReport(rType ReportType, report string, copyTo []string, autoSubmit bool) error
- type ProgressMode
- type ReportType
Constants ¶
const ( NormalBlack = "\033[38;5;0m \033[0m" NormalRed = "\033[38;5;1m \033[0m" NormalGreen = "\033[38;5;2m \033[0m" NormalYellow = "\033[38;5;3m \033[0m" NormalBlue = "\033[38;5;4m \033[0m" NormalMagenta = "\033[38;5;5m \033[0m" NormalCyan = "\033[38;5;6m \033[0m" NormalWhite = "\033[38;5;7m \033[0m" BrightBlack = "\033[48;5;0m \033[0m" BrightRed = "\033[48;5;1m \033[0m" BrightGreen = "\033[48;5;2m \033[0m" BrightYellow = "\033[48;5;3m \033[0m" BrightBlue = "\033[48;5;4m \033[0m" BrightMagenta = "\033[48;5;5m \033[0m" BrightCyan = "\033[48;5;6m \033[0m" BrightWhite = "\033[48;5;7m \033[0m" )
Variables ¶
var ( CopyToClickXPath = map[ReportType]string{ Daily: `//*[@id="z-day-form"]//div[@_search_]`, Weekly: `//*[@id="z-week-form"]//div[@_search_]`, } ReportTypeBtnXPath = map[ReportType]string{ Daily: `//a[@href="javascript:void(0);" and string()="日报"]`, Weekly: `//a[@href="javascript:void(0);" and string()="周报"]`, } ReportTextareaXPath = map[ReportType]string{ Daily: `//label[contains(text(),'今日完成工作')]/following-sibling::textarea`, Weekly: `//label[contains(text(),'本周完成工作')]/following-sibling::textarea`, } ReportSubmitBtnXPath = map[ReportType]string{ Daily: `//*[@id="z-day-form"]/a[string()="提 交"]`, Weekly: `//*[@id="z-week-form"]/a[string()="提 交"]`, } )
var AreaNameCodeMap = map[string]string{
"chongqing": "500000",
"zhejiang": "330000",
"yunnan": "530000",
"xinjiang": "650000",
"xizang": "540000",
"tianjin": "120000",
"sichuan": "510000",
"shenzhen": "440300",
"shanghai": "310000",
"shaanxi": "610000",
"shanxi": "140000",
"shandong": "370000",
"xiamen": "350200",
"ningxia": "640000",
"ningbo": "330200",
"neimeng": "150000",
"liaoning": "210000",
"jiangxi": "360000",
"jiangsu": "320000",
"jilin": "220000",
"hunan": "430000",
"hubei": "420000",
"heilongjiang": "230000",
"henan": "410000",
"hebei": "130000",
"hainan": "460000",
"guizhou": "520000",
"guangxi": "450000",
"guangdong": "440000",
"gansu": "620000",
"fujian": "350000",
"dalian": "210200",
"beijing": "110000",
"anhui": "340000",
"qingdao": "370200",
"qinghai": "630000",
}
var AreaNameModeIds = map[AreaCodeMode][]string{ ChongQingA: {"chongqing"}, ZheJiangA: {"zhejiang"}, YunNanA: {"yunnan"}, XinJiangA: {"xinjiang"}, XiZangA: {"xizang"}, TianJinA: {"tianjin"}, SiChuanA: {"sichuan"}, ShenZhenA: {"shenzhen"}, ShangHaiA: {"shanghai"}, ShaanxiA: {"shaanxi"}, ShanDongA: {"shandong"}, XiaMenA: {"xiamen"}, NingXiaA: {"ningxia"}, NingBoA: {"ningbo"}, NeiMengA: {"neimeng"}, LiaoNingA: {"liaoning"}, JiangXiA: {"jiangxi"}, JiangSuA: {"jiangsu"}, JiLinA: {"jilin"}, HuNanA: {"hunan"}, HuBeiA: {"hubei"}, HeiLongJiangA: {"heilongjiang"}, HeNanA: {"henan"}, HeBeiA: {"hebei"}, HaiNanA: {"hainan"}, GuiZhouA: {"guizhou"}, GuangXiA: {"guangxi"}, GuangDongA: {"guangdong"}, GanSuA: {"gansu"}, FuJianA: {"fujian"}, DaLianA: {"dalian"}, BeiJingA: {"beijing"}, AnHuiA: {"anhui"}, QingDaoA: {"qingdao"}, QingHaiA: {"qinghai"}, // contains filtered or unexported fields }
var CategoryModeIds = map[CategoryMode][]string{ OtherC: {"其他"}, ChangeHolidayC: {"调休"}, LeaveAbsenceC: {"请假"}, BusinessTripC: {"出差"}, MeetingC: {"会议"}, LearningC: {"学习提升"}, TechnicalResearchC: {"技术调研"}, AssistingOthersC: {"协助他人"}, CodeOptimisationC: {"代码优化"}, MaintenanceIssuesC: {"运维问题"}, TaskRequirementC: {"任务需求"}, }
CategoryModeIds Defines the textual representations for the CategoryMode values.
var IsCompletedModeIds = map[IsCompletedMode][]string{ YeahI: {"是"}, NopeI: {"否"}, }
Functions ¶
func GetMonthList ¶
func GetNowMonthNumber ¶
func GetNowMonthNumber() string
func IsFileDirExist ¶ added in v0.2.8
func PrintQrCode2TTY ¶ added in v0.3.0
PrintQrCode2TTY support as following: Supported background colors: [black, red, green, yellow, blue, magenta, cyan, white] Supported front colors: [black, red, green, yellow, blue, magenta, cyan, white] Supported error correction levels: [L, M, Q, H]
func SortVersion ¶ added in v0.2.9
func StrSliceJoin ¶ added in v0.2.10
Types ¶
type AreaCodeMode ¶ added in v0.2.8
type AreaCodeMode enumflag.Flag
const ( ChongQingA AreaCodeMode = iota ZheJiangA YunNanA XinJiangA XiZangA TianJinA SiChuanA ShenZhenA ShangHaiA ShaanxiA ShanDongA XiaMenA NingXiaA NingBoA NeiMengA LiaoNingA JiangXiA JiangSuA JiLinA HuNanA HuBeiA HeiLongJiangA HeNanA HeBeiA HaiNanA GuiZhouA GuangXiA GuangDongA GanSuA FuJianA DaLianA BeiJingA AnHuiA QingDaoA QingHaiA )
AreaCodeMode 36 areas code
type AreaNameMode ¶ added in v0.2.8
type AreaNameMode enumflag.Flag
type CategoryMode ¶ added in v0.2.8
type CategoryMode enumflag.Flag
const ( OtherC CategoryMode = iota // always colorize ChangeHolidayC LeaveAbsenceC BusinessTripC MeetingC LearningC TechnicalResearchC AssistingOthersC CodeOptimisationC MaintenanceIssuesC TaskRequirementC )
CategoryMode 其他,调休,请假、出差,会议,学习提升,技术调研,协助他人,代码优化,运维问题,任务需求
type FilterStr ¶ added in v0.2.9
func FilterBranchName ¶ added in v0.2.9
type GitClient ¶ added in v0.2.8
func (*GitClient) PushDelete ¶ added in v0.2.9
type IsCompletedMode ¶ added in v0.2.8
type IsCompletedMode enumflag.Flag
const ( YeahI IsCompletedMode = iota + 1 NopeI )
IsCompletedMode 是,否
type OaWeb ¶ added in v0.2.0
type OaWeb struct { IsHeadless bool IsRemote bool BrowserPath string Logger *log.Entry Browser *rod.Browser Launcher *launcher.Launcher Page *rod.Page }
func NewOaWebLogin ¶ added in v0.2.0
func (*OaWeb) ClickWorkingReportBtn ¶ added in v0.2.0
func (*OaWeb) ElementAttribute ¶ added in v0.2.0
func (*OaWeb) FindDefaultBrowserPath ¶ added in v0.2.0
func (*OaWeb) GetAttrUrl ¶ added in v0.2.0
func (*OaWeb) GetCaptchaStr ¶ added in v0.2.0
func (*OaWeb) InputTextX ¶ added in v0.2.0
func (*OaWeb) RetryLoginBtn ¶ added in v0.2.0
func (*OaWeb) SelectCopyTo ¶ added in v0.2.0
func (o *OaWeb) SelectCopyTo(rType ReportType, copyTo []string) error
func (*OaWeb) StuffLoginInfo ¶ added in v0.2.0
func (*OaWeb) StuffReport ¶ added in v0.2.0
type ProgressMode ¶ added in v0.2.8
type ProgressMode enumflag.Flag
const ( HundredP ProgressMode = iota NinetyP EightyP SeventyP SixtyP FiftyP FortyP ThirtyP TwentyP TenP ZeroP )
ProgressMode 100%,,0%
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package commands Time : 2022/9/25 23:05 Author : xushiyin contact : yuqingxushiyin@gmail.com
|
Package commands Time : 2022/9/25 23:05 Author : xushiyin contact : yuqingxushiyin@gmail.com |
Package excels Package internal Time : 2022/9/3 15:26 Author : xushiyin contact : yuqingxushiyin@gmail.com
|
Package excels Package internal Time : 2022/9/3 15:26 Author : xushiyin contact : yuqingxushiyin@gmail.com |
Package files_watcher Time : 2022/11/2 20:18 Author : xushiyin contact : yuqingxushiyin@gmail.com
|
Package files_watcher Time : 2022/11/2 20:18 Author : xushiyin contact : yuqingxushiyin@gmail.com |