Documentation ¶
Index ¶
- func Database(connString string) gin.HandlerFunc
- func DeletePeople(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DeleteVault(c *gin.Context)
- func GetPeople(c *gin.Context)
- func GetPeoples(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUsers(c *gin.Context)
- func GetVault(c *gin.Context)
- func GetVaults(c *gin.Context)
- func InitDb(dbName string) *gorp.DbMap
- func ParseQuery(q map[string][]string) (string, string, string)
- func PostPeople(c *gin.Context)
- func PostUser(c *gin.Context)
- func PostVault(c *gin.Context)
- func TestValidSalt(dbmap *gorp.DbMap, test string) bool
- func UpdatePeople(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UpdateVault(c *gin.Context)
- type People
- type User
- type Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Database ¶
func Database(connString string) gin.HandlerFunc
Database : gin Middlware to select database
func DeletePeople ¶
func DeleteUser ¶
func DeleteVault ¶
DeleteVault : TODO verify there's no more field with this salt before delete
func GetPeoples ¶
func InitDb ¶
func InitDb(dbName string) *gorp.DbMap
InitDb : create or update and connect to db on startup
func ParseQuery ¶
ParseQuery : Parse a http query
func PostPeople ¶
func TestValidSalt ¶
TestValidSalt : test if key is a valid salt in vaults
func UpdatePeople ¶
func UpdateUser ¶
Types ¶
type People ¶
type People struct { Id int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` XAddress string `db:"xaddress,size:65534" json:"xaddress"` XDateOfBirth string `db:"xdob" json:"xdob"` Role string `db:"role" json:"role"` Status string `db:"status" json:"status"` Created time.Time `db:"created" json:"created"` // or int64 Updated time.Time `db:"updated" json:"updated"` }
XXX custom struct name and fields
type User ¶
type User struct { Id int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` Email string `db:"email" json:"mail"` Status string `db:"status" json:"status"` Comment string `db:"comment, size:65534" json:"comment"` Pass string `db:"pass" json:"pass"` Created time.Time `db:"created" json:"created"` // or int64 Updated time.Time `db:"updated" json:"updated"` }
XXX custom struct name and fields
type Vault ¶
type Vault struct { Id int64 `db:"id" json:"id"` VaultName string `db:"vaultname" json:"vaultname"` VerifyKey string `db:"verifykey" json:"verifykey"` // TODO: // User // UserEnckey // Role (su, admin, user, reader) // Fragment (for su sss) Created time.Time `db:"created" json:"created"` // or int64 Updated time.Time `db:"updated" json:"updated"` }
Vault fields XXX custom struct name and fields
Click to show internal directories.
Click to hide internal directories.