This repository contain the GO API for PopCube projet
Popcube api is a simple api to manage database communication for the chat project PopCube. It contains data models and methods to manage the database. The api in itself provide basics methods we are using to manage data.
To use this project, you can just make a go get github.com/titouanfreville/popcubeapi
From source, you just have to clone the project, then run godep get
to install all the dependencies.
`/`
`/avatar`
`/avatar/:avatarID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /avatar
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:avatarID
- avatarContext
- /delete
- DELETE
`/avatar/:avatarID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /avatar
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:avatarID
- avatarContext
- /update
- PUT
`/avatar/all`
`/avatar/link/:avatarLink`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /avatar
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /link
- /:avatarLink
`/avatar/name/:avatarName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /avatar
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /name
- /:avatarName
`/avatar/new`
`/channel`
`/channel/:channelID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /channel
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:channelID
- channelContext
- /delete
- DELETE
`/channel/:channelID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /channel
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:channelID
- channelContext
- /update
- PUT
`/channel/all`
`/channel/name/:channelName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /channel
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /name
- /:channelName
`/channel/new`
`/channel/private`
`/channel/public`
`/channel/type/:channelType`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /channel
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /type
- /:channelType
`/emoji`
`/emoji/:emojiID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /emoji
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:emojiID
- emojiContext
- /delete
- DELETE
`/emoji/:emojiID/update`
`/emoji/all`
`/emoji/link/:emojiLink`
`/emoji/name/:emojiName`
`/emoji/new`
`/emoji/shortcut/:emojiShortcut`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /emoji
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /shortcut
- /:emojiShortcut
`/folder`
`/folder/:folderID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /folder
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:folderID
- folderContext
- /delete
- DELETE
`/folder/:folderID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /folder
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:folderID
- folderContext
- /update
- PUT
`/folder/all`
`/folder/link/:folderLink`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /folder
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /link
- /:folderLink
`/folder/message`
`/folder/name/:folderName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /folder
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /name
- /:folderName
`/folder/new`
`/folder/type/:folderType`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /folder
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /type
- /:folderType
`/heartbeat`
`/login`
`/message`
`/message/:messageID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /message
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:messageID
- messageContext
- /delete
- DELETE
`/message/:messageID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /message
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:messageID
- messageContext
- /update
- PUT
`/message/all`
`/message/channel`
`/message/creator`
`/message/date/:messageDate`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /message
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /date
- /:messageDate
`/message/new`
`/organisation`
`/organisation/:organisationID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /organisation
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:organisationID
- organisationContext
- /update
`/organisation/all`
`/organisation/new`
`/panic`
`/parameter`
`/parameter/:parameterID/update`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /parameter
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:parameterID
- parameterContext
- /update
- PUT
`/parameter/all`
`/parameter/new`
`/ping`
`/role`
`/role/:roleID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /role
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:roleID
- roleContext
- /delete
- DELETE
`/role/:roleID/update`
`/role/all`
`/role/name/:roleName`
`/role/new`
`/role/rights`
`/user`
`/user/:userID/delete`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /user
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /:userID
- userContext
- /delete
- DELETE
`/user/:userID/update`
`/user/all`
`/user/date`
`/user/deleted`
`/user/email/:userEmail`
`/user/firstname/:firstName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /user
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /firstname
- /:firstName
`/user/lastname/:lastName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /user
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /lastname
- /:lastName
`/user/new`
`/user/nickname/:nickName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /user
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /nickname
- /:nickName
`/user/role`
`/user/username/:userName`
- RequestID
- RealIP
- Logger
- Recoverer
- StripSlashes
- Timeout.func1
- Heartbeat.func1
- CloseNotify
- /user
- github.com/goware/jwtauth.(*JwtAuth).Verifier-fm
- Authenticator
- /username
- /:userName
- userContext
- /
- GET
- /:userName
The avatar model is used to store Avatar locations and names.
Row | Type | Parameters | Database Column | JSON Key |
---|---|---|---|---|
IDAvatar | uint64 | primary key, autoincrement | idAvatar | UNDEFINED |
Name | string | not null, unique | name | name |
Link | string | not null, unique | link | link |
IsValid is a function to check the integrity of the provided avatar before sending it to the database. It will ensure that the link is not empty as well as the name.
Usage: avatar.IsValid()
ToJSON is a function to convert the Go Avatar struct in JSON object.
Usage: avatar.ToJSON()
AvatarFromJSON is a function who will try to parse a JSON object as Go Avatar struct.
Usage: AvatarFromJSON(strings.NewReader(json))
AvatarListToJSON is a function to convert the Go Avatar struct slice in JSON object.
Usage: AvatarListToJSON(avatarList)
AvatarListFromJSON is a function who will try to parse a JSON object as Go Avatar struct slice.
Usage: AvatarListFromJSON(strings.NewReader(json))