plugintest

package
v0.0.0-...-47a35ba Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTime = time.Date(2024, 10, 22, 0, 0, 0, 0, time.UTC)

Functions

func Buffer

func Buffer[T string | []byte](data T) *synq.LinkedBuffer

func ConnmetaSvc

func ConnmetaSvc(t *testing.T, ctx context.Context, conn *connection.Connection) connmeta.Service

func Headers

func Headers(kv map[string]string) *plugins.HttpHeaderMap

func MarshalJSON

func MarshalJSON(t *testing.T, v any) string

func MarshalYAML

func MarshalYAML(t *testing.T, v any) *yaml.Node

Types

type Clock

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

func NewClock

func NewClock(t *time.Time) *Clock

func (*Clock) Add

func (c *Clock) Add(d time.Duration)

func (*Clock) Now

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

func (*Clock) Set

func (c *Clock) Set(t time.Time)

type Context

type Context struct {
	T        *testing.T
	VReqBody []byte
	VResBody []byte
	VContext context.Context
	VTags    tags.List
	VMeta    *Meta
}

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) GetRequestBodyBuffer

func (c *Context) GetRequestBodyBuffer() plugins.BodyBuffer

plugins.HttpPluginInstance interface implementation this is the client side of the connection that filters can use to interact with the connection

func (*Context) GetResponseBodyBuffer

func (c *Context) GetResponseBodyBuffer() plugins.BodyBuffer

func (*Context) Meta

func (c *Context) Meta() plugins.Meta

type Logger

type Logger struct {
	T      *testing.T
	Logs   *observer.ObservedLogs
	Logger *zap.Logger
}

func NewLogger

func NewLogger(t *testing.T) *Logger

func (*Logger) Assert

func (tl *Logger) Assert(msg string, expected []map[string]any)

func (*Logger) Get

func (tl *Logger) Get(msg string) []map[string]any

func (*Logger) Sync

func (tl *Logger) Sync()

type Meta

type Meta struct {
	connmeta.Service
	VRequestID  string
	VReadBytes  int64
	VWriteBytes int64
}

func NewMeta

func NewMeta(t *testing.T, conn *connection.Connection) *Meta

func (*Meta) ReadBytes

func (m *Meta) ReadBytes() int64

func (*Meta) RequestID

func (m *Meta) RequestID() string

func (*Meta) SetReadBytes

func (m *Meta) SetReadBytes(bytes int64)

func (*Meta) SetWriteBytes

func (m *Meta) SetWriteBytes(bytes int64)

func (*Meta) WriteBytes

func (m *Meta) WriteBytes() int64

Jump to

Keyboard shortcuts

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