Documentation ¶
Index ¶
- Constants
- func InitMajordomo(ctx context.Context) (majordomo.Service, error)
- func LogLevel(path string) zerolog.Level
- func ResolvePath(path string) string
- type CalendarDuration
- func (d *CalendarDuration) Adverb() string
- func (d *CalendarDuration) Days() int
- func (d *CalendarDuration) Decrement(date time.Time) time.Time
- func (d *CalendarDuration) Hours() int
- func (d *CalendarDuration) Increment(date time.Time) time.Time
- func (d *CalendarDuration) Minutes() int
- func (d *CalendarDuration) Months() int
- func (d *CalendarDuration) Mul(times int) *CalendarDuration
- func (d *CalendarDuration) Seconds() int
- func (d *CalendarDuration) String() string
- func (d *CalendarDuration) ToDuration() time.Duration
- func (d *CalendarDuration) Years() int
Constants ¶
const ( Day = 24 * time.Hour Month = 30 * Day Year = 365 * Day )
Time units for calculating durations in time.Duration.
Variables ¶
This section is empty.
Functions ¶
func InitMajordomo ¶ added in v0.7.0
InitMajordomo initialises the majordomo service, for fetching secrets.
func ResolvePath ¶ added in v0.7.0
ResolvePath resolves a potentially relative path to an absolute path.
Types ¶
type CalendarDuration ¶ added in v0.7.0
type CalendarDuration struct {
// contains filtered or unexported fields
}
CalendarDuration represents a calendar-based duration.
func MustParseCalendarDuration ¶ added in v0.7.0
func MustParseCalendarDuration(duration string) *CalendarDuration
MustParseCalendarDuration parses a duration string, panicking on error.
func ParseCalendarDuration ¶ added in v0.7.0
func ParseCalendarDuration(duration string) (*CalendarDuration, error)
ParseCalendarDuration parses a duration string and returns a calendar duration.
func (*CalendarDuration) Adverb ¶ added in v0.7.0
func (d *CalendarDuration) Adverb() string
Adverb converts CalendarDuration to an English adverb (Daily / Yearly, etc).
func (*CalendarDuration) Days ¶ added in v0.7.0
func (d *CalendarDuration) Days() int
Days returns this duration's days.
func (*CalendarDuration) Decrement ¶ added in v0.7.0
func (d *CalendarDuration) Decrement(date time.Time) time.Time
Decrement decrements the date by the duration.
func (*CalendarDuration) Hours ¶ added in v0.7.0
func (d *CalendarDuration) Hours() int
Hours returns this duration's hours.
func (*CalendarDuration) Increment ¶ added in v0.7.0
func (d *CalendarDuration) Increment(date time.Time) time.Time
Increment increments the date by the duration.
func (*CalendarDuration) Minutes ¶ added in v0.7.0
func (d *CalendarDuration) Minutes() int
Minutes returns this duration's minutes.
func (*CalendarDuration) Months ¶ added in v0.7.0
func (d *CalendarDuration) Months() int
Months returns this duration's months.
func (*CalendarDuration) Mul ¶ added in v0.7.0
func (d *CalendarDuration) Mul(times int) *CalendarDuration
Mul performs multiplication for CalendarDuration.
func (*CalendarDuration) Seconds ¶ added in v0.7.0
func (d *CalendarDuration) Seconds() int
Seconds returns this duration's seconds.
func (*CalendarDuration) String ¶ added in v0.7.0
func (d *CalendarDuration) String() string
String returns the ISO-8601 period string.
func (*CalendarDuration) ToDuration ¶ added in v0.7.0
func (d *CalendarDuration) ToDuration() time.Duration
ToDuration converts CalendarDuration to time.Duration.
func (*CalendarDuration) Years ¶ added in v0.7.0
func (d *CalendarDuration) Years() int
Years returns this duration's years.