Documentation ¶
Index ¶
- func DeleteFileByUserName(c *gin.Context)
- func DeletePubKey(c *gin.Context)
- func GetFileByUserName(c *gin.Context)
- func GetFilesInfoByUserName(c *gin.Context)
- func GetPubKey(c *gin.Context)
- func GetUsersByName(c *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func Ping(c *gin.Context)
- func PostFileByUserName(c *gin.Context)
- func PostPutPubKey(c *gin.Context)
- func PutFileByUserName(c *gin.Context)
- func Register(c *gin.Context)
- type JSONDeleteFile
- type JSONGetUser
- type JSONPostPutFile
- type JSONPubKey
- type JSONStatus
- type JSONUser
- type JSONUserList
- type JSONUsernamePassword
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFileByUserName ¶
DeleteFileByUserName is to "DELETE PGPFile" by username & file name
func DeletePubKey ¶
DeletePubKey is to "Delete PubKey" by User's uid need session
func GetFileByUserName ¶
GetFileByUserName is to "GET PGPFile" by username & file name
func GetFilesInfoByUserName ¶
GetFilesInfoByUserName is to "GET PGPFiles' info" by username
func GetUsersByName ¶
GetUsersByName is to "Get UserList" by Name-prefix supposed to provide session, but now needn't
func Login ¶
Login is a function that process login 1. check username & password 2. update last login time of user 3. return result{ status lastLoginTime session }
func PostFileByUserName ¶
PostFileByUserName is to "POST PGPFile" by username & file name
func PostPutPubKey ¶
PostPutPubKey is to "Post PubKey" by User's uid POST & PUT is the same need session
func PutFileByUserName ¶
PutFileByUserName is to "PUT PGPFile" by username & file name
Types ¶
type JSONDeleteFile ¶
type JSONDeleteFile struct {
Name string `json:"name" binding:"required"`
}
JSONDeleteFile is a json for Get File
type JSONGetUser ¶
type JSONGetUser struct { Status string `json:"status" binding:"required"` UserList JSONUserList `json:"userList" binding:"required"` }
JSONGetUser is used as response when GET /api/v1/user
type JSONPostPutFile ¶
type JSONPostPutFile struct { Name string `json:"name" binding:"required"` Content string `json:"content" binding:"required"` PubKey string `json:"pubKey" binding:"required"` }
JSONPostPutFile is a json for Post / Put File
type JSONPubKey ¶
type JSONPubKey struct { PubKey string `json:"pubKey" binding:"required"` UserName string `json:"username" binding:"required"` }
JSONPubKey is used in "/api/v1/pubKey POST, PUT"
type JSONStatus ¶
type JSONStatus struct {
Status string `json:"status" binding:"required"`
}
JSONStatus is to "Get"
type JSONUsernamePassword ¶
type JSONUsernamePassword struct { Username string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` }
JSONUsernamePassword is a type for login/register api