client

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 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) 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.GetKeyReply, error)

CreateKey creates a new key for the current session.

func (*Client) CreateOrg

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

CreateOrg creates a new org by name.

func (*Client) DestroyAccount added in v1.0.2

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

DestroyAccount completely deletes an account and all associated data.

func (*Client) GetOrg

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

GetOrg returns an org.

func (*Client) GetSessionInfo

func (c *Client) GetSessionInfo(ctx context.Context) (*pb.GetSessionInfoReply, 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.InviteToOrgReply, error)

InviteToOrg invites the given email to an org.

func (*Client) IsOrgNameAvailable

func (c *Client) IsOrgNameAvailable(ctx context.Context, name string) (*pb.IsOrgNameAvailableReply, 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) ListKeys

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

ListKeys returns a list of keys for the current session.

func (*Client) ListOrgs

func (c *Client) ListOrgs(ctx context.Context) (*pb.ListOrgsReply, 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) Signin

func (c *Client) Signin(ctx context.Context, usernameOrEmail string) (*pb.SigninReply, 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.SignupReply, error)

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

Jump to

Keyboard shortcuts

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