util

package
v0.0.0-...-6aa8790 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferedPipedWriterProcess

func BufferedPipedWriterProcess(f func(w io.WriteCloser)) io.ReadCloser

func CheckRequiredFields

func CheckRequiredFields(req *logical.Request, fields *framework.FieldData) *logical.Response

func IsEnvVarTrue

func IsEnvVarTrue(envVarName string) bool

Types

type Clock

type Clock interface {
	Now() time.Time
	Since(time.Time) time.Duration
}

type FixedClock

type FixedClock struct {
	NowTime time.Time
}

func NewFixedClock

func NewFixedClock(nowTime time.Time) *FixedClock

func (*FixedClock) Now

func (c *FixedClock) Now() time.Time

func (*FixedClock) Since

func (c *FixedClock) Since(t time.Time) time.Duration

type LogicalError

type LogicalError error

func NewLogicalError

func NewLogicalError(format string, a ...interface{}) LogicalError

type SystemClock

type SystemClock struct{}

func NewSystemClock

func NewSystemClock() *SystemClock

func (*SystemClock) Now

func (c *SystemClock) Now() time.Time

func (*SystemClock) Since

func (c *SystemClock) Since(t time.Time) time.Duration

type ThroughputReader

type ThroughputReader struct {
	LogName        string
	R              io.Reader
	StartedAt      time.Time
	LastProgressAt time.Time
	ProcessedBytes int
	Context        context.Context
}

func NewThroughputReader

func NewThroughputReader(logName string, r io.Reader, ctx context.Context) *ThroughputReader

func (*ThroughputReader) Read

func (r *ThroughputReader) Read(p []byte) (int, error)

type ThroughputWriter

type ThroughputWriter struct {
	LogName        string
	W              io.Writer
	StartedAt      time.Time
	LastProgressAt time.Time
	ProcessedBytes int
	Context        context.Context
}

func NewThroughputWriter

func NewThroughputWriter(logName string, w io.Writer, ctx context.Context) *ThroughputWriter

func (*ThroughputWriter) Write

func (w *ThroughputWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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