template

package
v0.0.0-...-2ad639e Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionContent2Commits

func ActionContent2Commits(act Actioner) *db.PushCommits

func ActionIcon

func ActionIcon(opType int) string

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

func DiffFileTypeToStr

func DiffFileTypeToStr(typ git.DiffFileType) string

func DiffLineTypeToStr

func DiffLineTypeToStr(typ git.DiffLineType) string

func EscapePound

func EscapePound(str string) string

TODO(unknwon): Use url.Escape.

func FuncMap

func FuncMap() []template.FuncMap

FuncMap returns a list of user-defined template functions.

func NewLine2br

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 Safe

func Safe(raw string) template.HTML

func Sha1

func Sha1(str string) string

func Str2HTML

func Str2HTML(raw string) template.HTML

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