Documentation ¶
Index ¶
- Constants
- type AccountInfoDTO
- type Client
- func (c *Client) CreateWarehouse(warehouseName, size string) error
- func (c *Client) CreateWarehouseAndWaitRunning(warehouseName, size string) error
- func (c *Client) CurrentEndpoint() string
- func (c *Client) CurrentOrganization() string
- func (c *Client) CurrentWarehouse() string
- func (c *Client) DeleteWarehouse(warehouseName string) error
- func (c *Client) DoAuthRequest(method, path string, headers http.Header, req interface{}, resp interface{}) error
- func (c *Client) DoRequest(method, path string, headers http.Header, req interface{}, resp interface{}) error
- func (c *Client) GetCloudDSN() (dsn string, err error)
- func (c *Client) GetCurrentAccountInfo() (*AccountInfoDTO, error)
- func (c *Client) ListOrgs() ([]OrgMembershipDTO, error)
- func (c *Client) ListWarehouses() ([]WarehouseStatusDTO, error)
- func (c *Client) Login(email, password string) error
- func (c *Client) Query(warehouseName, query string) (*QueryResponse, error)
- func (c *Client) QueryPage(warehouseName, queryId, path string) (*QueryResponse, error)
- func (c *Client) QuerySync(warehouseName string, sql string, respCh chan QueryResponse) error
- func (c *Client) RefreshToken() error
- func (c *Client) ResumeWarehouse(warehouseName string) error
- func (c *Client) SetCurrentOrg(org, tenant, gateway string)
- func (c *Client) SetCurrentWarehouse(warehouse string) error
- func (c *Client) SetEndpoint(endpoint string)
- func (c *Client) SuspendWarehouse(warehouseName string) error
- func (c *Client) UploadToStageByPresignURL(presignURL, fileName string, header map[string]interface{}, ...) error
- func (c *Client) ViewWarehouse(warehouseName string) (*WarehouseStatusDTO, error)
- func (c *Client) WriteConfig() error
- type CreateWarehouseRequestBody
- type OrgInfoDTO
- type OrgMembershipDTO
- 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 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 Client ¶ added in v0.1.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateWarehouse ¶ added in v0.1.0
func (*Client) CreateWarehouseAndWaitRunning ¶ added in v0.1.0
func (*Client) CurrentEndpoint ¶ added in v0.1.0
func (*Client) CurrentOrganization ¶ added in v0.1.0
func (*Client) CurrentWarehouse ¶ added in v0.1.0
func (*Client) DeleteWarehouse ¶ added in v0.1.0
func (*Client) DoAuthRequest ¶ added in v0.1.0
func (*Client) GetCloudDSN ¶ added in v0.1.0
func (*Client) GetCurrentAccountInfo ¶ added in v0.1.0
func (c *Client) GetCurrentAccountInfo() (*AccountInfoDTO, error)
func (*Client) ListOrgs ¶ added in v0.1.0
func (c *Client) ListOrgs() ([]OrgMembershipDTO, error)
func (*Client) ListWarehouses ¶ added in v0.1.0
func (c *Client) ListWarehouses() ([]WarehouseStatusDTO, error)
func (*Client) Query ¶ added in v0.1.0
func (c *Client) Query(warehouseName, query string) (*QueryResponse, error)
func (*Client) QueryPage ¶ added in v0.1.0
func (c *Client) QueryPage(warehouseName, queryId, path string) (*QueryResponse, error)
func (*Client) QuerySync ¶ added in v0.1.0
func (c *Client) QuerySync(warehouseName string, sql string, respCh chan QueryResponse) error
func (*Client) RefreshToken ¶ added in v0.1.0
func (*Client) ResumeWarehouse ¶ added in v0.1.0
func (*Client) SetCurrentOrg ¶ added in v0.1.0
func (*Client) SetCurrentWarehouse ¶ added in v0.1.0
func (*Client) SetEndpoint ¶ added in v0.1.0
func (*Client) SuspendWarehouse ¶ added in v0.1.0
func (*Client) UploadToStageByPresignURL ¶ added in v0.1.0
func (*Client) ViewWarehouse ¶ added in v0.1.0
func (c *Client) ViewWarehouse(warehouseName string) (*WarehouseStatusDTO, error)
func (*Client) WriteConfig ¶ added in v0.1.0
type OrgInfoDTO ¶ added in v0.1.0
type OrgMembershipDTO ¶
type OrgMembershipDTO struct { ID uint64 `json:"id"` AccountID uint64 `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"` Gateway string `json:"gateway"` MemberKind string `json:"memberKind"` State string `json:"state"` UpdatedAt time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` }
func (OrgMembershipDTO) Description ¶ added in v0.1.0
func (o OrgMembershipDTO) Description() string
func (OrgMembershipDTO) String ¶ added in v0.1.0
func (o OrgMembershipDTO) String() string
type QueryProgress ¶
type QueryRequest ¶
type QueryRequest struct {
SQL string `json:"sql"`
}
type QueryResponse ¶
type QueryResponse struct { Data [][]interface{} `json:"data"` Error *dc.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"` }
type WarehouseStatusDTO ¶
type WarehouseStatusDTO struct { Name string `json:"id,omitempty"` ReadyInstances int64 `json:"readyInstances,omitempty"` Size string `json:"size,omitempty"` State string `json:"state,omitempty"` TotalInstances int64 `json:"totalInstances,omitempty"` }
func (WarehouseStatusDTO) Description ¶ added in v0.1.0
func (w WarehouseStatusDTO) Description() string
func (WarehouseStatusDTO) StateEmoji ¶ added in v0.1.0
func (w WarehouseStatusDTO) StateEmoji() string
func (WarehouseStatusDTO) String ¶ added in v0.1.0
func (w WarehouseStatusDTO) String() string
Click to show internal directories.
Click to hide internal directories.