Documentation
¶
Index ¶
- Variables
- func AppendChatMessage(initStore *lib.InitStore) fiber.Handler
- func AppendText(initStore *lib.InitStore) fiber.Handler
- func CheckToken() fiber.Handler
- func CreatePad(initStore *lib.InitStore) fiber.Handler
- func DeletePad(initStore *lib.InitStore) fiber.Handler
- func GetAttributePool(initStore *lib.InitStore) fiber.Handler
- func GetChatHead(initStore *lib.InitStore) fiber.Handler
- func GetChatHistory(initStore *lib.InitStore) fiber.Handler
- func GetHTML(initStore *lib.InitStore) fiber.Handler
- func GetLastEdited(initStore *lib.InitStore) fiber.Handler
- func GetPadID(initStore *lib.InitStore) fiber.Handler
- func GetPadText(initStore *lib.InitStore) fiber.Handler
- func GetPadUsers(initStore *lib.InitStore) fiber.Handler
- func GetPadUsersCount(initStore *lib.InitStore) fiber.Handler
- func GetReadOnlyID(initStore *lib.InitStore) fiber.Handler
- func GetRevisionChangeset(initStore *lib.InitStore) fiber.Handler
- func GetRevisionChangesetOptional(initStore *lib.InitStore) fiber.Handler
- func GetRevisionsCount(initStore *lib.InitStore) fiber.Handler
- func GetSavedRevisionsCount(initStore *lib.InitStore) fiber.Handler
- func HandlePadOpen(c fiber.Ctx, uiAssets embed.FS, retrievedSettings *settings.Settings, ...) error
- func HandlePadQr(c fiber.Ctx, store *lib.InitStore) error
- func Init(initStore *lib.InitStore)
- func ListAllPads(initStore *lib.InitStore) fiber.Handler
- func ListAuthorsOfPad(initStore *lib.InitStore) fiber.Handler
- func ListSavedRevisions(initStore *lib.InitStore) fiber.Handler
- func RestoreRevision(initStore *lib.InitStore) fiber.Handler
- func SaveRevision(initStore *lib.InitStore) fiber.Handler
- func SetHTML(initStore *lib.InitStore) fiber.Handler
- func SetPadText(initStore *lib.InitStore) fiber.Handler
- type AllPadsResponse
- type AppendChatMessageRequest
- type AppendTextRequest
- type AttributePoolResponse
- type AuthorsResponse
- type ChangesetResponse
- type ChatHeadResponse
- type ChatHistoryResponse
- type ChatMessageResponse
- type CopyPadRequest
- type CopyPadWithoutHistoryRequest
- type CreatePadRequest
- type DiffHTMLRequest
- type DiffHTMLResponse
- type MovePadRequest
- type PadIDResponse
- type PadUser
- type PadUsersCountResponse
- type PadUsersResponse
- type PublicStatusRequest
- type PublicStatusResponse
- type ReadOnlyIDResponse
- type RestoreRevisionRequest
- type SaveRevisionRequest
- type SavedRevisionsCountResponse
- type SavedRevisionsListResponse
- type SendMessageRequest
- type SetHTMLRequest
- type SetTextRequest
- type TextResponse
Constants ¶
This section is empty.
Variables ¶
var AvailableFonts = []string{
"Quicksand",
"Roboto",
"Alegreya",
"PlayfairDisplay",
"Montserrat",
"OpenDyslexic",
"RobotoMono",
}
Functions ¶
func AppendChatMessage ¶ added in v0.0.5
AppendChatMessage godoc @Summary Append a chat message @Description Creates a chat message for the pad @Tags Chat @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body AppendChatMessageRequest true "Chat message data" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/chat [post]
func AppendText ¶ added in v0.0.5
AppendText godoc @Summary Append text to a pad @Description Appends text to the end of a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body AppendTextRequest true "Text to append and Author ID" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/appendText [post]
func CheckToken ¶ added in v0.0.5
CheckToken godoc @Summary Check API token @Description Returns ok when the current API token is valid @Tags Auth @Accept json @Produce json @Success 200 {string} string "OK" @Security BearerAuth @Router /admin/api/checkToken [get]
func CreatePad ¶ added in v0.0.5
CreatePad godoc @Summary Create a new pad @Description Creates a new pad with optional initial text @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body CreatePadRequest false "Initial text and author ID" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 409 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId} [post]
func DeletePad ¶ added in v0.0.5
DeletePad godoc @Summary Delete a pad @Description Deletes a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {string} string "OK" @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId} [delete]
func GetAttributePool ¶ added in v0.0.5
GetAttributePool godoc @Summary Get attribute pool of a pad @Description Returns the attribute pool of a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} AttributePoolResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/attributePool [get]
func GetChatHead ¶ added in v0.0.5
GetChatHead godoc @Summary Get chat head @Description Returns the chat head (last number of the last chat message) of the pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} ChatHeadResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/chatHead [get]
func GetChatHistory ¶ added in v0.0.5
GetChatHistory godoc @Summary Get chat history @Description Returns a part of or the whole chat history of this pad @Tags Chat @Accept json @Produce json @Param padId path string true "Pad ID" @Param start query int false "Start index" @Param end query int false "End index" @Success 200 {object} ChatHistoryResponse @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/chatHistory [get]
func GetHTML ¶ added in v0.0.5
GetHTML godoc @Summary Get pad HTML @Description Returns the pad content as HTML @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param rev query string false "Revision number" @Success 200 {object} map[string]string @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/html [get]
func GetLastEdited ¶ added in v0.0.5
GetLastEdited godoc @Summary Get last edited timestamp @Description Returns the timestamp of when the pad was last edited @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} map[string]int64 @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/lastEdited [get]
func GetPadID ¶ added in v0.0.5
GetPadID godoc @Summary Get pad ID from read-only ID @Description Returns the pad ID based on the read-only ID @Tags Pads @Accept json @Produce json @Param roId path string true "Read-only ID" @Success 200 {object} PadIDResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/readonly/{roId} [get]
func GetPadText ¶ added in v0.0.5
GetPadText godoc @Summary Get pad text @Description Returns the current text of a pad, optionally for a specific revision @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param rev query string false "Revision number" @Success 200 {object} TextResponse @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/text [get]
func GetPadUsers ¶ added in v0.0.5
GetPadUsers godoc @Summary Get users currently in a pad @Description Returns a list of users currently editing a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} PadUsersResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/users [get]
func GetPadUsersCount ¶ added in v0.0.5
GetPadUsersCount godoc @Summary Get count of users in a pad @Description Returns the number of users currently editing a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} PadUsersCountResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/usersCount [get]
func GetReadOnlyID ¶ added in v0.0.5
GetReadOnlyID godoc @Summary Get read-only ID @Description Returns the read-only link ID of a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} ReadOnlyIDResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/readOnlyID [get]
func GetRevisionChangeset ¶ added in v0.0.5
GetRevisionChangeset godoc @Summary Get revision changeset @Description Returns the changeset of a specific revision of a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param rev path string true "Revision number" @Success 200 {object} string @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/{rev}/revisionChangeset [get]
func GetRevisionChangesetOptional ¶ added in v0.0.5
GetRevisionChangesetOptional godoc @Summary Get revision changeset (optional rev) @Description Returns the changeset at a given revision, or last revision if rev is not provided @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param rev query string false "Revision number (optional, defaults to head)" @Success 200 {object} ChangesetResponse @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/revisionChangeset [get]
func GetRevisionsCount ¶ added in v0.0.5
GetRevisionsCount godoc @Summary Get revisions count @Description Returns the number of revisions of this pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} map[string]int @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/revisionsCount [get]
func GetSavedRevisionsCount ¶ added in v0.0.5
GetSavedRevisionsCount godoc @Summary Get saved revisions count @Description Returns the number of saved revisions of this pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} SavedRevisionsCountResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/savedRevisionsCount [get]
func HandlePadOpen ¶ added in v0.0.5
func ListAllPads ¶ added in v0.0.5
ListAllPads godoc @Summary List all pads @Description Returns a list of all pad IDs @Tags Pads @Accept json @Produce json @Success 200 {object} AllPadsResponse @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads [get]
func ListAuthorsOfPad ¶ added in v0.0.5
ListAuthorsOfPad godoc @Summary List authors of a pad @Description Returns an array of author IDs who contributed to this pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} AuthorsResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/authors [get]
func ListSavedRevisions ¶ added in v0.0.5
ListSavedRevisions godoc @Summary List saved revisions @Description Returns the list of saved revisions of this pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Success 200 {object} SavedRevisionsListResponse @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/savedRevisions [get]
func RestoreRevision ¶ added in v0.0.5
RestoreRevision godoc @Summary Restore a revision @Description Restores a revision from the past as a new changeset @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body RestoreRevisionRequest true "Revision and Author ID" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/restoreRevision [post]
func SaveRevision ¶ added in v0.0.5
SaveRevision godoc @Summary Save a revision @Description Saves the current revision of the pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body SaveRevisionRequest false "Revision number (optional, defaults to head)" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/saveRevision [post]
func SetHTML ¶ added in v0.0.5
SetHTML godoc @Summary Set pad HTML @Description Sets the text of a pad based on HTML @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body SetHTMLRequest true "HTML content and Author ID" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/html [post]
func SetPadText ¶ added in v0.0.5
SetPadText godoc @Summary Set pad text @Description Updates the text of a pad @Tags Pads @Accept json @Produce json @Param padId path string true "Pad ID" @Param request body SetTextRequest true "Text and Author ID" @Success 200 {string} string "OK" @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/pads/{padId}/text [post]
Types ¶
type AllPadsResponse ¶ added in v0.0.5
type AllPadsResponse struct {
PadIDs []string `json:"padIDs"`
}
AllPadsResponse represents the response with all pad IDs
type AppendChatMessageRequest ¶ added in v0.0.5
type AppendChatMessageRequest struct {
Text string `json:"text"`
AuthorID string `json:"authorID"`
Time int64 `json:"time"`
}
AppendChatMessageRequest represents the request to append a chat message
type AppendTextRequest ¶ added in v0.0.5
AppendTextRequest represents the request to append text
type AttributePoolResponse ¶
type AuthorsResponse ¶ added in v0.0.5
type AuthorsResponse struct {
AuthorIDs []string `json:"authorIDs"`
}
AuthorsResponse represents the response with author IDs
type ChangesetResponse ¶ added in v0.0.5
type ChangesetResponse struct {
Changeset string `json:"changeset"`
}
ChangesetResponse represents the response with a changeset
type ChatHeadResponse ¶ added in v0.0.5
type ChatHeadResponse struct {
ChatHead int `json:"chatHead"`
}
ChatHeadResponse represents the response with chat head
type ChatHistoryResponse ¶ added in v0.0.5
type ChatHistoryResponse struct {
Messages []ChatMessageResponse `json:"messages"`
}
ChatHistoryResponse represents the response with chat history
type ChatMessageResponse ¶ added in v0.0.5
type ChatMessageResponse struct {
Text string `json:"text"`
AuthorID string `json:"authorID"`
Time int64 `json:"time"`
UserName string `json:"userName"`
}
ChatMessageResponse represents a chat message in the response
type CopyPadRequest ¶ added in v0.0.5
type CopyPadRequest struct {
DestinationID string `json:"destinationID"`
Force bool `json:"force"`
}
CopyPadRequest represents the request to copy a pad
type CopyPadWithoutHistoryRequest ¶ added in v0.0.5
type CopyPadWithoutHistoryRequest struct {
DestinationID string `json:"destinationID"`
Force bool `json:"force"`
AuthorId string `json:"authorId"`
}
CopyPadWithoutHistoryRequest represents the request to copy a pad without history
type CreatePadRequest ¶ added in v0.0.5
CreatePadRequest represents the request to create a pad
type DiffHTMLRequest ¶ added in v0.0.5
DiffHTMLRequest represents the request for diff HTML
type DiffHTMLResponse ¶ added in v0.0.5
DiffHTMLResponse represents the response with diff HTML
type MovePadRequest ¶ added in v0.0.5
type MovePadRequest struct {
DestinationID string `json:"destinationID"`
Force bool `json:"force"`
}
MovePadRequest represents the request to move a pad
type PadIDResponse ¶ added in v0.0.5
type PadIDResponse struct {
PadID string `json:"padID"`
}
PadIDResponse represents the response with a pad ID
type PadUser ¶ added in v0.0.5
type PadUser struct {
ID string `json:"id"`
ColorID string `json:"colorId"`
Name string `json:"name"`
}
PadUser represents a user currently in a pad
type PadUsersCountResponse ¶ added in v0.0.5
type PadUsersCountResponse struct {
PadUsersCount int `json:"padUsersCount"`
}
PadUsersCountResponse represents the response with pad users count
type PadUsersResponse ¶ added in v0.0.5
type PadUsersResponse struct {
PadUsers []PadUser `json:"padUsers"`
}
PadUsersResponse represents the response with pad users
type PublicStatusRequest ¶ added in v0.0.5
type PublicStatusRequest struct {
PublicStatus bool `json:"publicStatus"`
}
PublicStatusRequest represents the request to set public status
type PublicStatusResponse ¶ added in v0.0.5
type PublicStatusResponse struct {
PublicStatus bool `json:"publicStatus"`
}
PublicStatusResponse represents the response with public status
type ReadOnlyIDResponse ¶ added in v0.0.5
type ReadOnlyIDResponse struct {
ReadOnlyID string `json:"readOnlyID"`
}
ReadOnlyIDResponse represents the response with a read-only ID
type RestoreRevisionRequest ¶ added in v0.0.5
RestoreRevisionRequest represents the request to restore a revision
type SaveRevisionRequest ¶ added in v0.0.5
type SaveRevisionRequest struct {
Rev int `json:"rev"`
}
SaveRevisionRequest represents the request to save a revision
type SavedRevisionsCountResponse ¶ added in v0.0.5
type SavedRevisionsCountResponse struct {
SavedRevisions int `json:"savedRevisions"`
}
SavedRevisionsCountResponse represents the response with saved revisions count
type SavedRevisionsListResponse ¶ added in v0.0.5
type SavedRevisionsListResponse struct {
SavedRevisions []int `json:"savedRevisions"`
}
SavedRevisionsListResponse represents the response with saved revisions list
type SendMessageRequest ¶ added in v0.0.5
type SendMessageRequest struct {
Msg string `json:"msg"`
}
SendMessageRequest represents the request to send a message to clients
type SetHTMLRequest ¶ added in v0.0.5
SetHTMLRequest represents the request to set HTML content
type SetTextRequest ¶ added in v0.0.5
SetTextRequest represents the request to set text
type TextResponse ¶ added in v0.0.5
type TextResponse struct {
Text string `json:"text"`
}
TextResponse represents the text response