awaiter

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Copyright (C) 2016-2018 Betalo AB

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	DebugLevel = iota
	InfoLevel
	ErrorLevel
	SilentLevel
)

An enumeration of log levels.

Variables

View Source
var Version = ""

Functions

func ParseResources

func ParseResources(urlArgs []string) ([]resource, error)

Types

type Awaiter

type Awaiter struct {
	Logger  *LevelLogger
	Timeout time.Duration
}

func (*Awaiter) Run

func (a *Awaiter) Run(resources []resource) error

type LevelLogger

type LevelLogger struct {
	*log.Logger
	// contains filtered or unexported fields
}

LevelLogger defines a logger which is aware of log levels and only logs messages when below or equal to a given log level.

func NewLogger

func NewLogger(level int) *LevelLogger

NewLogger instantiates a new LevelLogger with a given log level.

func (*LevelLogger) Debug

func (l *LevelLogger) Debug(v ...interface{})

Debug logs a message if the current log level is below or equal to debugLevel.

func (*LevelLogger) Debugf

func (l *LevelLogger) Debugf(format string, v ...interface{})

Debugf logs a message if the current log level is below or equal to debugLevel.

func (*LevelLogger) Debugln

func (l *LevelLogger) Debugln(v ...interface{})

Debugln logs a message if the current log level is below or equal to debugLevel.

func (*LevelLogger) Error

func (l *LevelLogger) Error(v ...interface{})

Error logs a message if the current log level is below or equal to errorLevel.

func (*LevelLogger) Errorf

func (l *LevelLogger) Errorf(format string, v ...interface{})

Errorf logs a message if the current log level is below or equal to errorLevel.

func (*LevelLogger) Errorln

func (l *LevelLogger) Errorln(v ...interface{})

Errorln logs a message if the current log level is below or equal to errorLevel.

func (*LevelLogger) Fatal

func (l *LevelLogger) Fatal(v ...interface{})

Fatal logs a message and exit the process.

func (*LevelLogger) Fatalf

func (l *LevelLogger) Fatalf(format string, v ...interface{})

Fatalf logs a message and exit the process.

func (*LevelLogger) Fatalln

func (l *LevelLogger) Fatalln(v ...interface{})

Fatalln logs a message and exit the process.

func (*LevelLogger) Info

func (l *LevelLogger) Info(v ...interface{})

Info logs a message if the current log level is below or equal to infoLevel.

func (*LevelLogger) Infof

func (l *LevelLogger) Infof(format string, v ...interface{})

Infof logs a message if the current log level is below or equal to infoLevel.

func (*LevelLogger) Infoln

func (l *LevelLogger) Infoln(v ...interface{})

Infoln logs a message if the current log level is below or equal to infoLevel.

type UnavailabilityError

type UnavailabilityError struct {
	Reason error
}

func (*UnavailabilityError) Error

func (e *UnavailabilityError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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