transport

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url string, logger *slog.Logger, timeout time.Duration, cfAccessClientID, cfAccessClientSecret string) *Client

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, sql string, args []any) (Response, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Query

func (c *Client) Query(ctx context.Context, sql string, args []any) ([]byte, error)

type Payload

type Payload struct {
	SQL    string `json:"sql"`
	Args   []any  `json:"args"`
	IsExec bool   `json:"isExec"`
}

type Response

type Response struct {
	Changes   int64 `json:"changes"`
	LastRowID int64 `json:"last_row_id"`
}

response https://developers.cloudflare.com/d1/worker-api/prepared-statements/#run

Jump to

Keyboard shortcuts

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