types

package
v0.0.0-...-1285e68 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package types contains all of the structs for objects in Statping including services, hits, failures, Core, and others.

More info on: https://github.com/nordcloud/statping-ng

Index

Constants

View Source
const (
	TIME_NANO  = "2006-01-02T15:04:05Z"
	TIME       = "2006-01-02 15:04:05"
	CHART_TIME = "2006-01-02T15:04:05.999999-07:00"
	TIME_DAY   = "2006-01-02"
)

Variables

View Source
var (
	ErrorServiceSelection = returnErr("error selecting services")

	// create errors
	ErrorCreateService    = returnErr("error creating service")
	ErrorCreateMessage    = returnErr("error creating messages")
	ErrorCreateIncident   = returnErr("error creating incident")
	ErrorCreateUser       = returnErr("error creating user")
	ErrorCreateIncidentUp = returnErr("error creating incident update")
	ErrorCreateGroup      = returnErr("error creating group")
	ErrorCreateCheckinHit = returnErr("error creating checkin hit")
	ErrorCreateSampleHits = returnErr("error creating sample hits")
	ErrorCreateCore       = returnErr("error creating core")
	ErrorCreateHit        = returnErr("error creating hit for service %v")

	ErrorDirCreate = returnErr("error creating directory %s")

	ErrorFileCopy = returnErr("error copying file %s to %s")

	ErrorConfig     = returnErr("error with configuration")
	ErrorConnection = returnErr("error with connection")

	ErrorNotFound  = returnErrCode("item was not found", http.StatusNotFound)
	ErrorJSONParse = returnErrCode("could not parse JSON request", http.StatusBadRequest)
)
View Source
var (
	Second = time.Second
	Minute = time.Minute
	Hour   = time.Hour
	Day    = Hour * 24
	Week   = Day * 7
	Month  = Week * 4
	Year   = Day * 365
)

Functions

func FixedTime

func FixedTime(t time.Time, d time.Duration) string

Types

type Error

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

func Err

func Err(err errorer, format interface{}) Error

func ErrWrap

func ErrWrap(err errorer, format interface{}, args ...interface{}) Error

func (Error) Error

func (e Error) Error() string

func (Error) String

func (e Error) String() string

type Errorer

type Errorer interface {
}

Jump to

Keyboard shortcuts

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