Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Relationship ¶
type Relationship struct { Kind Kind Target multipmuri.Entity }
func (Relationship) String ¶
func (r Relationship) String() string
type Relationships ¶
type Relationships []Relationship
func ParseString ¶
func ParseString(body string) (Relationships, []error)
Example ¶
rels, errs := ParseString("Depends on github.com/moul/depviz#1") if len(errs) > 0 { panic(errs) } for _, rel := range rels { fmt.Println(rel) }
Output: depends-on https://github.com/moul/depviz/issues/1
func RelParseString ¶
func RelParseString(context multipmuri.Entity, body string) (Relationships, []error)
Example ¶
body := ` This PR fixes a lot of things and implement plenty new features. Addresses #42 Depends on: github.com/moul/depviz#42 Blocks #45 Block: #46 fixes: #58 FIX github.com/moul/depviz#1337 Signed-off-by: Super Developer <super.dev@gmail.com> ` relationships, errs := RelParseString( multipmuri.NewGitHubIssue("github.com", "moul", "depviz", "1"), body, ) if len(errs) > 0 { panic(errs) } for _, relationship := range relationships { fmt.Println(relationship) }
Output: addresses https://github.com/moul/depviz/issues/42 blocks https://github.com/moul/depviz/issues/45 blocks https://github.com/moul/depviz/issues/46 depends-on https://github.com/moul/depviz/issues/42 fixes https://github.com/moul/depviz/issues/1337 fixes https://github.com/moul/depviz/issues/58
func (Relationships) Len ¶ added in v1.2.0
func (r Relationships) Len() int
func (Relationships) Less ¶ added in v1.2.0
func (r Relationships) Less(i, j int) bool
func (Relationships) Swap ¶ added in v1.2.0
func (r Relationships) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.