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-io/pixie/api/go)
Index ¶
- type Client
- func (c *Client) CreateAPIKey(ctx context.Context, desc string) (*cloudpb.APIKey, error)
- func (c *Client) CreateDeployKey(ctx context.Context, desc string) (*cloudpb.DeploymentKey, error)
- func (c *Client) DeleteAPIKey(ctx context.Context, id string) error
- func (c *Client) GetLatestOperatorVersion(ctx context.Context) (string, error)
- func (c *Client) GetLatestVizierVersion(ctx context.Context) (string, error)
- func (c *Client) GetVizierInfo(ctx context.Context, clusterID string) (*VizierInfo, error)
- func (c *Client) ListViziers(ctx context.Context) ([]*VizierInfo, error)
- func (c *Client) NewVizierClient(ctx context.Context, vizierID string) (*VizierClient, error)
- type ClientOption
- func WithAPIKey(auth string) ClientOption
- func WithBearerAuth(auth string) ClientOption
- func WithCloudAddr(cloudAddr string) ClientOption
- func WithDirectAddr(directAddr string) ClientOption
- func WithDirectCredsInsecure() ClientOption
- func WithDisableTLSVerification(cloudAddr string) ClientOption
- func WithE2EEncryption(enabled bool) ClientOption
- type ResultsStats
- type ScriptResults
- type TableMuxer
- type TableRecordHandler
- type VizierClient
- type VizierInfo
- type VizierStatus
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 is the base client to use either pixie cloud + vizier or standalone pem + vizier.
func NewClient ¶
func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error)
NewClient creates a new Pixie API Client.
func (*Client) CreateAPIKey ¶
CreateAPIKey creates and API key with the passed in description.
func (*Client) CreateDeployKey ¶
CreateDeployKey creates a new deploy key, with an optional description.
func (*Client) DeleteAPIKey ¶
DeleteAPIKey deletes an API key by ID.
func (*Client) GetLatestOperatorVersion ¶ added in v0.4.1
GetLatestOperatorVersion returns the latest version of the operator available.
func (*Client) GetLatestVizierVersion ¶ added in v0.4.1
GetLatestVizierVersion returns the latest version of vizier available.
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.
func WithDirectAddr ¶ added in v0.5.0
func WithDirectAddr(directAddr string) ClientOption
WithDirectAddr is the option to specify direct address to use for data from standalone pem.
func WithDirectCredsInsecure ¶ added in v0.5.0
func WithDirectCredsInsecure() ClientOption
WithDirectCredsInsecure is the option to setup insecure credentials for direct connections.
func WithDisableTLSVerification ¶ added in v0.5.0
func WithDisableTLSVerification(cloudAddr string) ClientOption
Allows disabling TLS verification if the `PX_DISABLE_TLS` env var is set and the cloud address is a cluster domain (cluster.local).
func WithE2EEncryption ¶ added in v0.2.0
func WithE2EEncryption(enabled bool) ClientOption
WithE2EEncryption is the option to enable E2E ecnryption for table data.
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.
func (*VizierClient) GenerateOTelScript ¶ added in v0.4.1
GenerateOTelScript generates an otel export script for a given pxl script that has px.display calls.
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 }
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" VizierStatusDegraded VizierStatus = "Degraded" )
Vizier Statuses.
Directories ¶
Path | Synopsis |
---|---|
Package errdefs has the public error types used by the API.
|
Package errdefs has the public error types used by the API. |
examples
|
|
Package formatters contains implementations of table handles that can format data into tables, json, etc.
|
Package formatters contains implementations of table handles that can format data into tables, json, etc. |
Package muxes has implementations of the Mux interface to route tables.
|
Package muxes has implementations of the Mux interface to route tables. |
proto
|
|
cloudpb/mock
Package mock_cloudpb is a generated GoMock package.
|
Package mock_cloudpb is a generated GoMock package. |
vizierpb/mock
Package mock_vizierpb is a generated GoMock package.
|
Package mock_vizierpb is a generated GoMock package. |
Package types tracks all the Pixie types used in the Go API.
|
Package types tracks all the Pixie types used in the Go API. |