v1

package
v0.0.0-...-39e813e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFileByUserName

func DeleteFileByUserName(c *gin.Context)

DeleteFileByUserName is to "DELETE PGPFile" by username & file name

func DeletePubKey

func DeletePubKey(c *gin.Context)

DeletePubKey is to "Delete PubKey" by User's uid need session

func GetFileByUserName

func GetFileByUserName(c *gin.Context)

GetFileByUserName is to "GET PGPFile" by username & file name

func GetFilesInfoByUserName

func GetFilesInfoByUserName(c *gin.Context)

GetFilesInfoByUserName is to "GET PGPFiles' info" by username

func GetPubKey

func GetPubKey(c *gin.Context)

GetPubKey is to "Get PubKey" by User's name

func GetUsersByName

func GetUsersByName(c *gin.Context)

GetUsersByName is to "Get UserList" by Name-prefix supposed to provide session, but now needn't

func Login

func Login(c *gin.Context)

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 Logout

func Logout(c *gin.Context)

Logout is to logout need session

func Ping

func Ping(c *gin.Context)

Ping is to check Back-end & Database

func PostFileByUserName

func PostFileByUserName(c *gin.Context)

PostFileByUserName is to "POST PGPFile" by username & file name

func PostPutPubKey

func PostPutPubKey(c *gin.Context)

PostPutPubKey is to "Post PubKey" by User's uid POST & PUT is the same need session

func PutFileByUserName

func PutFileByUserName(c *gin.Context)

PutFileByUserName is to "PUT PGPFile" by username & file name

func Register

func Register(c *gin.Context)

Register is to register a new user

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 JSONUser

type JSONUser struct {
	Username string
}

JSONUser is used when GET /api/v1/user

type JSONUserList

type JSONUserList []JSONUser

JSONUserList is used when GET /api/v1/user

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

Jump to

Keyboard shortcuts

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