Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version of Rikka Version = "0.8.0" // FormKeyFile is file field name when upload image FormKeyFile = "uploadFile" // FormKeyPWD is password field name when upload image FormKeyPWD = "password" // FormKeyFrom is from field name when upload image FormKeyFrom = "from" // FromWebsite is a value of FromKeyFrom, means request comes from website FromWebsite = "website" // FromAPI is a value of FromKeyFrom, means request comes from REST API FromAPI = "api" )
View Source
const ( UploadPath = "/api/upload" StatePath = "/api/state/" URLPath = "/api/url/" )
API Path
View Source
const ( StateError = "error" StateErrorCode = -1 StateFinish = "finish" StateFinishCode = 0 StateFinishDescription = "file upload task finish" StateCreate = "just created" StateCreateCode = 1 StateCreateDescription = "the task is created just now, waiting for next operate" )
Built-in state code and state str, description. Must be used in finish and error state.
Variables ¶
View Source
var ( // Upload errors ErrPwdErrMsg = "error password" InvalidFromArgErrMsg = "from argument can only be website or api" NotAImgFileErrMsg = "the file you upload is not an image" // Task errors TaskNotExistErrMsg = "task not exist" TaskAlreadyExistErrMsg = "task already exist" TaskNotFinishErrMsg = "task is not finished" )
API error messages
Functions ¶
This section is empty.
Types ¶
type State ¶
State shows a state of task.
func BuildCreateState ¶
BuildCreateState build a standard just-create state from taskID.
func BuildErrorState ¶
BuildErrorState build a standard error state from taskID and description.
func BuildFinishState ¶
BuildFinishState build a standard finished state from taskID.
Click to show internal directories.
Click to hide internal directories.