Documentation ¶
Index ¶
- Variables
- func FollowHandler(w http.ResponseWriter, r *http.Request)
- func GetFollowersHandler(w http.ResponseWriter, r *http.Request)
- func GetLatestHandler(w http.ResponseWriter, r *http.Request)
- func GetMessagesFromUserHandler(w http.ResponseWriter, r *http.Request)
- func MemoryCreateMessageHelper(data []byte, username string) *http.Response
- func MemoryFollowUserHelper(data []byte, username string) *http.Response
- func MemoryGetFollowUserHelper(data []byte, username string) *http.Response
- func MemoryGetLatestMessageHelper(data []byte, username string) *http.Response
- func MemoryGetLatestUserMessageHelper(data []byte, username string) *http.Response
- func MemoryLatestHelper() *http.Response
- func MemoryRegisterHelper(data []byte) *http.Response
- func MessagesHandler(w http.ResponseWriter, r *http.Request)
- func PostMessageHandler(w http.ResponseWriter, r *http.Request)
- func RegisterHandler(w http.ResponseWriter, r *http.Request)
- func SetMuxVars(request *http.Request, username string) *http.Request
Constants ¶
This section is empty.
Variables ¶
var ( Credentials = []string{"simulator", "super_safe!"} EncodedCredentials = b64.StdEncoding.EncodeToString([]byte(strings.Join(Credentials, ":"))) Authentication = "Basic " + EncodedCredentials ContentType = "Content-Type" JSONContent = "application/json" )
Functions ¶
func FollowHandler ¶
func FollowHandler(w http.ResponseWriter, r *http.Request)
FollowHandler godoc @Summary Follows a user, unfollows a user @Description follows a user, unfollows a user @Param latest query int false "Something about latest" @Accept json @Success 204 {object} interface{} @Failure 401 {string} string "unauthorized" @Failure 500 {string} string response.Error @Router /api/fllws/{username} [post]
func GetFollowersHandler ¶
func GetFollowersHandler(w http.ResponseWriter, r *http.Request)
GetFollowersHandler godoc @Summary Get followers @Description Returns a list of users followers @Param no query int false "Number of results returned" @Param latest query int false "Something about latest" @Accept json @Produce json @Success 200 {object} interface{} @Failure 401 {string} string "unauthorized" @Failure 500 {string} string response.Error @Router /api/fllws/{username} [get]
func GetLatestHandler ¶
func GetLatestHandler(w http.ResponseWriter, r *http.Request)
GetLatestHandler godoc @Summary Get the latest x @Description Get the latest x @Produce json @Success 200 {object} interface{} @Router /api/latest [get]
func GetMessagesFromUserHandler ¶
func GetMessagesFromUserHandler(w http.ResponseWriter, r *http.Request)
GetMessagesFromUserHandler godoc @Summary Gets the latest messages from a specific user @Description Gets the latest messages in descending order from a specific user. @Param username query string true "Username" @Param no query int false "Number of results returned" @Produce json @Success 200 {object} interface{} @Failure 401 {string} string "unauthorized" @Router /api/msgs/{username} [get]
func MemoryCreateMessageHelper ¶
MemoryCreateMessageHelper sends a request to create a message
func MemoryFollowUserHelper ¶
MemoryFollowUserHelper sends a request to follow a user
func MemoryGetFollowUserHelper ¶
MemoryGetFollowUserHelper sends a request to get user followers
func MemoryGetLatestMessageHelper ¶
MemoryGetLatestMessageHelper requests the latest messages
func MemoryGetLatestUserMessageHelper ¶
MemoryGetLatestUserMessageHelper requests to get the latest message from a user
func MemoryLatestHelper ¶
MemoryLatestHelper sends a request to get the latest variable
func MemoryRegisterHelper ¶
MemoryRegisterHelepr sends a register user request
func MessagesHandler ¶
func MessagesHandler(w http.ResponseWriter, r *http.Request)
MessagesHandler godoc @Summary Gets the latest messages @Description Gets the latest messages in descending order. @Param no query int false "Number of results returned" @Produce json @Success 200 {object} interface{} @Failure 401 {string} string "unauthorized" @Router /api/msgs [get]
func PostMessageHandler ¶
func PostMessageHandler(w http.ResponseWriter, r *http.Request)
PostMessageHandler godoc @Summary Create a message from user @Description Creates a message from a specific user. @Param username query string true "Username" @Produce json @Success 200 {object} interface{} @Failure 401 {string} string "unauthorized" @Router /api/msgs/{username} [post]
func RegisterHandler ¶
func RegisterHandler(w http.ResponseWriter, r *http.Request)
Messages godoc @Summary Registers a user @Description Registers a user, provided that the given info passes all checks. @Accept json @Produce json @Success 203 @Failure 400 {string} string "unauthorized" @Router /api/register [post]
Types ¶
This section is empty.