client

package
v2.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 3 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides the client api.

func NewClient

func NewClient(target string, opts ...grpc.DialOption) (*Client, error)

NewClient starts the client.

func (*Client) BuildInfo

func (c *Client) BuildInfo(ctx context.Context) (*pb.BuildInfoResponse, error)

BuildInfo provides API build information.

func (*Client) Close

func (c *Client) Close() error

Close closes the client's grpc connection and cancels any active requests.

func (*Client) CreateKey

func (c *Client) CreateKey(ctx context.Context, keyType pb.KeyType, secure bool) (*pb.CreateKeyResponse, error)

CreateKey creates a new key for the current session.

func (*Client) CreateOrg

func (c *Client) CreateOrg(ctx context.Context, name string) (*pb.CreateOrgResponse, error)

CreateOrg creates a new org by name.

func (*Client) DestroyAccount

func (c *Client) DestroyAccount(ctx context.Context) error

DestroyAccount completely deletes an account and all associated data.

func (*Client) GetBillingSession

func (c *Client) GetBillingSession(ctx context.Context) (*pb.GetBillingSessionResponse, error)

GetBillingSession returns a billing portal session url.

func (*Client) GetIdentity

func (c *Client) GetIdentity(ctx context.Context) (*pb.GetIdentityResponse, error)

GetIdentity returns the identity of the current session.

func (*Client) GetOrg

func (c *Client) GetOrg(ctx context.Context) (*pb.GetOrgResponse, error)

GetOrg returns an org.

func (*Client) GetSessionInfo

func (c *Client) GetSessionInfo(ctx context.Context) (*pb.GetSessionInfoResponse, error)

GetSessionInfo returns session info.

func (*Client) InvalidateKey

func (c *Client) InvalidateKey(ctx context.Context, key string) error

InvalidateKey marks a key as invalid. New threads cannot be created with an invalid key.

func (*Client) InviteToOrg

func (c *Client) InviteToOrg(ctx context.Context, email string) (*pb.InviteToOrgResponse, error)

InviteToOrg invites the given email to an org.

func (*Client) IsOrgNameAvailable

func (c *Client) IsOrgNameAvailable(ctx context.Context, name string) (*pb.IsOrgNameAvailableResponse, error)

IsOrgNameAvailable returns a nil error if the name is valid and available.

func (*Client) IsUsernameAvailable

func (c *Client) IsUsernameAvailable(ctx context.Context, username string) error

IsUsernameAvailable returns a nil error if the username is valid and available.

func (*Client) LeaveOrg

func (c *Client) LeaveOrg(ctx context.Context) error

LeaveOrg removes the current session dev from an org.

func (*Client) ListBillingUsers

func (c *Client) ListBillingUsers(ctx context.Context, opts ...ListOption) (
	*pb.ListBillingUsersResponse, error)

ListBillingUsers returns a list of users the account is responsible for.

func (*Client) ListKeys

func (c *Client) ListKeys(ctx context.Context) (*pb.ListKeysResponse, error)

ListKeys returns a list of keys for the current session.

func (*Client) ListOrgs

func (c *Client) ListOrgs(ctx context.Context) (*pb.ListOrgsResponse, error)

ListOrgs returns a list of orgs for the current session.

func (*Client) RemoveOrg

func (c *Client) RemoveOrg(ctx context.Context) error

RemoveOrg removes an org.

func (*Client) SetupBilling

func (c *Client) SetupBilling(ctx context.Context) error

SetupBilling (re-)enables billing for an account, enabling usage beyond the free quotas.

func (*Client) Signin

func (c *Client) Signin(ctx context.Context, usernameOrEmail string) (*pb.SigninResponse, error)

Signin returns a session for an existing username or email. This method will block and wait for email-based verification.

func (*Client) Signout

func (c *Client) Signout(ctx context.Context) error

Signout deletes a session.

func (*Client) Signup

func (c *Client) Signup(ctx context.Context, username, email string) (*pb.SignupResponse, error)

Signup creates a new user and returns a session. This method will block and wait for email-based verification.

type ListOption

type ListOption func(*listOptions)

func WithLimit

func WithLimit(limit int64) ListOption

WithLimit is used to set a page size when paginating.

func WithOffset

func WithOffset(offset int64) ListOption

WithOffset is used to fetch the next page when paginating.

Jump to

Keyboard shortcuts

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