test_helpers

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestListeners = map[uuid.UUID]*TestListener{}

Functions

func JSONMarshal

func JSONMarshal[O []byte | string](t testing.TB, a any) O

func ListenerModName

func ListenerModName() string

func NopConn

func NopConn() net.Conn

Types

type TestListener

type TestListener struct {
	Called struct {
		Provision          bool
		Cleanup            bool
		Close              bool
		Accept             bool
		Addr               bool
		UnmarshalCaddyfile bool
	} `json:"-"`

	ID uuid.UUID `json:"id"`
	// contains filtered or unexported fields
}

func NewTestListener

func NewTestListener(t testing.TB, ctx context.Context) (*TestListener, func())

func NewTestListeners

func NewTestListeners(t testing.TB, ctx context.Context, n int) ([]*TestListener, func())

func (*TestListener) Accept

func (e *TestListener) Accept() (net.Conn, error)

func (*TestListener) AcceptConn

func (e *TestListener) AcceptConn(c net.Conn)

func (*TestListener) Addr

func (e *TestListener) Addr() net.Addr

func (*TestListener) CaddyModule

func (e *TestListener) CaddyModule() caddy.ModuleInfo

func (*TestListener) Cleanup

func (e *TestListener) Cleanup() error

func (*TestListener) Close

func (e *TestListener) Close() error

func (*TestListener) FailCleanup

func (e *TestListener) FailCleanup(msg string)

func (*TestListener) FailProvision

func (e *TestListener) FailProvision(msg string)

func (*TestListener) FailUnmarshalCaddyfile

func (e *TestListener) FailUnmarshalCaddyfile(msg string)

func (*TestListener) GetReal

func (e *TestListener) GetReal() *TestListener

func (*TestListener) Provision

func (e *TestListener) Provision(caddy.Context) error

func (*TestListener) UnmarshalCaddyfile

func (e *TestListener) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

Jump to

Keyboard shortcuts

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