util

package
v0.0.0-...-b325b5c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

util is not the best name for a package. Yeah, yeah, I know.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCookie

func CreateCookie() (string, error)

CreateCookie can be used to create a random string of characters useful for being a cookie key.

func GetUserAgent

func GetUserAgent() string

GetUserAgent returns a string that can be used as the User-Agent string in requests we make.

func GetVersionStr

func GetVersionStr() string

GetVersionStr returns the version of the server as a string.

Types

type Schedule

type Schedule struct {
	// contains filtered or unexported fields
}

Schedule represents something that is scheduled. Typically this will be something along the lines of "every 6 hours" or "every 10 minutes".

func ParseSchedule

func ParseSchedule(str string) (*Schedule, error)

func (Schedule) NextTime

func (s Schedule) NextTime(now time.Time) time.Time

NextTime gets the next time this Schedule 'runs' given the current time.

func (Schedule) String

func (s Schedule) String() string

type ScheduleType

type ScheduleType int
const (
	// Interval schedule type is one that starts with "every". "every 6 hours", "every 2nd day" etc.
	Interval ScheduleType = 0
)

Jump to

Keyboard shortcuts

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