Documentation ¶
Overview ¶
Package pxapi provides the Go client interface for Pixie. WARNING: The API defined in this package is not stable and can change without notice. The same goes for the package path: (github.com/pixie-labs/pixie/api/go)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtoFromUUIDStrOrNil ¶
ProtoFromUUIDStrOrNil generates proto from string representation of a UUID (nil value is used if parsing fails).
func ProtoToUUIDStr ¶
ProtoToUUIDStr generates an expensive string representation of a UUID proto.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the base client to use pixie cloud + vizier.
func NewClient ¶
func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error)
NewClient creates a new Pixie API Client.
func (*Client) GetVizierInfo ¶
GetVizierInfo gets info about the given clusterID.
func (*Client) ListViziers ¶
func (c *Client) ListViziers(ctx context.Context) ([]*VizierInfo, error)
ListViziers gets a list of Viziers registered with Pixie.
func (*Client) NewVizierClient ¶
NewVizierClient creates a new vizier client, for the passed in vizierID.
type ClientOption ¶
type ClientOption func(client *Client)
ClientOption configures options on the client.
func WithAPIKey ¶
func WithAPIKey(auth string) ClientOption
WithAPIKey is the option to specify the API key to use.
func WithBearerAuth ¶
func WithBearerAuth(auth string) ClientOption
WithBearerAuth is the option to specify bearer auth to use.
func WithCloudAddr ¶
func WithCloudAddr(cloudAddr string) ClientOption
WithCloudAddr is the option to specify cloud address to use.
type ResultsStats ¶
type ResultsStats struct { AcceptedBytes int64 TotalBytes int64 ExecutionTime time.Duration CompilationTime time.Duration BytesProcessed int64 RecordsProcessed int64 }
ResultsStats stores statistics about the data.
type ScriptResults ¶
type ScriptResults struct {
// contains filtered or unexported fields
}
ScriptResults tracks the results of a script, and provides mechanisms to cancel, etc.
func (*ScriptResults) Stats ¶
func (s *ScriptResults) Stats() *ResultsStats
Stats returns the execution and script stats.
func (*ScriptResults) Stream ¶
func (s *ScriptResults) Stream() error
Stream will start streaming the results. Since the API is streaming fist, even a non streaming script requires this to be called to get all the results.
type TableMuxer ¶
type TableMuxer interface { // AcceptTable is passed the table information, if nil is returned then the table stream is ignored. AcceptTable(ctx context.Context, metadata types.TableMetadata) (TableRecordHandler, error) }
TableMuxer is an interface to route tables to the correct handler.
type TableRecordHandler ¶
type TableRecordHandler interface { // HandleInit is called to initialize the table handler interface. HandleInit(ctx context.Context, metadata types.TableMetadata) error // HandleRecord is called whenever a new row of the data is available. HandleRecord(ctx context.Context, record *types.Record) error // HandleDone is called when the table streaming has been completed. HandleDone(ctx context.Context) error }
TableRecordHandler is an interface that processes a table record-wise.
type VizierClient ¶
type VizierClient struct {
// contains filtered or unexported fields
}
VizierClient is the client for a single vizier.
func (*VizierClient) ExecuteScript ¶
func (v *VizierClient) ExecuteScript(ctx context.Context, pxl string, mux TableMuxer) (*ScriptResults, error)
ExecuteScript runs the script on vizier.
type VizierInfo ¶
type VizierInfo struct { // Name of the vizier. Name string // ID of the Vizier (uuid as a string). ID string // Status of the Vizier. Status VizierStatus // Version of the installed vizier. Version string // DirectAccess says the cluster has direct access mode enabled. This means the data transfer will bypass the cloud. DirectAccess bool }
VizierInfo has information of a single Vizier.
type VizierStatus ¶
type VizierStatus string
VizierStatus stores the enumeration of all vizier statuses.
const ( VizierStatusUnknown VizierStatus = "Unknown" VizierStatusHealthy VizierStatus = "Healthy" VizierStatusUnhealthy VizierStatus = "Unhealthy" VizierStatusDisconnected VizierStatus = "Disconnected" )
Vizier Statuses.