gitea: code.gitea.io/gitea/modules/references Index | Files

package references

import "code.gitea.io/gitea/modules/references"

Index

Package Files

references.go

func FindAllMentionsMarkdown Uses

func FindAllMentionsMarkdown(content string) []string

FindAllMentionsMarkdown matches mention patterns in given content and returns a list of found unvalidated user names **not including** the @ prefix.

func IsXrefActionable Uses

func IsXrefActionable(ref *RenderizableReference, extTracker bool, alphaNum bool) bool

IsXrefActionable returns true if the xref action is actionable (i.e. produces a result when resolved)

type IssueReference Uses

type IssueReference struct {
    Index   int64
    Owner   string
    Name    string
    Action  XRefAction
    TimeLog string
}

IssueReference contains an unverified cross-reference to a local issue or pull request

func FindAllIssueReferences Uses

func FindAllIssueReferences(content string) []IssueReference

FindAllIssueReferences returns a list of unvalidated references found in a string.

func FindAllIssueReferencesMarkdown Uses

func FindAllIssueReferencesMarkdown(content string) []IssueReference

FindAllIssueReferencesMarkdown strips content from markdown markup and returns a list of unvalidated references found in it.

type RefSpan Uses

type RefSpan struct {
    Start int
    End   int
}

RefSpan is the position where the reference was found within the parsed text

func FindAllMentionsBytes Uses

func FindAllMentionsBytes(content []byte) []RefSpan

FindAllMentionsBytes matches mention patterns in given content and returns a list of locations for the unvalidated user names, including the @ prefix.

func FindFirstMentionBytes Uses

func FindFirstMentionBytes(content []byte) (bool, RefSpan)

FindFirstMentionBytes matches the first mention in then given content and returns the location of the unvalidated user name, including the @ prefix.

type RenderizableReference Uses

type RenderizableReference struct {
    Issue          string
    Owner          string
    Name           string
    IsPull         bool
    RefLocation    *RefSpan
    Action         XRefAction
    ActionLocation *RefSpan
}

RenderizableReference contains an unverified cross-reference to with rendering information The IsPull member means that a `!num` reference was used instead of `#num`. This kind of reference is used to make pulls available when an external issue tracker is used. Otherwise, `#` and `!` are completely interchangeable.

func FindRenderizableReferenceAlphanumeric Uses

func FindRenderizableReferenceAlphanumeric(content string) (bool, *RenderizableReference)

FindRenderizableReferenceAlphanumeric returns the first alphanumeric unvalidated references found in a string.

func FindRenderizableReferenceNumeric Uses

func FindRenderizableReferenceNumeric(content string, prOnly bool) (bool, *RenderizableReference)

FindRenderizableReferenceNumeric returns the first unvalidated reference found in a string.

type XRefAction Uses

type XRefAction int64

XRefAction represents the kind of effect a cross reference has once is resolved

const (
    // XRefActionNone means the cross-reference is simply a comment
    XRefActionNone XRefAction = iota // 0
    // XRefActionCloses means the cross-reference should close an issue if it is resolved
    XRefActionCloses // 1
    // XRefActionReopens means the cross-reference should reopen an issue if it is resolved
    XRefActionReopens // 2
    // XRefActionNeutered means the cross-reference will no longer affect the source
    XRefActionNeutered // 3
)

Package references imports 8 packages (graph) and is imported by 15 packages. Updated 2021-01-22. Refresh now. Tools for package owners.