neonctl

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookPath

func LookPath() (string, error)

LookPath finds an installed Neon CLI binary, preferring `neon` but accepting `neonctl`.

Types

type Branch

type Branch struct {
	ID      string
	Name    string
	Primary bool
}

type Client

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

Client is a small wrapper around the Neon CLI.

The official CLI is invoked as `neon` (and may also be installed as `neonctl`). We keep the wrapper tolerant of CLI output differences and treat all returned connection strings as secret material.

func New

func New(bin string) *Client

func (*Client) ConnectionString

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

ConnectionString returns a connection string for a project and role. The returned string contains credentials and must be treated as secret.

func (*Client) ConnectionStringForBranch

func (c *Client) ConnectionStringForBranch(ctx context.Context, projectID, roleName, branch string, pooled bool) (string, error)

ConnectionStringForBranch returns a connection string for the requested branch. The returned string contains credentials and must be treated as secret.

func (*Client) CreateProject

func (c *Client) CreateProject(ctx context.Context, name string) (Project, error)

func (*Client) ListBranches

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

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context) ([]Project, error)

func (*Client) WithRunner

func (c *Client) WithRunner(run func(ctx context.Context, bin string, args ...string) (stdout, stderr []byte, err error)) *Client

type Project

type Project struct {
	ID   string
	Name string
}

Jump to

Keyboard shortcuts

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