diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-14 17:58:06 +0100 |
---|---|---|
committer | Sandro Santilli <strk@kbt.io> | 2016-11-14 18:01:46 +0100 |
commit | 592a4ec4d30d2713a65d9b2691e1f1082c18ee9e (patch) | |
tree | 6cdd3d89042a7528afa6356ec50ec24286716714 /models/wiki.go | |
parent | 81f227eace297269381d80b77ec0e470c5e7902d (diff) | |
download | gitea-592a4ec4d30d2713a65d9b2691e1f1082c18ee9e.tar.gz gitea-592a4ec4d30d2713a65d9b2691e1f1082c18ee9e.zip |
Fix lint errors in models/wiki (just add methods docs)
See #70
Diffstat (limited to 'models/wiki.go')
-rw-r--r-- | models/wiki.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/wiki.go b/models/wiki.go index 9e9f1b6664..b010baeb52 100644 --- a/models/wiki.go +++ b/models/wiki.go @@ -46,6 +46,7 @@ func WikiPath(userName, repoName string) string { return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".wiki.git") } +// WikiPath returns wiki data path for given repository. func (repo *Repository) WikiPath() string { return WikiPath(repo.MustOwner().Name, repo.Name) } @@ -70,6 +71,7 @@ func (repo *Repository) InitWiki() error { return nil } +// LocalWikiPath returns the path to the local wiki repository (?). func (repo *Repository) LocalWikiPath() string { return path.Join(setting.AppDataPath, "tmp/local-wiki", com.ToStr(repo.ID)) } @@ -141,14 +143,18 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes return nil } +// AddWikiPage adds a new wiki page with a given title. func (repo *Repository) AddWikiPage(doer *User, title, content, message string) error { return repo.updateWikiPage(doer, "", title, content, message, true) } +// EditWikiPage updates a wiki page identified by its title, +// optionally also changing title. func (repo *Repository) EditWikiPage(doer *User, oldTitle, title, content, message string) error { return repo.updateWikiPage(doer, oldTitle, title, content, message, false) } +// DeleteWikiPage deletes a wiki page identified by its title. func (repo *Repository) DeleteWikiPage(doer *User, title string) (err error) { wikiWorkingPool.CheckIn(com.ToStr(repo.ID)) defer wikiWorkingPool.CheckOut(com.ToStr(repo.ID)) |