util

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferIsFullErr = errors.New("buffer is full")
View Source
var EndOfBuffer = errors.New("buffer already closed")

Functions

func GetGitAuth

func GetGitAuth() (transport.AuthMethod, error)

Types

type Expect

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

func NewExpect

func NewExpect(t *testing.T) *Expect

func (Expect) Equal

func (e Expect) Equal(exp interface{}, actual interface{})

func (Expect) Nil

func (e Expect) Nil(v interface{})

func (Expect) Nilf

func (e Expect) Nilf(v interface{}, msg string, args ...interface{})

func (Expect) True

func (e Expect) True(cond bool, args ...interface{})

type WheelBuffer

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

WheelBuffer is like a ring buffer except that a Write can overwrite unread messages. It's concurrency safe

func NewWheelBuffer

func NewWheelBuffer(n int) *WheelBuffer

func (*WheelBuffer) Close

func (rb *WheelBuffer) Close()

func (*WheelBuffer) ReadString

func (rb *WheelBuffer) ReadString() (string, error)

func (*WheelBuffer) WriteString

func (rb *WheelBuffer) WriteString(str string) (retPrev string, retErr error)

WriteString never blocks. It overwrites the head if the buffer is full, and returns the previous head

Jump to

Keyboard shortcuts

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