helpers

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger provides aggregated logging

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

Error writes to the log at ERROR level

func (*Logger) Log

func (l *Logger) Log(format string, args ...interface{})

Log writes to the log at INFO level

func (*Logger) NewLine

func (l *Logger) NewLine()

NewLine adds a new line to the log

func (Logger) PrintSummary

func (l Logger) PrintSummary()

PrintSummary prints a summary of the emitted logs

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

Warn writes to the log at WARN level

type MemdClient

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

MemdClient provides a memcached client

func Dial

func Dial(host string, port int, bucket, user, pass string, tlsConfig *tls.Config) (*MemdClient, error)

Dial will dial a particular host and return a MemdClient

func (*MemdClient) Close

func (client *MemdClient) Close()

Close closes a connection

func (*MemdClient) GetConfig

func (client *MemdClient) GetConfig() ([]byte, error)

GetConfig will fetch a config via CCCP

func (*MemdClient) Ping

func (client *MemdClient) Ping() error

Ping will send a ping and wait for a response

type PingHelper

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

PingHelper provides a helper for the statistics of pinging

func (*PingHelper) Count

func (ph *PingHelper) Count() int

Count returns the number of pings performed

func (*PingHelper) Errors

func (ph *PingHelper) Errors() int

Errors returns the number of ping errors

func (*PingHelper) Max

func (ph *PingHelper) Max() time.Duration

Max returns the maximum duration of a ping

func (*PingHelper) Mean

func (ph *PingHelper) Mean() time.Duration

Mean returns the average duration of the pings

func (*PingHelper) Min

func (ph *PingHelper) Min() time.Duration

Min returns the minimum duration of a ping

func (*PingHelper) StartOne

func (ph *PingHelper) StartOne() PingState

StartOne starts one ping

func (*PingHelper) StopOne

func (ph *PingHelper) StopOne(state PingState, err error)

StopOne will stop a ping and add it to the statistics

func (*PingHelper) Successes

func (ph *PingHelper) Successes() int

Successes returns the number of successful pings

type PingState

type PingState time.Time

PingState represents the state of a single ping

Jump to

Keyboard shortcuts

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