Documentation
¶
Index ¶
- Constants
- type APIClient
- func (c *APIClient) CreateWarehouse(warehouseName, size string) error
- func (c *APIClient) CreateWarehouseAndWaitRunning(warehouseName, size string) error
- func (c *APIClient) DeleteWarehouse(warehouseName string) error
- func (c *APIClient) DoRequest(method, path string, headers http.Header, req interface{}, resp interface{}) error
- func (c *APIClient) GetCurrentAccountInfo() (*AccountInfoDTO, error)
- func (c *APIClient) ListOrgs() ([]string, error)
- func (c *APIClient) ListWarehouses() ([]WarehouseStatusDTO, error)
- func (c *APIClient) Login() error
- func (c *APIClient) Query(warehouseName, query string) (*QueryResponse, error)
- func (c *APIClient) QueryPage(warehouseName, queryId, path string) (*QueryResponse, error)
- func (c *APIClient) QuerySync(warehouseName string, sql string, respCh chan QueryResponse) error
- func (c *APIClient) RefreshTokens() error
- func (c *APIClient) ResumeWarehouse(warehouseName string) error
- func (c *APIClient) SuspendWarehouse(warehouseName string) error
- func (c *APIClient) UploadToStageByPresignURL(presignURL, fileName string, header map[string]interface{}, ...) error
- func (c *APIClient) ViewWarehouse(warehouseName string) (*WarehouseStatusDTO, error)
- type AccountID
- type AccountInfoDTO
- type CreateWarehouseRequestBody
- type MemberKind
- type OrgMemberID
- type OrgMembershipDTO
- type QueryError
- type QueryProgress
- type QueryRequest
- type QueryResponse
- type QueryStats
- type WarehouseStatusDTO
Constants ¶
View Source
const ( EndpointGlobal = "https://app.databend.com" EndpointCN = "https://app.databend.cn" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
UserEmail string
Password string
AccessToken string
RefreshToken string
CurrentOrgSlug string
CurrentWarehouse string
Endpoint string
}
func NewApiClient ¶
func NewApiClient() *APIClient
func (*APIClient) CreateWarehouse ¶
func (*APIClient) CreateWarehouseAndWaitRunning ¶
func (*APIClient) DeleteWarehouse ¶
func (*APIClient) GetCurrentAccountInfo ¶
func (c *APIClient) GetCurrentAccountInfo() (*AccountInfoDTO, error)
func (*APIClient) ListWarehouses ¶
func (c *APIClient) ListWarehouses() ([]WarehouseStatusDTO, error)
func (*APIClient) Query ¶
func (c *APIClient) Query(warehouseName, query string) (*QueryResponse, error)
func (*APIClient) QueryPage ¶
func (c *APIClient) QueryPage(warehouseName, queryId, path string) (*QueryResponse, error)
func (*APIClient) QuerySync ¶
func (c *APIClient) QuerySync(warehouseName string, sql string, respCh chan QueryResponse) error
func (*APIClient) RefreshTokens ¶
RefreshTokens every api cmd
func (*APIClient) ResumeWarehouse ¶
func (*APIClient) SuspendWarehouse ¶
func (*APIClient) UploadToStageByPresignURL ¶
func (*APIClient) ViewWarehouse ¶
func (c *APIClient) ViewWarehouse(warehouseName string) (*WarehouseStatusDTO, error)
type AccountInfoDTO ¶
type AccountInfoDTO struct {
ID uint64 `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
State string `json:"state"`
AvatarURL string `json:"avatarURL"`
DefaultOrgSlug string `json:"defaultOrgSlug"`
PasswordEnabled bool `json:"passwordEnabled"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type MemberKind ¶
type MemberKind string
type OrgMemberID ¶
type OrgMemberID uint64
type OrgMembershipDTO ¶
type OrgMembershipDTO struct {
ID OrgMemberID `json:"id"`
AccountID *AccountID `json:"accountID"`
AccountName string `json:"accountName"`
AccountEmail string `json:"accountEmail"`
OrgAvatarURL string `json:"orgAvatarURL"`
AccountAvatarURL string `json:"accountAvatarURL"`
OrgSlug string `json:"orgSlug"`
OrgName string `json:"orgName"`
OrgState string `json:"orgState"`
OrgTenantID string `json:"tenantID"`
Region string `json:"region"`
Provider string `json:"provider"`
MemberKind MemberKind `json:"memberKind"`
State string `json:"state"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
}
type QueryError ¶
type QueryProgress ¶
type QueryRequest ¶
type QueryRequest struct {
SQL string `json:"sql"`
}
type QueryResponse ¶
type QueryResponse struct {
Data [][]interface{} `json:"data"`
Error *QueryError `json:"error"`
FinalURI string `json:"final_uri"`
Id string `json:"id"`
NextURI string `json:"next_uri"`
Schema struct {
Fields []struct {
Name string `json:"name"`
DataType interface{} `json:"data_type"`
} `json:"fields"`
} `json:"schema,omitempty"`
State string `json:"state"`
Stats QueryStats `json:"stats"`
StatsURI string `json:"stats_uri"`
}
type QueryStats ¶
type QueryStats struct {
RunningTimeMS float64 `json:"running_time_ms"`
ScanProgress QueryProgress `json:"scan_progress"`
}
Click to show internal directories.
Click to hide internal directories.