target

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRequests = errors.New("no requests provided")

Functions

This section is empty.

Types

type Target

type Target struct {
	Name   string
	Type   Type
	DSN    database.DataSourceNamer
	DBType database.Type
	// contains filtered or unexported fields
}

func New

func New(name string, dsn database.DataSourceNamer) (*Target, error)

func (*Target) Close

func (t *Target) Close(ctx context.Context) error

func (*Target) Open

func (t *Target) Open(ctx context.Context) error

func (*Target) PerformWithHandler

func (t *Target) PerformWithHandler(ctx context.Context, handler func(*request.Response), req database.Request) error

Blocking PerformWithHandler sends requests and processes responses synchronously using a handler. It blocks until all responses are received and handled or the context is cancelled.

func (*Target) Ping

func (t *Target) Ping(ctx context.Context) error

func (*Target) Request

func (t *Target) Request(ctx context.Context, req database.Request) (chan *request.Response, error)

func (*Target) RequestWithHandler

func (t *Target) RequestWithHandler(ctx context.Context, handler func(*request.Response), req database.Request) error

Non-Blocking RequestWithHandler sends requests and processes responses asynchronously using a handler.

func (*Target) String

func (t *Target) String() string

func (*Target) Update

func (t *Target) Update(ctx context.Context, opts ...TargetOption) error

type TargetOption

type TargetOption func(context.Context, *Target) error

func WithDataSource

func WithDataSource(dsn database.DataSourceNamer) TargetOption

func WithName

func WithName(newName string) TargetOption

type Type

type Type int
const (
	TypeUnknown Type = iota - 1
	TypeDriver
	TypeServer
	TypeDatabase
	TypeTable
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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