Documentation
¶
Index ¶
- type Auth
- type Client
- func (c *Client) AddProject(ctx context.Context, name string, auth Auth) (*pb.GetProjectReply, error)
- func (c *Client) AddTeam(ctx context.Context, name string, auth Auth) (*pb.AddTeamReply, error)
- func (c *Client) AddToken(ctx context.Context, project string, auth Auth) (*pb.AddTokenReply, error)
- func (c *Client) Close() error
- func (c *Client) GetProject(ctx context.Context, name string, auth Auth) (*pb.GetProjectReply, error)
- func (c *Client) GetTeam(ctx context.Context, teamID string, auth Auth) (*pb.GetTeamReply, error)
- func (c *Client) InviteToTeam(ctx context.Context, teamID, email string, auth Auth) (*pb.InviteToTeamReply, error)
- func (c *Client) LeaveTeam(ctx context.Context, teamID string, auth Auth) error
- func (c *Client) ListBucketPath(ctx context.Context, project, pth string, auth Auth) (*pb.ListBucketPathReply, error)
- func (c *Client) ListProjects(ctx context.Context, auth Auth) (*pb.ListProjectsReply, error)
- func (c *Client) ListTeams(ctx context.Context, auth Auth) (*pb.ListTeamsReply, error)
- func (c *Client) ListTokens(ctx context.Context, project string, auth Auth) (*pb.ListTokensReply, error)
- func (c *Client) Login(ctx context.Context, email string) (*pb.LoginReply, error)
- func (c *Client) Logout(ctx context.Context, auth Auth) error
- func (c *Client) PullBucketPath(ctx context.Context, bucketPath string, writer io.Writer, auth Auth, ...) error
- func (c *Client) PushBucketPath(ctx context.Context, project, bucketPath string, reader io.Reader, auth Auth, ...) (result path.Resolved, root path.Path, err error)
- func (c *Client) RemoveBucketPath(ctx context.Context, pth string, auth Auth) error
- func (c *Client) RemoveProject(ctx context.Context, name string, auth Auth) error
- func (c *Client) RemoveTeam(ctx context.Context, teamID string, auth Auth) error
- func (c *Client) RemoveToken(ctx context.Context, tokenID string, auth Auth) error
- func (c *Client) Switch(ctx context.Context, auth Auth) error
- func (c *Client) Whoami(ctx context.Context, auth Auth) (*pb.WhoamiReply, error)
- type PullBucketPathOption
- type PullBucketPathOptions
- type PushBucketPathOption
- type PushBucketPathOptions
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, creds credentials.TransportCredentials) (*Client, error)
NewClient starts the client.
func (*Client) AddProject ¶
func (c *Client) AddProject(ctx context.Context, name string, auth Auth) (*pb.GetProjectReply, error)
AddProject add a new project under the given scope.
func (*Client) AddToken ¶
func (c *Client) AddToken(ctx context.Context, project string, auth Auth) (*pb.AddTokenReply, error)
AddToken add a new app token under the given project.
func (*Client) GetProject ¶
func (c *Client) GetProject(ctx context.Context, name string, auth Auth) (*pb.GetProjectReply, error)
GetProject returns a project by name.
func (*Client) InviteToTeam ¶
func (c *Client) InviteToTeam(ctx context.Context, teamID, email string, auth Auth) (*pb.InviteToTeamReply, error)
InviteToTeam invites the given email to a team by ID.
func (*Client) ListBucketPath ¶
func (c *Client) ListBucketPath(ctx context.Context, project, pth string, auth Auth) (*pb.ListBucketPathReply, error)
ListBucketPath returns information about a bucket path.
func (*Client) ListProjects ¶
ListProjects returns a list of all authorized projects.
func (*Client) ListTokens ¶
func (c *Client) ListTokens(ctx context.Context, project string, auth Auth) (*pb.ListTokensReply, error)
ListTokens returns a list of all app tokens for the given project.
func (*Client) Login ¶
Login currently gets or creates a user for the given email address, and then waits for email-based verification. @todo: Create a dedicated signup flow that collects more info like name, etc.
func (*Client) PullBucketPath ¶
func (c *Client) PullBucketPath( ctx context.Context, bucketPath string, writer io.Writer, auth Auth, opts ...PullBucketPathOption, ) error
PullBucketPath pulls the bucket path, writing it to writer if it's a file.
func (*Client) PushBucketPath ¶
func (c *Client) PushBucketPath( ctx context.Context, project, bucketPath string, reader io.Reader, auth Auth, opts ...PushBucketPathOption, ) (result path.Resolved, root path.Path, err error)
PushBucketPath pushes a file to a bucket path. The bucket and any directory paths will be created if they don't exist. This will return the resolved path and the bucket's new root path.
func (*Client) RemoveBucketPath ¶
RemoveBucketPath removes the file or directory at path. Bucket files and directories will be unpinned. If the resulting bucket is empty, it will also be removed.
func (*Client) RemoveProject ¶
RemoveProject removes a project by name.
func (*Client) RemoveTeam ¶
RemoveTeam removes a team by ID.
func (*Client) RemoveToken ¶
RemoveToken removes an app token by ID.
type PullBucketPathOption ¶
type PullBucketPathOption func(*PullBucketPathOptions)
PullBucketPathOption specifies an option for pulling a bucket path.
func WithPullProgress ¶
func WithPullProgress(ch chan<- int64) PullBucketPathOption
WithPullProgress writes progress updates to the given channel.
type PullBucketPathOptions ¶
type PullBucketPathOptions struct {
Progress chan<- int64
}
PullBucketPathOptions defines options for pulling a bucket path.
type PushBucketPathOption ¶
type PushBucketPathOption func(*PushBucketPathOptions)
PushBucketPathOption specifies an option for pushing a bucket path.
func WithPushProgress ¶
func WithPushProgress(ch chan<- int64) PushBucketPathOption
WithPushProgress writes progress updates to the given channel.
type PushBucketPathOptions ¶
type PushBucketPathOptions struct {
Progress chan<- int64
}
PushBucketPathOptions defines options for pushing a bucket path.