utils

package
v0.0.0-...-77c539c Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPResponseToStruct

func HTTPResponseToStruct(r *http.Response, v interface{}) error

HTTPResponseToStruct converts response from CTFtime into to a struct specified by the param v

func SetInterval

func SetInterval(f func(time.Time), t time.Duration) chan bool

SetInterval runs a function repeatedly in a goroutine and returns a channel `done` to stop the routine

Types

type Status

type Status string

Status specifies the status of events in the database

const (
	// Upcoming status
	Upcoming Status = "upcoming"
	// Ongoing status
	Ongoing Status = "ongoing"
	// Over staatus
	Over Status = "over"
)

func ComputeStatus

func ComputeStatus(start time.Time, finish time.Time) Status

ComputeStatus finds if a CTF is upcoming, ongoing or over

Jump to

Keyboard shortcuts

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