Documentation
¶
Index ¶
- Variables
- func DeleteFile(appID string, objectID string) error
- func DeployAppFromFile(appID string, projectPath string, groupName string, fileURL string, ...) (string, error)
- func DeployAppFromGit(appID string, projectPath string, groupName string) (string, error)
- func DeployImage(appID string, groupName string, imageTag string) (string, error)
- func GetAppRegion(appID string) (regions.Region, error)
- func LoginUSRegion() error
- func NewErrorFromBody(body string) error
- func NewErrorFromResponse(resp *grequests.Response) error
- func PollEvents(appID string, tok string, writer io.Writer) (bool, error)
- func PrintLogs(writer io.Writer, appID string, masterKey string, follow bool, isProd bool, ...) error
- func UploadFile(appID string, filePath string) (*upload.File, error)
- type Client
- type Error
- type ExecuteCQLResult
- type ExecuteCacheCommandResult
- type GetAppInfoResult
- type GetAppListResult
- type GetCacheListResult
- type GetGroupsResult
- type GetUserInfoResult
- type Log
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotLogined means user was not logined ErrNotLogined = errors.New("not logined") )
Functions ¶
func DeleteFile ¶
DeleteFile will delete the specific file
func DeployAppFromFile ¶
func DeployAppFromFile(appID string, projectPath string, groupName string, fileURL string, message string) (string, error)
DeployAppFromFile will deploy applications with specific file returns the event token for polling deploy log
func DeployAppFromGit ¶
DeployAppFromGit will deploy applications with user's git repo returns the event token for polling deploy log
func DeployImage ¶
DeployImage will deploy the engine group with specify image tag
func GetAppRegion ¶
GetAppRegion will query the app router, and return the app's region. The result is cached in process memory.
func NewErrorFromBody ¶
NewErrorFromBody build an error value from JSON string
func NewErrorFromResponse ¶ added in v0.3.0
NewErrorFromResponse build an error value from *grequest.Response
func PollEvents ¶
PollEvents will poll the server's event logs and print the result to the given io.Writer
Types ¶
type Error ¶
type Error struct {
Code int `json:"code"`
Content string `json:"error"`
ErrorEventID string `json:"errorEventID"`
}
Error is the LeanCloud API Server API common error format
type ExecuteCQLResult ¶ added in v0.4.0
type ExecuteCQLResult struct {
ClassName string `json:"className"`
Results []map[string]interface{} `json:"results"`
Count int `json:"count"`
}
ExecuteCQLResult is ExecuteCQL's result type
func ExecuteCQL ¶ added in v0.4.0
func ExecuteCQL(appID string, masterKey string, region regions.Region, cql string) (*ExecuteCQLResult, error)
ExecuteCQL will execute the cql, and returns' the result
type ExecuteCacheCommandResult ¶ added in v0.3.0
type ExecuteCacheCommandResult struct {
Result interface{} `json:"result"`
}
ExecuteCacheCommandResult is ExecuteCacheCommand's result type
func ExecuteCacheCommand ¶ added in v0.3.0
func ExecuteCacheCommand(appID string, instance string, db int, command string) (*ExecuteCacheCommandResult, error)
ExecuteCacheCommand will send command to LeanCache and excute it
type GetAppInfoResult ¶
type GetAppInfoResult struct {
AppID string `json:"app_id"`
AppKey string `json:"app_key"`
AppName string `json:"app_name"`
MasterKey string `json:"master_key"`
AppDomain string `json:"app_domain"`
LeanEngineMode string `json:"leanengine_mode"`
}
GetAppInfoResult is GetAppInfo function's result type
func GetAppInfo ¶
func GetAppInfo(appID string) (*GetAppInfoResult, error)
GetAppInfo returns the application's detail info
type GetAppListResult ¶
type GetAppListResult struct {
AppID string `json:"app_id"`
AppKey string `json:"app_key"`
AppName string `json:"app_name"`
MasterKey string `json:"master_key"`
AppDomain string `json:"app_domain"`
}
GetAppListResult is GetAppList function's result type
func GetAppList ¶
func GetAppList(region regions.Region) ([]*GetAppListResult, error)
GetAppList returns the current user's all LeanCloud application
type GetCacheListResult ¶ added in v0.3.0
type GetCacheListResult struct {
Instance string `json:"instance"`
MaxMemory int `json:"max_memory"`
InstanceID string `json:"instance_id"`
Info struct {
UsedMemoryHuman string `json:"used_memory_human"`
} `json:"info"`
}
GetCacheListResult is GetCacheList's return structure type
func GetCacheList ¶ added in v0.3.0
func GetCacheList(appID string) ([]*GetCacheListResult, error)
GetCacheList returns current app's LeanCache instance list
type GetGroupsResult ¶
type GetGroupsResult struct {
GroupName string `json:"groupName"`
Prod int `json:"prod"`
Instances []struct {
Name string `json:"name"`
Quota int `json:"quota"`
} `json:"instances"`
CurrentImage struct {
Runtime string `json:"runtime"`
ImageTag string `json:"imageTag"`
} `json:"currentImage"`
}
GetGroupsResult is GetGroups's result struct
func GetGroups ¶
func GetGroups(appID string) ([]*GetGroupsResult, error)
GetGroups returns the application's engine groups
type GetUserInfoResult ¶
GetUserInfoResult is the return type of GetUserInfo
func GetUserInfo ¶
func GetUserInfo() (*GetUserInfoResult, error)
GetUserInfo returns the current logined user info
func Login ¶
func Login(email string, password string) (*GetUserInfoResult, error)
Login LeanCloud account
func LoginTABRegion ¶ added in v0.4.0
func LoginTABRegion(token string) (*GetUserInfoResult, error)
LoginTABRegion will use qrcode to login TAB Region
type Log ¶ added in v0.3.0
type Log struct {
InstanceName string `json:"instanceName"`
Content string `json:"content"`
Type string `json:"type"`
Time string `json:"time"`
GroupName string `json:"groupName"`
Production int `json:"production"`
OID string `json:"oid"`
Level string `json:"level"`
Instance string `json:"instance"`
}
Log is EngineLogs's type structure