istio: istio.io/istio/mixer/adapter/stackdriver/internal/cloud.google.com/go/contextgraph/apiv1alpha1 Index | Examples | Files

package contextgraph

import "istio.io/istio/mixer/adapter/stackdriver/internal/cloud.google.com/go/contextgraph/apiv1alpha1"

Package contextgraph is an auto-generated package for the Stackdriver Context API.

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

Index

Examples

Package Files

context_graph_client.go doc.go

func DefaultAuthScopes Uses

func DefaultAuthScopes() []string

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

type CallOptions Uses

type CallOptions struct {
    AssertBatch []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

type Client Uses

type Client struct {

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

Client is a client for interacting with Stackdriver Context API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewClient Uses

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

NewClient creates a new context graph service client.

Access the Stackdriver Context Graph.

Code:

ctx := context.Background()
c, err := contextgraph.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*Client) AssertBatch Uses

func (c *Client) AssertBatch(ctx context.Context, req *contextgraphpb.AssertBatchRequest, opts ...gax.CallOption) (*contextgraphpb.AssertBatchResponse, error)

AssertBatch make a lot of assertions in one RPC.

Empty batches will be rejected (ones with zero assertions).

The timeline for each entity / relationship can be imagined as a sparse array mapping timestamps to assertions. When AssertBatch is called, the assertions in the batch are written to this timeline, possibly overwriting existing assertions for the same entities / relationships at the given timestamps.

If a given entity / relationship is asserted twice at the same timestamp, whether in the same batch or not, it is undefined which one is stored in the timeline.

Code:

ctx := context.Background()
c, err := contextgraph.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &contextgraphpb.AssertBatchRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.AssertBatch(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*Client) Close Uses

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 Uses

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

Connection returns the client's connection to the API service.

Package contextgraph imports 8 packages (graph) and is imported by 2 packages. Updated 2019-05-19. Refresh now. Tools for package owners.