Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeReportFile = UserConfigHour()
Functions ¶
func UserConfigHour ¶
UserConfigHour calculates the duration until the next occurrence of the configured hour (Config.GenerateLogsOptions.Hour) on the current or following day.
Returns:
- time.Duration: The time remaining to reach the target hour. If the hour has already passed today, it returns the duration until that same hour on the following day.
The function performs:
- Retrieves the hour string from options.Config.GenerateLogsOptions.Hour (expected format: "15:04:05").
- Parses the hour using time.Parse. If the format is invalid, the program terminates with log.Fatal.
- Constructs a time.Time object for today at the parsed hour, using the current local time zone.
- Calculates the difference between that target time and the current moment (time.Now()).
- If the difference is negative (the hour has already passed), it adds 24 hours to target the next day.
- Returns the resulting duration.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.