Documentation ¶
Index ¶
- func ActionContent2Commits(act Actioner) *models.PushCommits
- func ActionIcon(opType models.ActionType) string
- func DiffLineTypeToStr(diffType int) string
- func DiffTypeToStr(diffType int) string
- func Escape(raw string) string
- func HTMLRenderer() macaron.Handler
- func IsMultilineCommitMessage(msg string) bool
- func JSONRenderer() macaron.Handler
- func List(l *list.List) chan interface{}
- func Mailer() *template.Template
- func NewFuncMap() []template.FuncMap
- func RenderCommitBody(msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessage(msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
- func ReplaceLeft(s, old, new string) string
- func Safe(raw string) template.HTML
- func SafeJS(raw string) template.JS
- func Sha1(str string) string
- func Str2html(raw string) template.HTML
- func ToUTF8(content string) string
- func ToUTF8WithErr(content []byte) (string, error)
- func ToUTF8WithFallback(content []byte) []byte
- func TrN(lang string, cnt interface{}, key1, keyN string) string
- type Actioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionContent2Commits ¶
func ActionContent2Commits(act Actioner) *models.PushCommits
ActionContent2Commits converts action content to push commits
func ActionIcon ¶
func ActionIcon(opType models.ActionType) string
ActionIcon accepts an action operation type and returns an icon class name.
func DiffLineTypeToStr ¶
DiffLineTypeToStr returns diff line type name
func HTMLRenderer ¶ added in v1.6.0
func HTMLRenderer() macaron.Handler
HTMLRenderer implements the macaron handler for serving HTML templates.
func IsMultilineCommitMessage ¶ added in v1.4.0
IsMultilineCommitMessage checks to see if a commit message contains multiple lines.
func JSONRenderer ¶ added in v1.6.0
func JSONRenderer() macaron.Handler
JSONRenderer implements the macaron handler for serving JSON templates.
func NewFuncMap ¶
NewFuncMap returns functions for injecting to templates
func RenderCommitBody ¶ added in v1.4.0
RenderCommitBody extracts the body of a commit message without its title.
func RenderCommitMessage ¶
RenderCommitMessage renders commit message with XSS-safe and special links.
func RenderCommitMessageLink ¶ added in v1.3.0
func RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
RenderCommitMessageLink renders commit message as a XXS-safe link to the provided default url, handling for special links.
func ReplaceLeft ¶
ReplaceLeft replaces all prefixes 'old' in 's' with 'new'.
func ToUTF8WithErr ¶
ToUTF8WithErr converts content to UTF8 encoding
func ToUTF8WithFallback ¶ added in v1.5.2
ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
Types ¶
type Actioner ¶
type Actioner interface { GetOpType() models.ActionType GetActUserName() string GetRepoUserName() string GetRepoName() string GetRepoPath() string GetRepoLink() string GetBranch() string GetContent() string GetCreate() time.Time GetIssueInfos() []string }
Actioner describes an action