Documentation ¶
Index ¶
- func AddPageToIndexIfNotExists(pageName string) error
- func AddUserToIndex(accountId string) error
- func CheckUserInitialized(accountId string) (bool, error)
- func GetPageData(pageName string) (string, error)
- func GetPageFromShards(shards []PageShard) (string, error)
- func InitializeUser(token string, accountId string) error
- func PageDataHash(text string) string
- func PageEditToBytes(edit PageEdit) ([]byte, error)
- func PageEditsToBytes(edits []PageEdit) ([]byte, error)
- func WriteStringToPageShard(pageName string, editor string, str string, hash string, accessToken string) error
- type DropboxError
- type Index
- type Page
- type PageEdit
- type PageShard
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPageToIndexIfNotExists ¶
All this does is add page to index.
func CheckUserInitialized ¶
func GetPageData ¶
func GetPageFromShards ¶
func InitializeUser ¶
func PageDataHash ¶
func PageEditToBytes ¶
Turns one page edit into a byte array.
func PageEditsToBytes ¶
Turns page edits into data.
Types ¶
type DropboxError ¶
type DropboxError struct {
Error string `json:"error_summary"`
}
type PageEdit ¶
type PageEdit struct { PageName string `json:"page_name"` Editor string `json:"editor"` Timestamp string `json:"timestamp"` PrevHash string `json:"prev_hash"` // Diff is a crushed string generated by diff_toDelta. Diff string `json:"diff"` }
A page edit has a timestamp and associated diff
func BytesToPageEdits ¶
Turns data into list of page edits.
type PageShard ¶
A "page shard" is one editor's contribution to one page. It will have a certain number of edits.
func GetPageShards ¶
If a page exists, return the Page. Otherwise return Page{}.
Click to show internal directories.
Click to hide internal directories.