neonapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Parent  string `json:"parent_id"`
	Primary bool   `json:"primary"`
}

type Client

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

Client is a small Neon API client used by the vango CLI.

All methods treat connection URIs as secret material. Callers must never print returned DSNs to stdout/stderr.

func New

func New(cfg Config) (*Client, error)

func (*Client) ConnectionURI

func (c *Client) ConnectionURI(ctx context.Context, projectID, branchID, databaseName, roleName string, pooled bool) (string, error)

ConnectionURI retrieves a credential-bearing Postgres connection URI.

The returned string must be treated as secret material.

func (*Client) CreateBranch

func (c *Client) CreateBranch(ctx context.Context, projectID, name, parentBranchID string) (Branch, error)

func (*Client) DeleteBranch

func (c *Client) DeleteBranch(ctx context.Context, projectID, branchID string) error

func (*Client) ListBranches

func (c *Client) ListBranches(ctx context.Context, projectID string) ([]Branch, error)

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	HTTPClient *http.Client
}

Jump to

Keyboard shortcuts

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