adaptertest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package adaptertest is a generated GoMock package.

Package adaptertest opens the copilot-adapter store on pgmem, CSF's in-process substitute for PostgreSQL, with the adapter's real schema applied: the store a spec grants when it needs copilot-adapter state without a database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenStore

func OpenStore(reporter IReporter) *pgmem.PostgresStoreOnPgmem[adapter.IStore]

OpenStore opens a store for one spec and closes it when the spec ends; a store that cannot be opened fails the spec.

Types

type IReporter

type IReporter interface {
	Helper()
	Errorf(format string, arguments ...any)
	Fatalf(format string, arguments ...any)
	Cleanup(cleanup func())
}

IReporter is the part of a spec runner the store is opened against: GinkgoT() and *testing.T both satisfy it.

type MockIDialer

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

MockIDialer is a mock of IDialer interface.

func NewMockIDialer

func NewMockIDialer(ctrl *gomock.Controller) *MockIDialer

NewMockIDialer creates a new mock instance.

func (*MockIDialer) DialContext

func (m *MockIDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

DialContext mocks base method.

func (*MockIDialer) EXPECT

func (m *MockIDialer) EXPECT() *MockIDialerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockIDialerMockRecorder

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

MockIDialerMockRecorder is the mock recorder for MockIDialer.

func (*MockIDialerMockRecorder) DialContext

func (mr *MockIDialerMockRecorder) DialContext(ctx, network, address any) *gomock.Call

DialContext indicates an expected call of DialContext.

type MockIListener

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

MockIListener is a mock of IListener interface.

func NewMockIListener

func NewMockIListener(ctrl *gomock.Controller) *MockIListener

NewMockIListener creates a new mock instance.

func (*MockIListener) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIListener) Listen

func (m *MockIListener) Listen(ctx context.Context, network, address string) (net.Listener, error)

Listen mocks base method.

type MockIListenerMockRecorder

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

MockIListenerMockRecorder is the mock recorder for MockIListener.

func (*MockIListenerMockRecorder) Listen

func (mr *MockIListenerMockRecorder) Listen(ctx, network, address any) *gomock.Call

Listen indicates an expected call of Listen.

type Server

type Server struct {
	// URL is the base URL Client reaches the handler at.
	URL string
	// Client dials through the ipc/net/http client capability.
	Client *http.Client
}

Server is a handler served the way the binary serves it — by the ipc/net/http listener, mounted in a runtime scope — over an in-memory connection (see memoryListener) that a gomock socket capability hands to both ends.

func Serve

func Serve(reporter IReporter, handler http.Handler) *Server

Serve starts handler for one spec and stops it, joining every serving goroutine, when the spec ends.

Jump to

Keyboard shortcuts

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