Documentation ¶
Index ¶
- func Database(connString string) gin.HandlerFunc
- func DeleteAgent(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func GetAgent(c *gin.Context)
- func GetAgents(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUsers(c *gin.Context)
- func InitDb(dbName string) *gorp.DbMap
- func ParseQuery(q map[string][]string) string
- func PostAgent(c *gin.Context)
- func PostUser(c *gin.Context)
- func UpdateAgent(c *gin.Context)
- func UpdateUser(c *gin.Context)
- type Agent
- type User
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 ParseQuery ¶
ParseQuery parse query to set select SQL query
Types ¶
type Agent ¶
type Agent struct { Id int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` IP string `db:"ip" json:"ip"` FileSurvey string `db:"filesurvey" json:"filesurvey"` 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 Agent db and json type
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:16384" 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 User db and json type
Click to show internal directories.
Click to hide internal directories.