Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsViolation(err error, message string) bool
- func MicrosecondsToUnixTime(timeInMicroseconds int64) time.Time
- func Now() time.Time
- func SetLogWriter(writer io.Writer) error
- func StringTimestampToHumanReadableFormat(unixTimestampAsString string) (humanReadable string, parsedTimestamp int64, err error)
- type Client
- type ConstraintViolation
- type Error
- type Request
Constants ¶
View Source
const MaxWaitTime = 1 * time.Minute
View Source
const MinWaitTime = 5 * time.Second
Variables ¶
View Source
var Logger = logger
Functions ¶
func ContainsViolation ¶
func MicrosecondsToUnixTime ¶
MicrosecondsToUnixTime converts the UTC time in microseconds to a time.Time struct (unix time)
func SetLogWriter ¶
func StringTimestampToHumanReadableFormat ¶
func StringTimestampToHumanReadableFormat(unixTimestampAsString string) (humanReadable string, parsedTimestamp int64, err error)
StringTimestampToHumanReadableFormat parses and sanity-checks a unix timestamp as string and returns it as int64 and a human-readable representation of it
Types ¶
type Client ¶
type Client interface { Get(url string, expectedStatusCodes ...int) Request Post(url string, payload any, expectedStatusCodes ...int) Request Put(url string, payload any, expectedStatusCodes ...int) Request Delete(url string, expectedStatusCodes ...int) Request }
func DefaultClient ¶
type ConstraintViolation ¶
type Error ¶
type Error struct { Code int `json:"code"` Message string `json:"message"` ConstraintViolations []ConstraintViolation `json:"constraintViolations,omitempty"` URL string `json:"-"` Method string `json:"-"` }
func (Error) ContainsViolation ¶
func (Error) ViolationMessage ¶
Click to show internal directories.
Click to hide internal directories.