toolkit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CRONTAB_PATH = "/var/spool/cron/"
View Source
const (
	LastPublishTime = "last_publish_time"
)

Variables

This section is empty.

Functions

func IsDiffMinLastPublish

func IsDiffMinLastPublish(nowtime time.Time, period time.Duration) bool

func IsDiffMinTimeWithTask

func IsDiffMinTimeWithTask(taskname string, nowtime time.Time, period time.Duration) bool

true为相差大于等于1min,false为相差小于1min

func IsSameMinTime

func IsSameMinTime(time1, time2 int64) bool

检测时间是否相隔 1min(去除秒),time1,2不分前后

func ListHosts

func ListHosts() (string, error)

func ListRouteTable

func ListRouteTable() (string, error)

func ReadTimeFromDB

func ReadTimeFromDB(timekey string) (int64, error)

将时间从持久化存储中读取出来并格式化

func RecordPublishTime

func RecordPublishTime(time int64) error

func RecordTaskPublishTime

func RecordTaskPublishTime(taskname, time string) error

将最后一次上报时间写入到持久化存储中

Types

type Crontab

type Crontab struct {
	Name    string `json:"user"`
	Content string `json:"content"`
}

func ListCrontab

func ListCrontab() ([]Crontab, error)

Jump to

Keyboard shortcuts

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