Documentation ¶
Index ¶
- func ActiveClient(room string) (*graphql.Client, string, string, string)
- func ActiveSystemMode() string
- func AllErrorCodes() ([]string, error)
- func AllProjectImages(pid string, first, last int, before, after string) ([]types.ProjectImage, *types.PageInfo, int, error)
- func Arbitrary(query string, vars map[string]interface{}) (string, error)
- func BucketList(kind, cloud string) ([]string, error)
- func CheckDirectNetwork(url string) bool
- func CheckSystemMode(endpoint, key string) string
- func CheckSystemModeWithTimeout(endpoint, key string, timeout time.Duration) string
- func CoinsToMoney(coins float64, currency string) (float64, error)
- func CreateProject(name, projType, modelType, visibility string) (string, error)
- func CurrencyList() ([]string, error)
- func DoneImageUpload(iid string) (string, error)
- func DoneModelUpload(pid string, merge bool) (string, error)
- func Endpoints(endpoint, key string) (*types.Endpoints, error)
- func EnumValues(typeName string) ([]string, error)
- func GetSTS(pid, bucket string) (*types.STS, error)
- func GetUserTokenByCode(endpoint, appKey, phone, code string) (string, error)
- func GetUserTokenByEmail(endpoint, appKey, email, password string, fresh bool) (string, error)
- func HasImage(pid, checksum string) (bool, error)
- func HasMetaFile(pid, checksum string) (bool, error)
- func IsSales(endpoint, key, token string) bool
- func IsSuper(endpoint, key, token string) bool
- func MoneyToCoins(money float64, currency string) (float64, error)
- func MyProjects(first, last int, before, after, search string) ([]types.Project, *types.PageInfo, int, error)
- func MySelf() (string, *types.User, error)
- func MySelfByKeyToken(endpoint, key, token string) (string, *types.User, error)
- func PrettyPrint(data []byte) (string, error)
- func Project(id string) (*types.Project, error)
- func ProjectImage(pid, iid string) (*types.Image, error)
- func ProjectMetaFile(pid, mid string) (*types.MetaFile, error)
- func QueryBucket(kind, cloud, bucket string) (string, []string, error)
- func QueryCurrency(currency string) (string, []string, error)
- func QueryTaskType(taskType string) (string, []string, error)
- func RefreshSTS(pid, bucket string) func() (*types.STS, error)
- func RegisterImageMinio(pid, bucket, filename, imageType, checksum string) (*types.Image, string, error)
- func RegisterImageOSS(pid, bucket, filename, imageType, checksum string) (*types.Image, error)
- func RegisterImageS3(pid, bucket, filename, imageType, checksum string) (*types.Image, string, error)
- func RegisterImageURL(pid, url, filename, checksum string) (*types.Image, error)
- func RegisterMetaFileMinio(pid, bucket, filename string) (*types.MetaFile, string, error)
- func RegisterMetaFileS3(pid, bucket, filename string) (*types.MetaFile, string, error)
- func RegisterMetaURL(pid, url, filename, checksum string) (*types.MetaFile, error)
- func RegisterModelMinio(pid, bucket, filename string) (*types.Model, string, error)
- func RegisterModelS3(pid, bucket, filename string) (*types.Model, string, error)
- func RegisterModelURL(pid, url, filename, checksum string) (*types.ImportedModel, error)
- func RemoveProject(pid string) (*types.Project, error)
- func ReportProject(pid, desc string) error
- func RequestLoginCode(endpoint, appKey, phone string) error
- func SearchProjectID(id string, myProj bool) (*types.Project, error)
- func SetProfileFace(imgStr string) (string, error)
- func StartImageUpload(iid string) (string, error)
- func StartReconstruction(pid, taskType string) (*types.Task, error)
- func StopReconstruction(pid string) (*types.Task, error)
- func SuggestedBucket(kind, cloud string) (string, error)
- func SupportedCloud(endpoint, key, kind string) []string
- func TransferCoins(coins float64, email, message string) (string, error)
- func TransferProject(pid, email, message string) (string, error)
- func Version(endpoint, key string) (string, time.Duration)
- func WebEndpoint() string
- type AccountInfo
- type ErrorCodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveClient ¶
ActiveClient constructs the gql client for the currently active profile. Return the gql client, endpint, key and token.
func ActiveSystemMode ¶
func ActiveSystemMode() string
ActiveSystemMode checks the system mode of currently active profile.
func AllErrorCodes ¶
AllErrorCodes returns all the available error codes.
func AllProjectImages ¶
func AllProjectImages(pid string, first, last int, before, after string) ([]types.ProjectImage, *types.PageInfo, int, error)
AllProjectImages queries all of the project images by cursor.
func BucketList ¶
BucketList returns a list of available buckets supported by the api server. kind is "image", "model" or "meta". cloud is "s3", "oss" or "minio".
func CheckDirectNetwork ¶
CheckDirectNetwork tests if the api server could reach this client.
func CheckSystemMode ¶
CheckSystemMode checks if the api server is in Normal, ReadOnly or Offline mode.
func CheckSystemModeWithTimeout ¶
CheckSystemModeWithTimeout checks the api server with network timeout.
func CoinsToMoney ¶
CoinsToMoney converts coins into real currency.
func CreateProject ¶
CreateProject creates a new empty project and returns the pid of the newly created project.
func CurrencyList ¶
CurrencyList returns a list of available currency supported by the api server.
func DoneImageUpload ¶
DoneImageUpload signals the end of image uploading. Return the new image state with error.
func DoneModelUpload ¶
DoneModelUpload signals the completion of (multipart) model upload. Args merge tell if to merge the multiparts first. Return the state of the project.
func EnumValues ¶
EnumValues gets the list of enum values by type name.
func GetUserTokenByCode ¶
GetUserTokenByCode gets the self-issued by phone and one-time login code.
func GetUserTokenByEmail ¶
GetUserTokenByEmail gets the self-issued user token.
func HasMetaFile ¶
HasMetaFile asks if the project has the given meta file by hash.
func MoneyToCoins ¶
MoneyToCoins converts money into coins.
func MyProjects ¶
func MyProjects(first, last int, before, after, search string) ([]types.Project, *types.PageInfo, int, error)
MyProjects queries simple info of my first 50 projects.
func MySelfByKeyToken ¶ added in v1.1.0
MySelfByKeyToken queries simple info of a specific user.
func PrettyPrint ¶
PrettyPrint prints a raw json string into an indented colored string.
func ProjectImage ¶
ProjectImage return the info of a project image.
func ProjectMetaFile ¶
ProjectMetaFile return the info of a project meta file.
func QueryBucket ¶
QueryBucket infers the exact bucket name from query string bucket. kind is "image", "model" or "meta". cloud is "s3", "oss" or "minio".
func QueryCurrency ¶
QueryCurrency infers the exact currency name from query string currency.
func QueryTaskType ¶
QueryTaskType infers the exact task type name from query string taskType.
func RefreshSTS ¶
RefreshSTS is a HOF of GetSTS for refreshing the STS.
func RegisterImageMinio ¶
func RegisterImageMinio(pid, bucket, filename, imageType, checksum string) (*types.Image, string, error)
RegisterImageMinio registers a minio image. And get back the registered image and the signed url to minio.
func RegisterImageOSS ¶
RegisterImageOSS registers an OSS image, without getting the STS creds. Return the registered image.
func RegisterImageS3 ¶
func RegisterImageS3(pid, bucket, filename, imageType, checksum string) (*types.Image, string, error)
RegisterImageS3 registers a S3 image. And get back the registered image and the signed url to S3.
func RegisterImageURL ¶
RegisterImageURL registers an to be uploaded image by url.
func RegisterMetaFileMinio ¶
RegisterMetaFileMinio registers a Minio meta file. And get back the registered meta file and the signed url to Minio.
func RegisterMetaFileS3 ¶
RegisterMetaFileS3 registers a S3 meta file. And get back the registered meta file and the signed url to S3.
func RegisterMetaURL ¶
RegisterMetaURL registers a to be uploaded meta file by url.
func RegisterModelMinio ¶
RegisterModelMinio registers a Minio model. And get back the registered model and the signed url to Minio.
func RegisterModelS3 ¶
RegisterModelS3 registers a S3 model. And get back the registered model and the signed url to S3.
func RegisterModelURL ¶
func RegisterModelURL(pid, url, filename, checksum string) (*types.ImportedModel, error)
RegisterModelURL registers a to be uploaded model by url.
func RemoveProject ¶
RemoveProject removes a project by the given pid.
func ReportProject ¶
ReportProject reports a project with error description.
func RequestLoginCode ¶
RequestLoginCode requests an one-time login code via sms.
func SearchProjectID ¶
SearchProjectID returns the latest project id by the given partial id.
func SetProfileFace ¶ added in v1.1.1
SetProfileFace set the profile image with the given image string. Return the result of operation.
func StartImageUpload ¶
StartImageUpload signals the start of image uploading. Return the new image state with error.
func StartReconstruction ¶
StartReconstruction starts a reconstruction by project id.
func StopReconstruction ¶
StopReconstruction starts a reconstruction by project id.
func SuggestedBucket ¶
SuggestedBucket returns the nearest bucket from api server. kind is "image", "model" or "meta". cloud is "s3", "oss" or "minio".
func SupportedCloud ¶
SupportedCloud queries for the supported cloud of the given endpoint. kind is "image" or "model" or "meta".
func TransferCoins ¶
TransferCoins transfers coins from my account to other user, with a custom message.
func TransferProject ¶
TransferProject transfers project from my account to other user, with a custom message.
Types ¶
type AccountInfo ¶
type AccountInfo struct { Super bool Sales bool ImageCloud []string ModelCloud []string MetaCloud []string Version string ResponseTime time.Duration }
AccountInfo represents the account info.
func GetAccountInfo ¶
func GetAccountInfo(endpoint, key, token string) AccountInfo
GetAccountInfo gets the account info.
func GetAccountInfoTimeout ¶
func GetAccountInfoTimeout(endpoint, key, token string, timeout time.Duration) (AccountInfo, error)
GetAccountInfoTimeout gets the account info with timeout.
type ErrorCodeInfo ¶
ErrorCodeInfo represents the error code and its description and solution.
func GetErrorCodeInfo ¶
func GetErrorCodeInfo(code, lang string) (*ErrorCodeInfo, error)
GetErrorCodeInfo gets the description and solution of an error code.
Source Files ¶
- account-info.go
- all-project-images.go
- arbitrary.go
- bank.go
- bucket-list.go
- check-direct-network.go
- create-project.go
- currency-list.go
- done-image-upload.go
- done-model-upload.go
- endpoints.go
- error-code.go
- get-user-token-by-code.go
- get-user-token-by-email.go
- has-image.go
- has-meta-file.go
- helper.go
- is-sales.go
- is-super.go
- meta-file.go
- my-projects.go
- myself.go
- nearest-buckets.go
- project-image.go
- project.go
- register-image-minio.go
- register-image-oss.go
- register-image-s3.go
- register-image-url.go
- register-meta-file-minio.go
- register-meta-file-s3.go
- register-meta-url.go
- register-model-minio.go
- register-model-s3.go
- register-model-url.go
- remove-project.go
- report-project.go
- request-login-code.go
- search-project-id.go
- set-profile-face.go
- start-image-upload.go
- start-reconstruction.go
- stop-reconstruction.go
- supported-cloud.go
- system-mode.go
- task-type-list.go
- transfer-coins.go
- transfer-project.go
- version.go