Documentation ¶
Index ¶
- func NewCaddyContext(t testing.TB, base context.Context, cfg caddy.Config) (caddy.Context, context.CancelFunc)
- func NewTestModule[T any, Parent caddy.Module](t testing.TB, p *Parent, fn func(Parent) *TestModule[T], module string)
- type TestConn
- func (tc *TestConn) Close() error
- func (tc *TestConn) LocalAddr() net.Addr
- func (tc *TestConn) Read(b []byte) (int, error)
- func (tc *TestConn) RemoteAddr() net.Addr
- func (tc *TestConn) SetDeadline(t time.Time) error
- func (tc *TestConn) SetReadDeadline(t time.Time) error
- func (tc *TestConn) SetWriteDeadline(t time.Time) error
- func (tc *TestConn) Write(b []byte) (int, error)
- type TestDialer
- type TestListener
- type TestListenerModule
- type TestModule
- func (t *TestModule[T]) CaddyModule() caddy.ModuleInfo
- func (t *TestModule[T]) Cleanup() error
- func (t *TestModule[T]) MarshalJSON() ([]byte, error)
- func (t *TestModule[T]) Provision(ctx caddy.Context) error
- func (t *TestModule[T]) Register()
- func (t *TestModule[T]) Start(v T) error
- func (t *TestModule[T]) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (t *TestModule[T]) UnmarshalJSON(b []byte) error
- func (t *TestModule[T]) Validate() error
- type TestNet
- type TestNetLookup
- type TestNetOp
- type TestNetwork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCaddyContext ¶
func NewTestModule ¶ added in v0.0.3
func NewTestModule[T any, Parent caddy.Module](t testing.TB, p *Parent, fn func(Parent) *TestModule[T], module string)
Types ¶
type TestConn ¶
type TestConn struct { ReadFn func([]byte) (int, error) WriteFn func([]byte) (int, error) CloseFn func() error LocalAddrFn func() net.Addr RemoteAddrFn func() net.Addr SetDeadlineFn func(time.Time) error SetReadDeadlineFn func(time.Time) error SetWriteDeadlineFn func(time.Time) error // contains filtered or unexported fields }
func NewTestConn ¶
func (*TestConn) RemoteAddr ¶
type TestDialer ¶
type TestDialer struct { DialFn func(context.Context, *net.TCPAddr) (net.Conn, error) DialPacketFn func(*net.UDPAddr) (net.PacketConn, error) // contains filtered or unexported fields }
func NewTestDialer ¶
func NewTestDialer(t testing.TB) *TestDialer
func (*TestDialer) DialPacket ¶
func (td *TestDialer) DialPacket(addr *net.UDPAddr) (net.PacketConn, error)
type TestListener ¶
type TestListener struct { AcceptFn func() (net.Conn, error) `json:"-"` CloseFn func() error `json:"-"` AddrFn func() net.Addr `json:"-"` // contains filtered or unexported fields }
func NewTestListener ¶
func NewTestListener(t testing.TB) *TestListener
func (*TestListener) Addr ¶
func (tl *TestListener) Addr() net.Addr
func (*TestListener) Close ¶
func (tl *TestListener) Close() error
type TestListenerModule ¶ added in v0.0.3
type TestListenerModule[T any] struct { TestListener TestModule[T] }
func NewTestListenerModule ¶ added in v0.0.3
func NewTestListenerModule[T any](t testing.TB) (v *TestListenerModule[T])
type TestModule ¶ added in v0.0.3
type TestModule[T any] struct { ID string `json:"-"` Module caddy.ModuleID `json:"-"` New func() caddy.Module UnmarshalCaddyfileFn func(*caddyfile.Dispenser) error `json:"-"` ProvisionerFn func(caddy.Context) error `json:"-"` ValidateFn func() error `json:"-"` CleanupFn func() error `json:"-"` StartFn func(T) error `json:"-"` MarshalJSONFn func() ([]byte, error) `json:"-"` UnmarshalJSONFn func(b []byte) error `json:"-"` // contains filtered or unexported fields }
func (*TestModule[T]) CaddyModule ¶ added in v0.0.3
func (t *TestModule[T]) CaddyModule() caddy.ModuleInfo
func (*TestModule[T]) Cleanup ¶ added in v0.0.3
func (t *TestModule[T]) Cleanup() error
func (*TestModule[T]) MarshalJSON ¶ added in v0.0.6
func (t *TestModule[T]) MarshalJSON() ([]byte, error)
func (*TestModule[T]) Provision ¶ added in v0.0.3
func (t *TestModule[T]) Provision(ctx caddy.Context) error
func (*TestModule[T]) Register ¶ added in v0.0.3
func (t *TestModule[T]) Register()
func (*TestModule[T]) Start ¶ added in v0.0.3
func (t *TestModule[T]) Start(v T) error
func (*TestModule[T]) UnmarshalCaddyfile ¶ added in v0.0.3
func (t *TestModule[T]) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
func (*TestModule[T]) UnmarshalJSON ¶ added in v0.0.6
func (t *TestModule[T]) UnmarshalJSON(b []byte) error
func (*TestModule[T]) Validate ¶ added in v0.0.3
func (t *TestModule[T]) Validate() error
type TestNet ¶
type TestNet struct { ListenFn func(*net.TCPAddr) (net.Listener, error) ListenPacketFn func(*net.UDPAddr) (net.PacketConn, error) DialerFn func(net.IP, uint16) pointc.Dialer LocalAddrFn func() net.IP // contains filtered or unexported fields }
func NewTestNet ¶
func (*TestNet) ListenPacket ¶
type TestNetLookup ¶
type TestNetLookup struct { LookupFn func(string) (pointc.Net, bool) // contains filtered or unexported fields }
func NewTestNetLookup ¶
func NewTestNetLookup(t testing.TB) *TestNetLookup
type TestNetwork ¶
type TestNetwork struct { TestModule[pointc.RegisterFunc] }
func NewTestNetwork ¶
func NewTestNetwork(t testing.TB) (v *TestNetwork)
Click to show internal directories.
Click to hide internal directories.