template

package
v0.11.91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionContent2Commits

func ActionContent2Commits(act Actioner) *models.PushCommits

func ActionIcon

func ActionIcon(opType int) string

ActionIcon accepts a int that represents action operation type and returns a icon class name.

func DiffLineTypeToStr

func DiffLineTypeToStr(diffType int) string

func DiffTypeToStr

func DiffTypeToStr(diffType int) string

func EscapePound

func EscapePound(str string) string

func List

func List(l *list.List) chan interface{}

func NewFuncMap

func NewFuncMap() []template.FuncMap

TODO: only initialize map once and save to a local variable to reduce copies.

func NewLine2br added in v0.11.53

func NewLine2br(raw string) string

NewLine2br simply replaces "\n" to "<br>".

func RenderCommitMessage

func RenderCommitMessage(full bool, msg, urlPrefix string, metas map[string]string) string

RenderCommitMessage renders commit message with special links.

func ReplaceLeft

func ReplaceLeft(s, old, new string) string

Replaces all prefixes 'old' in 's' with 'new'. FIXME: Unused function

func Safe

func Safe(raw string) template.HTML

func Sha1

func Sha1(str string) string

func Str2HTML added in v0.11.79

func Str2HTML(raw string) template.HTML

func ToUTF8

func ToUTF8(content string) string

FIXME: Unused function

func ToUTF8WithErr

func ToUTF8WithErr(content []byte) (error, string)

Types

type Actioner

type Actioner interface {
	GetOpType() int
	GetActUserName() string
	GetRepoUserName() string
	GetRepoName() string
	GetRepoPath() string
	GetRepoLink() string
	GetBranch() string
	GetContent() string
	GetCreate() time.Time
	GetIssueInfos() []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL