org

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package org provides shared logic for CircleCI organization operations.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotMember = errors.New("not a member of this organization")

ErrNotMember is returned by Details when orgID is not among the organizations the authenticated user belongs to.

Functions

func List

List fetches the organizations the authenticated user belongs to.

func ParseSlug

func ParseSlug(slug string) (vcs, orgName string, err error)

ParseSlug splits "gh/myorg" into its VCS and org components.

func Require

func Require(ctx context.Context, client *apiclient.Client) ([]apiclient.Collaboration, error)

Require fetches the user's organizations and returns an actionable error when the account has none. In interactive mode, offers to create a new CircleCI organization on the spot.

func Select

func Select(ctx context.Context, client *apiclient.Client) (string, error)

Select fetches the user's organizations and presents an interactive picker. With exactly one org it is auto-selected; with multiple the user picks.

func ValidateSlug

func ValidateSlug(collabs []apiclient.Collaboration, slug string) error

ValidateSlug checks that the given org slug is among the user's organizations.

Types

type Info added in v1.16.0

type Info struct {
	ID   uuid.UUID
	Name string
	// VCS is the provider backing the org; empty for a standalone org.
	VCS string
	// Admin is nil when the server does not support the admin check.
	Admin *bool
}

Info is what `circleci org get` reports about one organization.

func Details added in v1.16.0

func Details(ctx context.Context, client *apiclient.Client, orgID uuid.UUID) (*Info, error)

Details gathers the organization's identity and the caller's admin status.

The identity comes from the caller's org list, and admin status from whether the org is among those the caller can manage (GET /api/v3/orgs with filter[can_manage]). A server without that filter — an older CircleCI server install — rejects it with 400 Bad Request; Admin is then left nil rather than failing the whole lookup. Any other error (5xx, network, cancellation) is returned.

Jump to

Keyboard shortcuts

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