Documentation ¶
Overview ¶
Package platform provides the Platform API client.
Package platform provides the Platform API client.
Index ¶
- type APIResponse
- type Client
- func (p *Client) CheckPlatformToken(ctx context.Context, request TokenCheckRequest) (TokenCheckResponse, error)
- func (p *Client) StartObservationSession(ctx context.Context, request StartObservationRequest) (StartObservationResponse, error)
- func (p *Client) StopObservationSession(ctx context.Context, request StopObservationRequest) (APIResponse, error)
- func (p *Client) UploadObservationArtifact(ctx context.Context, data []byte, sessionID, artifactType string) error
- func (p *Client) UploadObservationLogs(ctx context.Context, data []byte, sessionID string) error
- type ClientConfig
- type ConfigValidationError
- type StartObservationRequest
- type StartObservationResponse
- type StopObservationRequest
- type TokenCheckRequest
- type TokenCheckResponse
- type UploadArtifactResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct { Hint string `json:"hint"` Details string `json:"details"` Code string `json:"code"` Message string `json:"message"` }
APIResponse represents common fields of an API response.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the Platform API client.
func NewClient ¶
func NewClient(platformCfg ClientConfig) (*Client, error)
NewClient creates a new Platform API client.
func (*Client) CheckPlatformToken ¶
func (p *Client) CheckPlatformToken(ctx context.Context, request TokenCheckRequest) (TokenCheckResponse, error)
CheckPlatformToken makes an HTTP request to check the Platform Access Token.
func (*Client) StartObservationSession ¶
func (p *Client) StartObservationSession(ctx context.Context, request StartObservationRequest) (StartObservationResponse, error)
StartObservationSession makes an HTTP request to notify Platform about start observation.
func (*Client) StopObservationSession ¶
func (p *Client) StopObservationSession(ctx context.Context, request StopObservationRequest) (APIResponse, error)
StopObservationSession makes an HTTP request to notify Platform about stop observation and pass observation details.
type ClientConfig ¶
ClientConfig describes configuration parameters of Postgres.ai Platform client.
type ConfigValidationError ¶
type ConfigValidationError error
ConfigValidationError represents a config validation error.
type StartObservationRequest ¶
type StartObservationRequest struct { InstanceID string `json:"instance_id"` CloneID string `json:"clone_id"` StartedAt string `json:"started_at"` Config types.Config `json:"config"` Tags map[string]string `json:"tags"` }
StartObservationRequest represents a start observation request.
type StartObservationResponse ¶
type StartObservationResponse struct { APIResponse SessionID uint64 `json:"id"` }
StartObservationResponse represents response of a start observation request.
type StopObservationRequest ¶
type StopObservationRequest struct { SessionID uint64 `json:"id"` FinishedAt string `json:"finished_at"` Result models.ObservationResult `json:"result"` }
StopObservationRequest represents a stop observation request.
type TokenCheckRequest ¶
type TokenCheckRequest struct {
Token string `json:"token"`
}
TokenCheckRequest represents a token checking request.
type TokenCheckResponse ¶
type TokenCheckResponse struct { APIResponse OrganizationID uint `json:"org_id"` Personal bool `json:"is_personal"` }
TokenCheckResponse represents response of a token checking request.