user

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoUser = errors.New("no user")

ErrNoUser is the error given when attempting to remove a user that does not exist within the organization.

Functions

func Remove

func Remove(ctx context.Context, client HTTPClient, organization, email string) error

Remove a user from the organization whose email matches the one provided. Returns ErrNoUser if the organization does not have the user.

Types

type HTTPClient

type HTTPClient interface {
	Do(ctx context.Context, method, uri string, body, out interface{}) error
}

The HTTPClient interface describes types that perform HTTP requests.

type User

type User struct {
	ID    string   `json:"user_id"`
	Email string   `json:"email"`
	Roles []string `json:"roles"`
}

The User type describes a user within an organization and their roles within it.

func Add

func Add(ctx context.Context, client HTTPClient, organization, email string, admin bool) (*User, error)

Add a user to an organization with the provided email. If admin is true, the user will be created as an organization administrator.

func List

func List(ctx context.Context, client HTTPClient, organization string) ([]User, error)

List all users connected to the control plane for an organization, ordered by email address.

Jump to

Keyboard shortcuts

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