Documentation
¶
Index ¶
- func ParseDescription(text string) (title, subtitle, description string)
- func ServeErrorTemplate(err error, code int, w http.ResponseWriter)
- func ServeStyleSheet(w http.ResponseWriter, r *http.Request)
- func ServeTemplate(v interface{}, p Paths, w io.Writer, name string, templ string) error
- func WriteStyleSheet(w io.Writer) error
- type BranchDetails
- type BranchList
- type Paths
- type RepoDetails
- func (repoDetails *RepoDetails) GetBranchDetails(branch string) *BranchDetails
- func (repoDetails *RepoDetails) ServeBranchTemplate(w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeBranchTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeEntryPointRedirect(w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeRepoTemplate(w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeRepoTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeReviewTemplate(w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) ServeReviewTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
- func (repoDetails *RepoDetails) Update() error
- func (repoDetails *RepoDetails) UpdateRepoDescription()
- func (repoDetails *RepoDetails) WriteBranchTemplate(branch uint64, p Paths, w io.Writer) error
- func (repoDetails *RepoDetails) WriteRepoTemplate(p Paths, w io.Writer) error
- func (repoDetails *RepoDetails) WriteReviewTemplate(reviewRev string, p Paths, w io.Writer) error
- type ReviewIndex
- func (reviewIndex *ReviewIndex) GetBranchTitle(repoDetails *RepoDetails) string
- func (reviewIndex *ReviewIndex) GetNext(repoDetails *RepoDetails) *ReviewIndex
- func (reviewIndex *ReviewIndex) GetPrevious(repoDetails *RepoDetails) *ReviewIndex
- func (reviewIndex *ReviewIndex) GetSummaries(repoDetails *RepoDetails) []review.Summary
- func (reviewIndex *ReviewIndex) GetSummary(repoDetails *RepoDetails) *review.Summary
- type ReviewType
- type ServePaths
- type StaticPaths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDescription ¶
Parses the repo description format, a markdown with optional `# Title` and `## Subtitle` at the start of the file.
func ServeErrorTemplate ¶
func ServeErrorTemplate(err error, code int, w http.ResponseWriter)
func ServeStyleSheet ¶
func ServeStyleSheet(w http.ResponseWriter, r *http.Request)
func ServeTemplate ¶
func WriteStyleSheet ¶
Types ¶
type BranchDetails ¶
type BranchList ¶
type BranchList []*BranchDetails
func (BranchList) Len ¶
func (list BranchList) Len() int
func (BranchList) Less ¶
func (list BranchList) Less(i, j int) bool
func (BranchList) Swap ¶
func (list BranchList) Swap(i, j int)
type RepoDetails ¶
type RepoDetails struct { Path string Repo repository.Repo RepoHash string Title string Subtitle string Description string Branches BranchList AbandonedReviews []review.Summary ReviewMap map[string]ReviewIndex }
func NewRepoDetails ¶
func NewRepoDetails(repo repository.Repo) (*RepoDetails, error)
NewRepoDetails constructs a RepoDetails instance from the given Repo instance.
func (*RepoDetails) GetBranchDetails ¶
func (repoDetails *RepoDetails) GetBranchDetails(branch string) *BranchDetails
GetBranchDetails constructs a concise summary of the branch.
func (*RepoDetails) ServeBranchTemplate ¶
func (repoDetails *RepoDetails) ServeBranchTemplate(w http.ResponseWriter, r *http.Request)
Shows reviews for a given branch The branch to summarize is given by the 'repo' URL parameter.
func (*RepoDetails) ServeBranchTemplateWith ¶
func (repoDetails *RepoDetails) ServeBranchTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
func (*RepoDetails) ServeEntryPointRedirect ¶
func (repoDetails *RepoDetails) ServeEntryPointRedirect(w http.ResponseWriter, r *http.Request)
ServeEntryPointRedirect writes the main redirect response to the given writer.
func (*RepoDetails) ServeRepoTemplate ¶
func (repoDetails *RepoDetails) ServeRepoTemplate(w http.ResponseWriter, r *http.Request)
Lists branches
func (*RepoDetails) ServeRepoTemplateWith ¶
func (repoDetails *RepoDetails) ServeRepoTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
func (*RepoDetails) ServeReviewTemplate ¶
func (repoDetails *RepoDetails) ServeReviewTemplate(w http.ResponseWriter, r *http.Request)
Show a review with inline diff The enclosing repository is given by the 'repo' URL parameter. The review to write is given by the 'review' URL parameter.
func (*RepoDetails) ServeReviewTemplateWith ¶
func (repoDetails *RepoDetails) ServeReviewTemplateWith(p Paths, w http.ResponseWriter, r *http.Request)
func (*RepoDetails) Update ¶
func (repoDetails *RepoDetails) Update() error
func (*RepoDetails) UpdateRepoDescription ¶
func (repoDetails *RepoDetails) UpdateRepoDescription()
func (*RepoDetails) WriteBranchTemplate ¶
func (*RepoDetails) WriteRepoTemplate ¶
func (repoDetails *RepoDetails) WriteRepoTemplate(p Paths, w io.Writer) error
func (*RepoDetails) WriteReviewTemplate ¶
type ReviewIndex ¶
type ReviewIndex struct { Type ReviewType // Index into RepoDetails.Branches[...] for Open/ClosedReview Branch int // Index into RepoDetails.{Branches[...].{OpenReviews,ClosedReviews},.AbandonedReviews} Index int }
func (*ReviewIndex) GetBranchTitle ¶
func (reviewIndex *ReviewIndex) GetBranchTitle(repoDetails *RepoDetails) string
func (*ReviewIndex) GetNext ¶
func (reviewIndex *ReviewIndex) GetNext(repoDetails *RepoDetails) *ReviewIndex
func (*ReviewIndex) GetPrevious ¶
func (reviewIndex *ReviewIndex) GetPrevious(repoDetails *RepoDetails) *ReviewIndex
func (*ReviewIndex) GetSummaries ¶
func (reviewIndex *ReviewIndex) GetSummaries(repoDetails *RepoDetails) []review.Summary
func (*ReviewIndex) GetSummary ¶
func (reviewIndex *ReviewIndex) GetSummary(repoDetails *RepoDetails) *review.Summary
type ReviewType ¶
type ReviewType int
const ( OpenReview ReviewType = iota ClosedReview AbandonedReview )
type ServePaths ¶
type ServePaths struct{}
func (ServePaths) Branch ¶
func (ServePaths) Branch(branch uint64) string
func (ServePaths) Css ¶
func (ServePaths) Css() string
func (ServePaths) Repo ¶
func (ServePaths) Repo() string
func (ServePaths) Review ¶
func (ServePaths) Review(review string) string
type StaticPaths ¶
type StaticPaths struct{}
func (StaticPaths) Branch ¶
func (StaticPaths) Branch(branch uint64) string
func (StaticPaths) Css ¶
func (StaticPaths) Css() string
func (StaticPaths) Repo ¶
func (StaticPaths) Repo() string
func (StaticPaths) Review ¶
func (StaticPaths) Review(review string) string
Click to show internal directories.
Click to hide internal directories.