tables

package
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package tables is an auto-generated package for the Area120 Tables API.

NOTE: This package is in alpha. It is not stable, and is likely to change.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type CallOptions

type CallOptions struct {
	GetTable        []gax.CallOption
	ListTables      []gax.CallOption
	GetWorkspace    []gax.CallOption
	ListWorkspaces  []gax.CallOption
	GetRow          []gax.CallOption
	ListRows        []gax.CallOption
	CreateRow       []gax.CallOption
	BatchCreateRows []gax.CallOption
	UpdateRow       []gax.CallOption
	BatchUpdateRows []gax.CallOption
	DeleteRow       []gax.CallOption
	BatchDeleteRows []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

type Client

type Client struct {

	// The call options for this service.
	CallOptions *CallOptions
	// contains filtered or unexported fields
}

Client is a client for interacting with Area120 Tables API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The Tables Service provides an API for reading and updating tables. It defines the following resource model:

The API has a collection of [Table][google.area120.tables.v1alpha1.Table]
resources, named tables/*

Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row]
resources, named tables/*/rows/*

The API has a collection of
[Workspace][google.area120.tables.v1alpha1.Workspace]
resources, named workspaces/*.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new tables service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

The Tables Service provides an API for reading and updating tables. It defines the following resource model:

The API has a collection of [Table][google.area120.tables.v1alpha1.Table]
resources, named tables/*

Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row]
resources, named tables/*/rows/*

The API has a collection of
[Workspace][google.area120.tables.v1alpha1.Workspace]
resources, named workspaces/*.
Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*Client) BatchCreateRows

BatchCreateRows creates multiple rows.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.BatchCreateRowsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchCreateRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) BatchDeleteRows added in v0.78.0

func (c *Client) BatchDeleteRows(ctx context.Context, req *tablespb.BatchDeleteRowsRequest, opts ...gax.CallOption) error

BatchDeleteRows deletes multiple rows.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.BatchDeleteRowsRequest{
		// TODO: Fill request struct fields.
	}
	err = c.BatchDeleteRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*Client) BatchUpdateRows

BatchUpdateRows updates multiple rows.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.BatchUpdateRowsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchUpdateRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*Client) Connection

func (c *Client) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*Client) CreateRow

func (c *Client) CreateRow(ctx context.Context, req *tablespb.CreateRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

CreateRow creates a row.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.CreateRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) DeleteRow

func (c *Client) DeleteRow(ctx context.Context, req *tablespb.DeleteRowRequest, opts ...gax.CallOption) error

DeleteRow deletes a row.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.DeleteRowRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*Client) GetRow

func (c *Client) GetRow(ctx context.Context, req *tablespb.GetRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

GetRow gets a row. Returns NOT_FOUND if the row does not exist in the table.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.GetRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) GetTable

func (c *Client) GetTable(ctx context.Context, req *tablespb.GetTableRequest, opts ...gax.CallOption) (*tablespb.Table, error)

GetTable gets a table. Returns NOT_FOUND if the table does not exist.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.GetTableRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetTable(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) GetWorkspace added in v0.78.0

func (c *Client) GetWorkspace(ctx context.Context, req *tablespb.GetWorkspaceRequest, opts ...gax.CallOption) (*tablespb.Workspace, error)

GetWorkspace gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.GetWorkspaceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetWorkspace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*Client) ListRows

func (c *Client) ListRows(ctx context.Context, req *tablespb.ListRowsRequest, opts ...gax.CallOption) *RowIterator

ListRows lists rows in a table. Returns NOT_FOUND if the table does not exist.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"google.golang.org/api/iterator"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.ListRowsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListRows(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*Client) ListTables

func (c *Client) ListTables(ctx context.Context, req *tablespb.ListTablesRequest, opts ...gax.CallOption) *TableIterator

ListTables lists tables for the user.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"google.golang.org/api/iterator"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.ListTablesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListTables(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*Client) ListWorkspaces added in v0.78.0

func (c *Client) ListWorkspaces(ctx context.Context, req *tablespb.ListWorkspacesRequest, opts ...gax.CallOption) *WorkspaceIterator

ListWorkspaces lists workspaces for the user.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"google.golang.org/api/iterator"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.ListWorkspacesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListWorkspaces(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*Client) UpdateRow

func (c *Client) UpdateRow(ctx context.Context, req *tablespb.UpdateRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

UpdateRow updates a row.

Example
package main

import (
	"context"

	tables "cloud.google.com/go/area120/tables/apiv1alpha1"

	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &tablespb.UpdateRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

type RowIterator

type RowIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*tablespb.Row, nextPageToken string, err error)
	// contains filtered or unexported fields
}

RowIterator manages a stream of *tablespb.Row.

func (*RowIterator) Next

func (it *RowIterator) Next() (*tablespb.Row, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*RowIterator) PageInfo

func (it *RowIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type TableIterator

type TableIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*tablespb.Table, nextPageToken string, err error)
	// contains filtered or unexported fields
}

TableIterator manages a stream of *tablespb.Table.

func (*TableIterator) Next

func (it *TableIterator) Next() (*tablespb.Table, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*TableIterator) PageInfo

func (it *TableIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type WorkspaceIterator added in v0.78.0

type WorkspaceIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*tablespb.Workspace, nextPageToken string, err error)
	// contains filtered or unexported fields
}

WorkspaceIterator manages a stream of *tablespb.Workspace.

func (*WorkspaceIterator) Next added in v0.78.0

func (it *WorkspaceIterator) Next() (*tablespb.Workspace, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*WorkspaceIterator) PageInfo added in v0.78.0

func (it *WorkspaceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

Jump to

Keyboard shortcuts

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