orgs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package orgs is a thin HTTP client for the Bitwave core API /v3/orgs endpoints. It powers `bw org list / create` and the picker in `bw org switch`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL       string
	TokenResolver func() (string, error)
	HTTPClient    *http.Client
}

Client is a stateless HTTP wrapper.

func New

func New(baseURL string, tokenResolver func() (string, error)) *Client

New returns a Client with a 30s default timeout.

func (*Client) Create

func (c *Client) Create(req CreateRequest) (*Org, error)

Create calls POST /v3/orgs and returns the new org.

func (*Client) List

func (c *Client) List() ([]Org, error)

List calls GET /v3/orgs and returns the user's org memberships.

type CreateRequest

type CreateRequest struct {
	Name string `json:"name"`
}

CreateRequest mirrors the minimum POST /v3/orgs body.

type Org

type Org struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Org is the minimal shape used by the CLI.

Jump to

Keyboard shortcuts

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