api

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 NewClient added in v0.1.0

func NewClient() (*Client, error)

func (*Client) CreateWarehouse added in v0.1.0

func (c *Client) CreateWarehouse(warehouseName, size string) error

func (*Client) CreateWarehouseAndWaitRunning added in v0.1.0

func (c *Client) CreateWarehouseAndWaitRunning(warehouseName, size string) error

func (*Client) CurrentEndpoint added in v0.1.0

func (c *Client) CurrentEndpoint() string

func (*Client) CurrentOrganization added in v0.1.0

func (c *Client) CurrentOrganization() string

func (*Client) CurrentWarehouse added in v0.1.0

func (c *Client) CurrentWarehouse() string

func (*Client) DeleteWarehouse added in v0.1.0

func (c *Client) DeleteWarehouse(warehouseName string) error

func (*Client) DoAuthRequest added in v0.1.0

func (c *Client) DoAuthRequest(method, path string, headers http.Header, req interface{}, resp interface{}) error

func (*Client) DoRequest added in v0.1.0

func (c *Client) DoRequest(method, path string, headers http.Header, req interface{}, resp interface{}) error

func (*Client) GetCloudDSN added in v0.1.0

func (c *Client) GetCloudDSN() (dsn string, err error)

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) Login added in v0.1.0

func (c *Client) Login(email, password string) 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 (c *Client) RefreshToken() error

func (*Client) ResumeWarehouse added in v0.1.0

func (c *Client) ResumeWarehouse(warehouseName string) error

func (*Client) SetCurrentOrg added in v0.1.0

func (c *Client) SetCurrentOrg(org, tenant, gateway string)

func (*Client) SetCurrentWarehouse added in v0.1.0

func (c *Client) SetCurrentWarehouse(warehouse string) error

func (*Client) SetEndpoint added in v0.1.0

func (c *Client) SetEndpoint(endpoint string)

func (*Client) SuspendWarehouse added in v0.1.0

func (c *Client) SuspendWarehouse(warehouseName string) error

func (*Client) UploadToStageByPresignURL added in v0.1.0

func (c *Client) UploadToStageByPresignURL(presignURL, fileName string, header map[string]interface{}, displayProgress bool) error

func (*Client) ViewWarehouse added in v0.1.0

func (c *Client) ViewWarehouse(warehouseName string) (*WarehouseStatusDTO, error)

func (*Client) WriteConfig added in v0.1.0

func (c *Client) WriteConfig() error

type CreateWarehouseRequestBody

type CreateWarehouseRequestBody struct {
	ImageTag  string `json:"imageTag,omitempty"`
	Instances int64  `json:"instances,omitempty"`
	Name      string `json:"name,omitempty"`
	Size      string `json:"size,omitempty"`
}

type OrgInfoDTO added in v0.1.0

type OrgInfoDTO struct {
	Name         string    `json:"name"`
	MembersCount int64     `json:"memberCount"`
	TenantID     string    `json:"tenantID"`
	State        string    `json:"state"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
}

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 QueryProgress struct {
	Bytes uint64 `json:"bytes"`
	Rows  uint64 `json:"rows"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL