Documentation ¶
Overview ¶
Example ¶
depviz42, _ := DecodeString("github.com/moul/depviz#42") fmt.Println(depviz42) // https://github.com/moul/depviz/issues/42 depviz43, _ := depviz42.RelDecodeString("#43") fmt.Println(depviz43) // https://github.com/moul/depviz/issues/43
Output: https://github.com/moul/depviz/issues/42 https://github.com/moul/depviz/issues/43
Index ¶
- type Entities
- type Entity
- type GitHubIssue
- func (e GitHubIssue) Contains(other Entity) bool
- func (e GitHubIssue) Equals(other Entity) bool
- func (e GitHubIssue) Hostname() string
- func (e GitHubIssue) ID() string
- func (e GitHubIssue) LocalID() string
- func (e GitHubIssue) Owner() *GitHubOwner
- func (e GitHubIssue) OwnerEntity() Entity
- func (e GitHubIssue) OwnerID() string
- func (e GitHubIssue) Provider() Provider
- func (e GitHubIssue) RelDecodeString(input string) (Entity, error)
- func (e GitHubIssue) Repo() *GitHubRepo
- func (e GitHubIssue) RepoEntity() Entity
- func (e GitHubIssue) RepoID() string
- func (e GitHubIssue) Service() *GitHubService
- func (e GitHubIssue) ServiceEntity() Entity
- func (e GitHubIssue) String() string
- type GitHubIssueOrPullRequest
- func (e GitHubIssueOrPullRequest) Contains(other Entity) bool
- func (e GitHubIssueOrPullRequest) Equals(other Entity) bool
- func (e GitHubIssueOrPullRequest) Hostname() string
- func (e GitHubIssueOrPullRequest) ID() string
- func (e GitHubIssueOrPullRequest) LocalID() string
- func (e GitHubIssueOrPullRequest) Owner() *GitHubOwner
- func (e GitHubIssueOrPullRequest) OwnerEntity() Entity
- func (e GitHubIssueOrPullRequest) OwnerID() string
- func (e GitHubIssueOrPullRequest) Provider() Provider
- func (e GitHubIssueOrPullRequest) RelDecodeString(input string) (Entity, error)
- func (e GitHubIssueOrPullRequest) Repo() *GitHubRepo
- func (e GitHubIssueOrPullRequest) RepoEntity() Entity
- func (e GitHubIssueOrPullRequest) RepoID() string
- func (e GitHubIssueOrPullRequest) Service() *GitHubService
- func (e GitHubIssueOrPullRequest) ServiceEntity() Entity
- func (e GitHubIssueOrPullRequest) String() string
- type GitHubLabel
- func (e GitHubLabel) Contains(other Entity) bool
- func (e GitHubLabel) Equals(other Entity) bool
- func (e GitHubLabel) Hostname() string
- func (e GitHubLabel) ID() string
- func (e GitHubLabel) LocalID() string
- func (e GitHubLabel) Owner() *GitHubOwner
- func (e GitHubLabel) OwnerEntity() Entity
- func (e GitHubLabel) OwnerID() string
- func (e GitHubLabel) Provider() Provider
- func (e GitHubLabel) RelDecodeString(input string) (Entity, error)
- func (e GitHubLabel) Repo() *GitHubRepo
- func (e GitHubLabel) RepoEntity() Entity
- func (e GitHubLabel) RepoID() string
- func (e GitHubLabel) Service() *GitHubService
- func (e GitHubLabel) ServiceEntity() Entity
- func (e GitHubLabel) String() string
- type GitHubMilestone
- func (e GitHubMilestone) Contains(other Entity) bool
- func (e GitHubMilestone) Equals(other Entity) bool
- func (e GitHubMilestone) Hostname() string
- func (e GitHubMilestone) ID() string
- func (e GitHubMilestone) LocalID() string
- func (e GitHubMilestone) Owner() *GitHubOwner
- func (e GitHubMilestone) OwnerEntity() Entity
- func (e GitHubMilestone) OwnerID() string
- func (e GitHubMilestone) Provider() Provider
- func (e GitHubMilestone) RelDecodeString(input string) (Entity, error)
- func (e GitHubMilestone) Repo() *GitHubRepo
- func (e GitHubMilestone) RepoEntity() Entity
- func (e GitHubMilestone) RepoID() string
- func (e GitHubMilestone) Service() *GitHubService
- func (e GitHubMilestone) ServiceEntity() Entity
- func (e GitHubMilestone) String() string
- type GitHubOwner
- func (e GitHubOwner) Contains(other Entity) bool
- func (e GitHubOwner) Equals(other Entity) bool
- func (e GitHubOwner) Hostname() string
- func (e GitHubOwner) LocalID() string
- func (e GitHubOwner) Owner() *GitHubOwner
- func (e GitHubOwner) OwnerEntity() Entity
- func (e GitHubOwner) OwnerID() string
- func (e GitHubOwner) Provider() Provider
- func (e GitHubOwner) RelDecodeString(input string) (Entity, error)
- func (e GitHubOwner) Repo(repoID string) *GitHubRepo
- func (e GitHubOwner) RepoEntity(repoID string) Entity
- func (e GitHubOwner) Service() *GitHubService
- func (e GitHubOwner) ServiceEntity() Entity
- func (e GitHubOwner) String() string
- type GitHubPullRequest
- func (e GitHubPullRequest) Contains(other Entity) bool
- func (e GitHubPullRequest) Equals(other Entity) bool
- func (e GitHubPullRequest) Hostname() string
- func (e GitHubPullRequest) ID() string
- func (e GitHubPullRequest) LocalID() string
- func (e GitHubPullRequest) Owner() *GitHubOwner
- func (e GitHubPullRequest) OwnerEntity() Entity
- func (e GitHubPullRequest) OwnerID() string
- func (e GitHubPullRequest) Provider() Provider
- func (e GitHubPullRequest) RelDecodeString(input string) (Entity, error)
- func (e GitHubPullRequest) Repo() *GitHubRepo
- func (e GitHubPullRequest) RepoEntity() Entity
- func (e GitHubPullRequest) RepoID() string
- func (e GitHubPullRequest) Service() *GitHubService
- func (e GitHubPullRequest) ServiceEntity() Entity
- func (e GitHubPullRequest) String() string
- type GitHubRepo
- func (e GitHubRepo) Contains(other Entity) bool
- func (e GitHubRepo) Equals(other Entity) bool
- func (e GitHubRepo) Hostname() string
- func (e GitHubRepo) Issue(id string) *GitHubIssue
- func (e GitHubRepo) IssueEntity(id string) Entity
- func (e GitHubRepo) LocalID() string
- func (e GitHubRepo) Milestone(id string) *GitHubMilestone
- func (e GitHubRepo) MilestoneEntity(id string) Entity
- func (e GitHubRepo) Owner() *GitHubOwner
- func (e GitHubRepo) OwnerEntity() Entity
- func (e GitHubRepo) OwnerID() string
- func (e GitHubRepo) Provider() Provider
- func (e GitHubRepo) RelDecodeString(input string) (Entity, error)
- func (e GitHubRepo) Repo() *GitHubRepo
- func (e GitHubRepo) RepoEntity() Entity
- func (e GitHubRepo) RepoID() string
- func (e GitHubRepo) Service() *GitHubService
- func (e GitHubRepo) ServiceEntity() Entity
- func (e GitHubRepo) String() string
- type GitHubService
- func (e GitHubService) Contains(other Entity) bool
- func (e GitHubService) Equals(other Entity) bool
- func (e GitHubService) Hostname() string
- func (e GitHubService) LocalID() string
- func (e GitHubService) Owner(ownerID string) *GitHubOwner
- func (e GitHubService) OwnerEntity(ownerID string) Entity
- func (e GitHubService) Provider() Provider
- func (e GitHubService) RelDecodeString(input string) (Entity, error)
- func (e GitHubService) Service() *GitHubService
- func (e GitHubService) ServiceEntity() Entity
- func (e GitHubService) String() string
- type GitLabIssue
- func (e GitLabIssue) Contains(other Entity) bool
- func (e GitLabIssue) Equals(other Entity) bool
- func (e GitLabIssue) Hostname() string
- func (e GitLabIssue) ID() string
- func (e GitLabIssue) LocalID() string
- func (e GitLabIssue) Owner() string
- func (e GitLabIssue) Provider() Provider
- func (e GitLabIssue) RelDecodeString(input string) (Entity, error)
- func (e GitLabIssue) Repo() string
- func (e GitLabIssue) RepoEntity() *GitLabRepo
- func (e GitLabIssue) String() string
- type GitLabMergeRequest
- func (e GitLabMergeRequest) Contains(other Entity) bool
- func (e GitLabMergeRequest) Equals(other Entity) bool
- func (e GitLabMergeRequest) Hostname() string
- func (e GitLabMergeRequest) ID() string
- func (e GitLabMergeRequest) LocalID() string
- func (e GitLabMergeRequest) Owner() string
- func (e GitLabMergeRequest) Provider() Provider
- func (e GitLabMergeRequest) RelDecodeString(input string) (Entity, error)
- func (e GitLabMergeRequest) Repo() string
- func (e GitLabMergeRequest) RepoEntity() *GitLabRepo
- func (e GitLabMergeRequest) String() string
- type GitLabMilestone
- func (e GitLabMilestone) Contains(other Entity) bool
- func (e GitLabMilestone) Equals(other Entity) bool
- func (e GitLabMilestone) Hostname() string
- func (e GitLabMilestone) ID() string
- func (e GitLabMilestone) LocalID() string
- func (e GitLabMilestone) Owner() string
- func (e GitLabMilestone) Provider() Provider
- func (e GitLabMilestone) RelDecodeString(input string) (Entity, error)
- func (e GitLabMilestone) Repo() string
- func (e GitLabMilestone) RepoEntity() *GitLabRepo
- func (e GitLabMilestone) String() string
- type GitLabOwner
- func (e GitLabOwner) Contains(other Entity) bool
- func (e GitLabOwner) Equals(other Entity) bool
- func (e GitLabOwner) Hostname() string
- func (e GitLabOwner) LocalID() string
- func (e GitLabOwner) Owner() string
- func (e GitLabOwner) Provider() Provider
- func (e GitLabOwner) RelDecodeString(input string) (Entity, error)
- func (e GitLabOwner) RepoEntity(repo string) *GitLabRepo
- func (e GitLabOwner) ServiceEntity() *GitLabService
- func (e GitLabOwner) String() string
- type GitLabOwnerOrRepo
- func (e GitLabOwnerOrRepo) Contains(other Entity) bool
- func (e GitLabOwnerOrRepo) Equals(other Entity) bool
- func (e GitLabOwnerOrRepo) Hostname() string
- func (e GitLabOwnerOrRepo) LocalID() string
- func (e GitLabOwnerOrRepo) Owner() string
- func (e GitLabOwnerOrRepo) Provider() Provider
- func (e GitLabOwnerOrRepo) RelDecodeString(input string) (Entity, error)
- func (e GitLabOwnerOrRepo) Repo() string
- func (e GitLabOwnerOrRepo) RepoEntity() *GitLabRepo
- func (e GitLabOwnerOrRepo) ServiceEntity() *GitLabService
- func (e GitLabOwnerOrRepo) String() string
- type GitLabRepo
- func (e GitLabRepo) Contains(other Entity) bool
- func (e GitLabRepo) Equals(other Entity) bool
- func (e GitLabRepo) Hostname() string
- func (e GitLabRepo) LocalID() string
- func (e GitLabRepo) Owner() string
- func (e GitLabRepo) Provider() Provider
- func (e GitLabRepo) RelDecodeString(input string) (Entity, error)
- func (e GitLabRepo) Repo() string
- func (e GitLabRepo) RepoEntity() *GitLabRepo
- func (e GitLabRepo) ServiceEntity() *GitLabService
- func (e GitLabRepo) String() string
- type GitLabService
- func (e GitLabService) Contains(other Entity) bool
- func (e GitLabService) Equals(other Entity) bool
- func (e GitLabService) Hostname() string
- func (e GitLabService) LocalID() string
- func (e GitLabService) Provider() Provider
- func (e GitLabService) RelDecodeString(input string) (Entity, error)
- func (e GitLabService) ServiceEntity() *GitLabService
- func (e GitLabService) String() string
- type Issue
- type IssueOrMergeRequest
- type Kind
- type Label
- type MergeRequest
- type Milestone
- type OrganizationOrProject
- type Project
- type Provider
- type Service
- type TrelloBoard
- func (e TrelloBoard) Contains(other Entity) bool
- func (e TrelloBoard) Equals(other Entity) bool
- func (e TrelloBoard) ID() string
- func (e TrelloBoard) LocalID() string
- func (e TrelloBoard) Provider() Provider
- func (e TrelloBoard) RelDecodeString(input string) (Entity, error)
- func (e TrelloBoard) String() string
- type TrelloCard
- func (e TrelloCard) Contains(other Entity) bool
- func (e TrelloCard) Equals(other Entity) bool
- func (e TrelloCard) ID() string
- func (e TrelloCard) LocalID() string
- func (e TrelloCard) Provider() Provider
- func (e TrelloCard) RelDecodeString(input string) (Entity, error)
- func (e TrelloCard) String() string
- type TrelloService
- type TrelloUser
- func (e TrelloUser) Contains(other Entity) bool
- func (e TrelloUser) Equals(other Entity) bool
- func (e TrelloUser) ID() string
- func (e TrelloUser) LocalID() string
- func (e TrelloUser) Provider() Provider
- func (e TrelloUser) RelDecodeString(input string) (Entity, error)
- func (e TrelloUser) String() string
- type UserOrOrganization
- type WithKind
- type WithProvider
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶ added in v1.0.0
type Entity interface { WithKind // an entity always have a kind (issue, MR, provider, service, milestone, ...) WithProvider // an entity always have a provider (GitHub, GitLab, Trello, Jira, ...) RelDecodeString(string) (Entity, error) // try to parse an URI based on relative context Equals(Entity) bool // is the same of Contains(Entity) bool // is parent of or is the same of String() string // canonical URL LocalID() string // short name }
func DecodeString ¶
Example ¶
for _, uri := range []string{ "https://github.com", "github.com", "github.com/moul", "@moul", "github.com/moul/depviz", "moul/depviz", "moul/depviz/milestone/1", "moul/depviz#1", "github.com/moul/depviz/issues/2", "github.com/moul/depviz/pull/1", "https://github.com/moul/depviz/issues/1", "https://github.com/moul/depviz#1", "github://moul/depviz#1", "github://github.com/moul/depviz#1", "github://https://github.com/moul/depviz#1", "github://ghenterprise.company.com/a/b#42", "github://https://ghenterprise.company.com", "git@github.com:moul/depviz", } { decoded, err := DecodeString(uri) if err != nil { fmt.Printf("%-42s error: %v\n", uri, err) continue } fmt.Printf("%-42s %-48s %-8s %s\n", uri, decoded.String(), decoded.Provider(), decoded.Kind()) }
Output: https://github.com https://github.com/ github service github.com https://github.com/ github service github.com/moul https://github.com/moul github user-or-organization @moul error: ambiguous uri "@moul" github.com/moul/depviz https://github.com/moul/depviz github project moul/depviz error: ambiguous uri "moul/depviz" moul/depviz/milestone/1 error: ambiguous uri "moul/depviz/milestone/1" moul/depviz#1 error: ambiguous uri "moul/depviz#1" github.com/moul/depviz/issues/2 https://github.com/moul/depviz/issues/2 github issue github.com/moul/depviz/pull/1 https://github.com/moul/depviz/issues/1 github merge-request https://github.com/moul/depviz/issues/1 https://github.com/moul/depviz/issues/1 github issue https://github.com/moul/depviz#1 https://github.com/moul/depviz/issues/1 github issue-or-merge-request github://moul/depviz#1 https://github.com/moul/depviz/issues/1 github issue-or-merge-request github://github.com/moul/depviz#1 https://github.com/moul/depviz/issues/1 github issue-or-merge-request github://https://github.com/moul/depviz#1 https://github.com/moul/depviz/issues/1 github issue-or-merge-request github://ghenterprise.company.com/a/b#42 https://ghenterprise.company.com/a/b/issues/42 github issue-or-merge-request github://https://ghenterprise.company.com https://ghenterprise.company.com/ github service git@github.com:moul/depviz https://github.com/moul/depviz github project
func NewUnknownEntity ¶ added in v1.1.0
func NewUnknownEntity() Entity
func OwnerEntity ¶ added in v1.8.0
Example ¶
entities := []Entity{ NewGitHubIssue("", "moul", "depviz", "42"), NewGitHubMilestone("", "moul", "depviz", "42"), NewGitHubRepo("", "moul", "depviz"), NewGitHubOwner("", "moul"), NewGitHubService(""), } for _, entity := range entities { fmt.Printf("%-50s -> %v\n", entity, OwnerEntity(entity)) }
Output: https://github.com/moul/depviz/issues/42 -> https://github.com/moul https://github.com/moul/depviz/milestone/42 -> https://github.com/moul https://github.com/moul/depviz -> https://github.com/moul https://github.com/moul -> https://github.com/moul https://github.com/ -> <nil>
func RepoEntity ¶ added in v1.8.0
Example ¶
entities := []Entity{ NewGitHubIssue("", "moul", "depviz", "42"), NewGitHubMilestone("", "moul", "depviz", "42"), NewGitHubRepo("", "moul", "depviz"), NewGitHubOwner("", "moul"), NewGitHubService(""), } for _, entity := range entities { fmt.Printf("%-50s -> %v\n", entity, RepoEntity(entity)) }
Output: https://github.com/moul/depviz/issues/42 -> https://github.com/moul/depviz https://github.com/moul/depviz/milestone/42 -> https://github.com/moul/depviz https://github.com/moul/depviz -> https://github.com/moul/depviz https://github.com/moul -> <nil> https://github.com/ -> <nil>
func ServiceEntity ¶ added in v1.8.0
Example ¶
entities := []Entity{ NewGitHubIssue("", "moul", "depviz", "42"), NewGitHubMilestone("", "moul", "depviz", "42"), NewGitHubRepo("", "moul", "depviz"), NewGitHubOwner("", "moul"), NewGitHubService(""), } for _, entity := range entities { fmt.Printf("%-50s -> %v\n", entity, ServiceEntity(entity)) }
Output: https://github.com/moul/depviz/issues/42 -> https://github.com/ https://github.com/moul/depviz/milestone/42 -> https://github.com/ https://github.com/moul/depviz -> https://github.com/ https://github.com/moul -> https://github.com/ https://github.com/ -> https://github.com/
type GitHubIssue ¶
type GitHubIssue struct { Issue // contains filtered or unexported fields }
func NewGitHubIssue ¶ added in v1.0.0
func NewGitHubIssue(hostname, ownerID, repoID, id string) *GitHubIssue
Example ¶
entity := NewGitHubIssue("", "moul", "depviz", "42") fmt.Println("entity") fmt.Println(" ", entity.String()) fmt.Println(" ", entity.Kind()) fmt.Println(" ", entity.Provider()) relatives := []string{ "@moul", "#4242", "moul2/depviz2#43", "moul/depviz#42", "moul/depviz", "github.com/moul2/depviz2#42", "https://github.com/moul2/depviz2#42", "https://example.com/a/b#42", "https://gitlab.com/moul/depviz/issues/42", } fmt.Println("relationships") for _, name := range relatives { attrs := "" rel, err := entity.RelDecodeString(name) if err != nil { fmt.Printf(" %-42s -> error: %v\n", name, err) continue } if rel.Equals(entity) { attrs += " (equals)" } if entity.Contains(rel) { attrs += " (contains)" } if rel.Contains(entity) { attrs += " (is contained)" } fmt.Printf(" %-42s -> %s%s\n", name, rel.String(), attrs) } fmt.Println("repo:", entity.RepoEntity().String()) fmt.Println("owner:", entity.OwnerEntity().String()) fmt.Println("complex relationship:", entity.Owner(). Service(). Owner("test1"). Repo("test2"). Issue("42"). Repo(). Service(). Owner("test3"). Repo("test4"). Milestone("42"). String())
Output: entity https://github.com/moul/depviz/issues/42 issue github relationships @moul -> https://github.com/moul (is contained) #4242 -> https://github.com/moul/depviz/issues/4242 moul2/depviz2#43 -> https://github.com/moul2/depviz2/issues/43 moul/depviz#42 -> https://github.com/moul/depviz/issues/42 (equals) moul/depviz -> https://github.com/moul/depviz (is contained) github.com/moul2/depviz2#42 -> https://github.com/moul2/depviz2/issues/42 https://github.com/moul2/depviz2#42 -> https://github.com/moul2/depviz2/issues/42 https://example.com/a/b#42 -> error: ambiguous uri "https://example.com/a/b#42" https://gitlab.com/moul/depviz/issues/42 -> https://gitlab.com/moul/depviz/issues/42 repo: https://github.com/moul/depviz owner: https://github.com/moul complex relationship: https://github.com/test3/test4/milestone/42
func (GitHubIssue) Contains ¶ added in v1.5.0
func (e GitHubIssue) Contains(other Entity) bool
func (GitHubIssue) Equals ¶ added in v1.5.0
func (e GitHubIssue) Equals(other Entity) bool
func (GitHubIssue) LocalID ¶ added in v1.10.0
func (e GitHubIssue) LocalID() string
func (GitHubIssue) Owner ¶
func (e GitHubIssue) Owner() *GitHubOwner
func (GitHubIssue) OwnerEntity ¶ added in v1.2.0
func (e GitHubIssue) OwnerEntity() Entity
func (GitHubIssue) RelDecodeString ¶
func (e GitHubIssue) RelDecodeString(input string) (Entity, error)
func (GitHubIssue) Repo ¶
func (e GitHubIssue) Repo() *GitHubRepo
func (GitHubIssue) RepoEntity ¶ added in v1.2.0
func (e GitHubIssue) RepoEntity() Entity
func (GitHubIssue) Service ¶ added in v1.7.0
func (e GitHubIssue) Service() *GitHubService
func (GitHubIssue) ServiceEntity ¶ added in v1.2.0
func (e GitHubIssue) ServiceEntity() Entity
func (GitHubIssue) String ¶ added in v1.5.0
func (e GitHubIssue) String() string
type GitHubIssueOrPullRequest ¶
type GitHubIssueOrPullRequest struct { IssueOrMergeRequest // contains filtered or unexported fields }
func NewGitHubIssueOrPullRequest ¶ added in v1.0.0
func NewGitHubIssueOrPullRequest(hostname, ownerID, repoID, id string) *GitHubIssueOrPullRequest
func (GitHubIssueOrPullRequest) Contains ¶ added in v1.5.0
func (e GitHubIssueOrPullRequest) Contains(other Entity) bool
func (GitHubIssueOrPullRequest) Equals ¶ added in v1.5.0
func (e GitHubIssueOrPullRequest) Equals(other Entity) bool
func (GitHubIssueOrPullRequest) Hostname ¶ added in v1.0.0
func (e GitHubIssueOrPullRequest) Hostname() string
func (GitHubIssueOrPullRequest) LocalID ¶ added in v1.10.0
func (e GitHubIssueOrPullRequest) LocalID() string
func (GitHubIssueOrPullRequest) Owner ¶
func (e GitHubIssueOrPullRequest) Owner() *GitHubOwner
func (GitHubIssueOrPullRequest) OwnerEntity ¶ added in v1.2.0
func (e GitHubIssueOrPullRequest) OwnerEntity() Entity
func (GitHubIssueOrPullRequest) OwnerID ¶ added in v1.7.0
func (e GitHubIssueOrPullRequest) OwnerID() string
func (GitHubIssueOrPullRequest) RelDecodeString ¶
func (e GitHubIssueOrPullRequest) RelDecodeString(input string) (Entity, error)
func (GitHubIssueOrPullRequest) Repo ¶
func (e GitHubIssueOrPullRequest) Repo() *GitHubRepo
func (GitHubIssueOrPullRequest) RepoEntity ¶ added in v1.2.0
func (e GitHubIssueOrPullRequest) RepoEntity() Entity
func (GitHubIssueOrPullRequest) RepoID ¶ added in v1.7.0
func (e GitHubIssueOrPullRequest) RepoID() string
func (GitHubIssueOrPullRequest) Service ¶ added in v1.7.0
func (e GitHubIssueOrPullRequest) Service() *GitHubService
func (GitHubIssueOrPullRequest) ServiceEntity ¶ added in v1.2.0
func (e GitHubIssueOrPullRequest) ServiceEntity() Entity
func (GitHubIssueOrPullRequest) String ¶ added in v1.5.0
func (e GitHubIssueOrPullRequest) String() string
type GitHubLabel ¶ added in v1.11.0
type GitHubLabel struct { Label // contains filtered or unexported fields }
func NewGitHubLabel ¶ added in v1.11.0
func NewGitHubLabel(hostname, ownerID, repoID, id string) *GitHubLabel
func (GitHubLabel) Contains ¶ added in v1.11.0
func (e GitHubLabel) Contains(other Entity) bool
func (GitHubLabel) Equals ¶ added in v1.11.0
func (e GitHubLabel) Equals(other Entity) bool
func (GitHubLabel) LocalID ¶ added in v1.11.0
func (e GitHubLabel) LocalID() string
func (GitHubLabel) Owner ¶ added in v1.11.0
func (e GitHubLabel) Owner() *GitHubOwner
func (GitHubLabel) OwnerEntity ¶ added in v1.11.0
func (e GitHubLabel) OwnerEntity() Entity
func (GitHubLabel) RelDecodeString ¶ added in v1.11.0
func (e GitHubLabel) RelDecodeString(input string) (Entity, error)
func (GitHubLabel) Repo ¶ added in v1.11.0
func (e GitHubLabel) Repo() *GitHubRepo
func (GitHubLabel) RepoEntity ¶ added in v1.11.0
func (e GitHubLabel) RepoEntity() Entity
func (GitHubLabel) Service ¶ added in v1.11.0
func (e GitHubLabel) Service() *GitHubService
func (GitHubLabel) ServiceEntity ¶ added in v1.11.0
func (e GitHubLabel) ServiceEntity() Entity
func (GitHubLabel) String ¶ added in v1.11.0
func (e GitHubLabel) String() string
type GitHubMilestone ¶
type GitHubMilestone struct { Milestone // contains filtered or unexported fields }
func NewGitHubMilestone ¶ added in v1.0.0
func NewGitHubMilestone(hostname, ownerID, repoID, id string) *GitHubMilestone
func (GitHubMilestone) Contains ¶ added in v1.5.0
func (e GitHubMilestone) Contains(other Entity) bool
func (GitHubMilestone) Equals ¶ added in v1.5.0
func (e GitHubMilestone) Equals(other Entity) bool
func (GitHubMilestone) LocalID ¶ added in v1.10.0
func (e GitHubMilestone) LocalID() string
func (GitHubMilestone) Owner ¶
func (e GitHubMilestone) Owner() *GitHubOwner
func (GitHubMilestone) OwnerEntity ¶ added in v1.2.0
func (e GitHubMilestone) OwnerEntity() Entity
func (GitHubMilestone) RelDecodeString ¶
func (e GitHubMilestone) RelDecodeString(input string) (Entity, error)
func (GitHubMilestone) Repo ¶
func (e GitHubMilestone) Repo() *GitHubRepo
func (GitHubMilestone) RepoEntity ¶ added in v1.2.0
func (e GitHubMilestone) RepoEntity() Entity
func (GitHubMilestone) Service ¶ added in v1.7.0
func (e GitHubMilestone) Service() *GitHubService
func (GitHubMilestone) ServiceEntity ¶ added in v1.2.0
func (e GitHubMilestone) ServiceEntity() Entity
func (GitHubMilestone) String ¶ added in v1.5.0
func (e GitHubMilestone) String() string
type GitHubOwner ¶ added in v1.2.0
type GitHubOwner struct { UserOrOrganization // contains filtered or unexported fields }
func NewGitHubOwner ¶ added in v1.2.0
func NewGitHubOwner(hostname, ownerID string) *GitHubOwner
func (GitHubOwner) Contains ¶ added in v1.5.0
func (e GitHubOwner) Contains(other Entity) bool
func (GitHubOwner) Equals ¶ added in v1.5.0
func (e GitHubOwner) Equals(other Entity) bool
func (GitHubOwner) LocalID ¶ added in v1.10.0
func (e GitHubOwner) LocalID() string
func (GitHubOwner) Owner ¶ added in v1.2.0
func (e GitHubOwner) Owner() *GitHubOwner
func (GitHubOwner) OwnerEntity ¶ added in v1.7.0
func (e GitHubOwner) OwnerEntity() Entity
func (GitHubOwner) RelDecodeString ¶ added in v1.2.0
func (e GitHubOwner) RelDecodeString(input string) (Entity, error)
func (GitHubOwner) Repo ¶ added in v1.7.0
func (e GitHubOwner) Repo(repoID string) *GitHubRepo
func (GitHubOwner) RepoEntity ¶ added in v1.2.0
func (GitHubOwner) Service ¶ added in v1.7.0
func (e GitHubOwner) Service() *GitHubService
func (GitHubOwner) ServiceEntity ¶ added in v1.2.0
func (e GitHubOwner) ServiceEntity() Entity
func (GitHubOwner) String ¶ added in v1.5.0
func (e GitHubOwner) String() string
type GitHubPullRequest ¶
type GitHubPullRequest struct { MergeRequest // contains filtered or unexported fields }
func NewGitHubPullRequest ¶ added in v1.0.0
func NewGitHubPullRequest(hostname, ownerID, repoID, id string) *GitHubPullRequest
func (GitHubPullRequest) Contains ¶ added in v1.5.0
func (e GitHubPullRequest) Contains(other Entity) bool
func (GitHubPullRequest) Equals ¶ added in v1.5.0
func (e GitHubPullRequest) Equals(other Entity) bool
func (GitHubPullRequest) LocalID ¶ added in v1.10.0
func (e GitHubPullRequest) LocalID() string
func (GitHubPullRequest) Owner ¶
func (e GitHubPullRequest) Owner() *GitHubOwner
func (GitHubPullRequest) OwnerEntity ¶ added in v1.2.0
func (e GitHubPullRequest) OwnerEntity() Entity
func (GitHubPullRequest) RelDecodeString ¶
func (e GitHubPullRequest) RelDecodeString(input string) (Entity, error)
func (GitHubPullRequest) Repo ¶
func (e GitHubPullRequest) Repo() *GitHubRepo
func (GitHubPullRequest) RepoEntity ¶ added in v1.2.0
func (e GitHubPullRequest) RepoEntity() Entity
func (GitHubPullRequest) Service ¶ added in v1.7.0
func (e GitHubPullRequest) Service() *GitHubService
func (GitHubPullRequest) ServiceEntity ¶ added in v1.2.0
func (e GitHubPullRequest) ServiceEntity() Entity
func (GitHubPullRequest) String ¶ added in v1.5.0
func (e GitHubPullRequest) String() string
type GitHubRepo ¶
type GitHubRepo struct { Project // contains filtered or unexported fields }
func NewGitHubRepo ¶ added in v1.0.0
func NewGitHubRepo(hostname, ownerID, repoID string) *GitHubRepo
func (GitHubRepo) Contains ¶ added in v1.5.0
func (e GitHubRepo) Contains(other Entity) bool
func (GitHubRepo) Equals ¶ added in v1.5.0
func (e GitHubRepo) Equals(other Entity) bool
func (GitHubRepo) Issue ¶ added in v1.7.0
func (e GitHubRepo) Issue(id string) *GitHubIssue
func (GitHubRepo) IssueEntity ¶ added in v1.2.0
func (GitHubRepo) LocalID ¶ added in v1.10.0
func (e GitHubRepo) LocalID() string
func (GitHubRepo) Milestone ¶ added in v1.7.0
func (e GitHubRepo) Milestone(id string) *GitHubMilestone
func (GitHubRepo) MilestoneEntity ¶ added in v1.2.0
func (GitHubRepo) Owner ¶
func (e GitHubRepo) Owner() *GitHubOwner
func (GitHubRepo) OwnerEntity ¶ added in v1.2.0
func (e GitHubRepo) OwnerEntity() Entity
func (GitHubRepo) RelDecodeString ¶
func (e GitHubRepo) RelDecodeString(input string) (Entity, error)
func (GitHubRepo) Repo ¶
func (e GitHubRepo) Repo() *GitHubRepo
func (GitHubRepo) RepoEntity ¶ added in v1.4.0
func (e GitHubRepo) RepoEntity() Entity
func (GitHubRepo) Service ¶ added in v1.7.0
func (e GitHubRepo) Service() *GitHubService
func (GitHubRepo) ServiceEntity ¶ added in v1.2.0
func (e GitHubRepo) ServiceEntity() Entity
func (GitHubRepo) String ¶ added in v1.5.0
func (e GitHubRepo) String() string
type GitHubService ¶
type GitHubService struct { Service // contains filtered or unexported fields }
func NewGitHubService ¶ added in v1.0.0
func NewGitHubService(hostname string) *GitHubService
Example ¶
entity := NewGitHubService("github.com") fmt.Println("entity") fmt.Println(" ", entity.String()) fmt.Println(" ", entity.Kind()) fmt.Println(" ", entity.Provider()) relatives := []string{ "https://github.com", "github.com", "github.com/moul", "@moul", "github.com/moul/depviz", "moul/depviz", "moul/depviz/labels/bug", "moul/depviz/labels/a/b/c", "moul/depviz/milestone/1", "moul/depviz#1", "github.com/moul/depviz/issues/2", "github.com/moul/depviz/pull/1", "https://github.com/moul/depviz/issues/1", "https://github.com/moul/depviz#1", "github://moul/depviz#1", "github://github.com/moul/depviz#1", "github://https://github.com/moul/depviz#1", } fmt.Println("relationships") for _, name := range relatives { rel, err := entity.RelDecodeString(name) if err != nil { fmt.Printf(" %-42s -> error: %v\n", name, err) continue } fmt.Printf(" %-42s -> %-43s %s\n", name, rel.String(), rel.Kind()) }
Output: entity https://github.com/ service github relationships https://github.com -> https://github.com/ service github.com -> https://github.com/ service github.com/moul -> https://github.com/moul user-or-organization @moul -> https://github.com/moul user-or-organization github.com/moul/depviz -> https://github.com/moul/depviz project moul/depviz -> https://github.com/moul/depviz project moul/depviz/labels/bug -> https://github.com/moul/depviz/labels/bug label moul/depviz/labels/a/b/c -> https://github.com/moul/depviz/labels/a/b/c label moul/depviz/milestone/1 -> https://github.com/moul/depviz/milestone/1 milestone moul/depviz#1 -> https://github.com/moul/depviz/issues/1 issue-or-merge-request github.com/moul/depviz/issues/2 -> https://github.com/moul/depviz/issues/2 issue github.com/moul/depviz/pull/1 -> https://github.com/moul/depviz/issues/1 merge-request https://github.com/moul/depviz/issues/1 -> https://github.com/moul/depviz/issues/1 issue https://github.com/moul/depviz#1 -> https://github.com/moul/depviz/issues/1 issue-or-merge-request github://moul/depviz#1 -> https://github.com/moul/depviz/issues/1 issue-or-merge-request github://github.com/moul/depviz#1 -> https://github.com/moul/depviz/issues/1 issue-or-merge-request github://https://github.com/moul/depviz#1 -> https://github.com/moul/depviz/issues/1 issue-or-merge-request
func (GitHubService) Contains ¶ added in v1.5.0
func (e GitHubService) Contains(other Entity) bool
func (GitHubService) Equals ¶ added in v1.5.0
func (e GitHubService) Equals(other Entity) bool
func (GitHubService) LocalID ¶ added in v1.10.0
func (e GitHubService) LocalID() string
func (GitHubService) Owner ¶ added in v1.7.0
func (e GitHubService) Owner(ownerID string) *GitHubOwner
func (GitHubService) OwnerEntity ¶ added in v1.2.0
func (GitHubService) RelDecodeString ¶
func (e GitHubService) RelDecodeString(input string) (Entity, error)
func (GitHubService) Service ¶ added in v1.7.0
func (e GitHubService) Service() *GitHubService
func (GitHubService) ServiceEntity ¶ added in v1.7.0
func (e GitHubService) ServiceEntity() Entity
func (GitHubService) String ¶ added in v1.5.0
func (e GitHubService) String() string
type GitLabIssue ¶ added in v1.0.0
type GitLabIssue struct { Issue // contains filtered or unexported fields }
func NewGitLabIssue ¶ added in v1.0.0
func NewGitLabIssue(hostname, owner, repo, id string) *GitLabIssue
Example ¶
entity := NewGitLabIssue("", "moul", "depviz", "42") fmt.Println("entity") fmt.Println(" ", entity.String()) fmt.Println(" ", entity.Kind()) fmt.Println(" ", entity.Provider()) relatives := []string{ "@moul", "#4242", "moul2/depviz2#43", "gitlab.com/moul2/depviz2#42", "https://gitlab.com/moul2/depviz2#42", "https://example.com/a/b#42", "https://gitlab.com/moul/depviz/issues/42", } fmt.Println("relationships") for _, name := range relatives { rel, err := entity.RelDecodeString(name) if err != nil { fmt.Printf(" %-42s -> error: %v\n", name, err) continue } fmt.Printf(" %-42s -> %s\n", name, rel.String()) } fmt.Println("repo:", entity.RepoEntity().String())
Output: entity https://gitlab.com/moul/depviz/issues/42 issue gitlab relationships @moul -> https://gitlab.com/moul #4242 -> https://gitlab.com/moul/depviz/issues/4242 moul2/depviz2#43 -> https://gitlab.com/moul2/depviz2/issues/43 gitlab.com/moul2/depviz2#42 -> https://gitlab.com/moul2/depviz2/issues/42 https://gitlab.com/moul2/depviz2#42 -> https://gitlab.com/moul2/depviz2/issues/42 https://example.com/a/b#42 -> error: ambiguous uri "https://example.com/a/b#42" https://gitlab.com/moul/depviz/issues/42 -> https://gitlab.com/moul/depviz/issues/42 repo: https://gitlab.com/moul/depviz
func (GitLabIssue) Contains ¶ added in v1.5.0
func (e GitLabIssue) Contains(other Entity) bool
func (GitLabIssue) Equals ¶ added in v1.5.0
func (e GitLabIssue) Equals(other Entity) bool
func (GitLabIssue) LocalID ¶ added in v1.10.0
func (e GitLabIssue) LocalID() string
func (GitLabIssue) RelDecodeString ¶ added in v1.0.0
func (e GitLabIssue) RelDecodeString(input string) (Entity, error)
func (GitLabIssue) RepoEntity ¶ added in v1.3.0
func (e GitLabIssue) RepoEntity() *GitLabRepo
func (GitLabIssue) String ¶ added in v1.5.0
func (e GitLabIssue) String() string
type GitLabMergeRequest ¶ added in v1.0.0
type GitLabMergeRequest struct { MergeRequest // contains filtered or unexported fields }
func NewGitLabMergeRequest ¶ added in v1.0.0
func NewGitLabMergeRequest(hostname, owner, repo, id string) *GitLabMergeRequest
func (GitLabMergeRequest) Contains ¶ added in v1.5.0
func (e GitLabMergeRequest) Contains(other Entity) bool
func (GitLabMergeRequest) Equals ¶ added in v1.5.0
func (e GitLabMergeRequest) Equals(other Entity) bool
func (GitLabMergeRequest) LocalID ¶ added in v1.10.0
func (e GitLabMergeRequest) LocalID() string
func (GitLabMergeRequest) Provider ¶ added in v1.0.0
func (e GitLabMergeRequest) Provider() Provider
func (GitLabMergeRequest) RelDecodeString ¶ added in v1.0.0
func (e GitLabMergeRequest) RelDecodeString(input string) (Entity, error)
func (GitLabMergeRequest) RepoEntity ¶ added in v1.3.0
func (e GitLabMergeRequest) RepoEntity() *GitLabRepo
func (GitLabMergeRequest) String ¶ added in v1.5.0
func (e GitLabMergeRequest) String() string
type GitLabMilestone ¶ added in v1.0.0
type GitLabMilestone struct { Milestone // contains filtered or unexported fields }
func NewGitLabMilestone ¶ added in v1.0.0
func NewGitLabMilestone(hostname, owner, repo, id string) *GitLabMilestone
func (GitLabMilestone) Contains ¶ added in v1.5.0
func (e GitLabMilestone) Contains(other Entity) bool
func (GitLabMilestone) Equals ¶ added in v1.5.0
func (e GitLabMilestone) Equals(other Entity) bool
func (GitLabMilestone) LocalID ¶ added in v1.10.0
func (e GitLabMilestone) LocalID() string
func (GitLabMilestone) RelDecodeString ¶ added in v1.0.0
func (e GitLabMilestone) RelDecodeString(input string) (Entity, error)
func (GitLabMilestone) RepoEntity ¶ added in v1.3.0
func (e GitLabMilestone) RepoEntity() *GitLabRepo
func (GitLabMilestone) String ¶ added in v1.5.0
func (e GitLabMilestone) String() string
type GitLabOwner ¶ added in v1.5.0
type GitLabOwner struct { UserOrOrganization // contains filtered or unexported fields }
func NewGitLabOwner ¶ added in v1.5.0
func NewGitLabOwner(hostname, owner string) *GitLabOwner
func (GitLabOwner) Contains ¶ added in v1.5.0
func (e GitLabOwner) Contains(other Entity) bool
func (GitLabOwner) Equals ¶ added in v1.5.0
func (e GitLabOwner) Equals(other Entity) bool
func (GitLabOwner) LocalID ¶ added in v1.10.0
func (e GitLabOwner) LocalID() string
func (GitLabOwner) RelDecodeString ¶ added in v1.5.0
func (e GitLabOwner) RelDecodeString(input string) (Entity, error)
func (GitLabOwner) RepoEntity ¶ added in v1.5.0
func (e GitLabOwner) RepoEntity(repo string) *GitLabRepo
func (GitLabOwner) ServiceEntity ¶ added in v1.5.0
func (e GitLabOwner) ServiceEntity() *GitLabService
func (GitLabOwner) String ¶ added in v1.5.0
func (e GitLabOwner) String() string
type GitLabOwnerOrRepo ¶ added in v1.5.0
type GitLabOwnerOrRepo struct { OrganizationOrProject // contains filtered or unexported fields }
func NewGitLabOwnerOrRepo ¶ added in v1.5.0
func NewGitLabOwnerOrRepo(hostname, owner, repo string) *GitLabOwnerOrRepo
func (GitLabOwnerOrRepo) Contains ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) Contains(other Entity) bool
func (GitLabOwnerOrRepo) Equals ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) Equals(other Entity) bool
func (GitLabOwnerOrRepo) LocalID ¶ added in v1.10.0
func (e GitLabOwnerOrRepo) LocalID() string
func (GitLabOwnerOrRepo) RelDecodeString ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) RelDecodeString(input string) (Entity, error)
func (GitLabOwnerOrRepo) RepoEntity ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) RepoEntity() *GitLabRepo
func (GitLabOwnerOrRepo) ServiceEntity ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) ServiceEntity() *GitLabService
func (GitLabOwnerOrRepo) String ¶ added in v1.5.0
func (e GitLabOwnerOrRepo) String() string
type GitLabRepo ¶ added in v1.0.0
type GitLabRepo struct { Project // contains filtered or unexported fields }
func NewGitLabRepo ¶ added in v1.0.0
func NewGitLabRepo(hostname, owner, repo string) *GitLabRepo
func (GitLabRepo) Contains ¶ added in v1.5.0
func (e GitLabRepo) Contains(other Entity) bool
func (GitLabRepo) Equals ¶ added in v1.5.0
func (e GitLabRepo) Equals(other Entity) bool
func (GitLabRepo) LocalID ¶ added in v1.10.0
func (e GitLabRepo) LocalID() string
func (GitLabRepo) RelDecodeString ¶ added in v1.0.0
func (e GitLabRepo) RelDecodeString(input string) (Entity, error)
func (GitLabRepo) RepoEntity ¶ added in v1.3.0
func (e GitLabRepo) RepoEntity() *GitLabRepo
func (GitLabRepo) ServiceEntity ¶ added in v1.3.0
func (e GitLabRepo) ServiceEntity() *GitLabService
func (GitLabRepo) String ¶ added in v1.5.0
func (e GitLabRepo) String() string
type GitLabService ¶ added in v1.0.0
type GitLabService struct { Service // contains filtered or unexported fields }
func NewGitLabService ¶ added in v1.0.0
func NewGitLabService(hostname string) *GitLabService
Example ¶
entity := NewGitLabService("gitlab.com") fmt.Println("entity") fmt.Println(" ", entity.String()) fmt.Println(" ", entity.Kind()) fmt.Println(" ", entity.Provider()) relatives := []string{ "https://gitlab.com", "gitlab.com", "gitlab.com/moul", "@moul", "gitlab.com/moul/depviz", "moul/depviz", "moul/depviz/-/milestones/1", "moul/depviz#1", "gitlab.com/moul/depviz/issues/2", "gitlab.com/moul/depviz/merge_requests/1", "https://gitlab.com/moul/depviz/issues/1", "https://gitlab.com/moul/depviz#1", "gitlab://moul/depviz#1", "gitlab://gitlab.com/moul/depviz#1", "gitlab://https://gitlab.com/moul/depviz#1", "gitlab.com/a/b/c/d/e/f", "gitlab.com/a/b/c/d/e/f#1", "gitlab.com/a/b/c/d/e/f!1", "a/b/c/d/e/f!1", "a/b/c/d/e/f#1", "a/b#1", "a/b!1", } fmt.Println("relationships") for _, name := range relatives { rel, err := entity.RelDecodeString(name) if err != nil { fmt.Printf(" %-42s -> error: %v\n", name, err) continue } fmt.Printf(" %-42s -> %-48s %s\n", name, rel.String(), rel.Kind()) }
Output: entity https://gitlab.com/ service gitlab relationships https://gitlab.com -> https://gitlab.com/ service gitlab.com -> https://gitlab.com/ service gitlab.com/moul -> https://gitlab.com/moul user-or-organization @moul -> https://gitlab.com/moul user-or-organization gitlab.com/moul/depviz -> https://gitlab.com/moul/depviz organization-or-project moul/depviz -> https://gitlab.com/moul/depviz organization-or-project moul/depviz/-/milestones/1 -> https://gitlab.com/moul/depviz/-/milestones/1 milestone moul/depviz#1 -> https://gitlab.com/moul/depviz/issues/1 issue gitlab.com/moul/depviz/issues/2 -> https://gitlab.com/moul/depviz/issues/2 issue gitlab.com/moul/depviz/merge_requests/1 -> https://gitlab.com/moul/depviz/merge_requests/1 merge-request https://gitlab.com/moul/depviz/issues/1 -> https://gitlab.com/moul/depviz/issues/1 issue https://gitlab.com/moul/depviz#1 -> https://gitlab.com/moul/depviz/issues/1 issue gitlab://moul/depviz#1 -> https://gitlab.com/moul/depviz/issues/1 issue gitlab://gitlab.com/moul/depviz#1 -> https://gitlab.com/moul/depviz/issues/1 issue gitlab://https://gitlab.com/moul/depviz#1 -> https://gitlab.com/moul/depviz/issues/1 issue gitlab.com/a/b/c/d/e/f -> https://gitlab.com/a/b/c/d/e/f project gitlab.com/a/b/c/d/e/f#1 -> https://gitlab.com/a/b/c/d/e/f/issues/1 issue gitlab.com/a/b/c/d/e/f!1 -> https://gitlab.com/a/b/c/d/e/f/merge_requests/1 merge-request a/b/c/d/e/f!1 -> https://gitlab.com/a/b/c/d/e/f/merge_requests/1 merge-request a/b/c/d/e/f#1 -> https://gitlab.com/a/b/c/d/e/f/issues/1 issue a/b#1 -> https://gitlab.com/a/b/issues/1 issue a/b!1 -> https://gitlab.com/a/b/merge_requests/1 merge-request
func (GitLabService) Contains ¶ added in v1.5.0
func (e GitLabService) Contains(other Entity) bool
func (GitLabService) Equals ¶ added in v1.5.0
func (e GitLabService) Equals(other Entity) bool
func (GitLabService) LocalID ¶ added in v1.10.0
func (e GitLabService) LocalID() string
func (GitLabService) RelDecodeString ¶ added in v1.0.0
func (e GitLabService) RelDecodeString(input string) (Entity, error)
func (GitLabService) ServiceEntity ¶ added in v1.3.0
func (e GitLabService) ServiceEntity() *GitLabService
func (GitLabService) String ¶ added in v1.5.0
func (e GitLabService) String() string
type IssueOrMergeRequest ¶ added in v1.0.0
type IssueOrMergeRequest interface { WithKind IsIssueOrMergeRequest() }
type Kind ¶
type Kind string
const ( UnknownKind Kind = "unknown-kind" IssueKind Kind = "issue" MergeRequestKind Kind = "merge-request" ProviderKind Kind = "provider" UserOrOrganizationKind Kind = "user-or-organization" OrganizationOrProjectKind Kind = "organization-or-project" ServiceKind Kind = "service" MilestoneKind Kind = "milestone" IssueOrMergeRequestKind Kind = "issue-or-merge-request" UserKind Kind = "user" ProjectKind Kind = "project" LabelKind Kind = "label" )
type MergeRequest ¶
type MergeRequest interface { WithKind IsMergeRequest() }
type OrganizationOrProject ¶ added in v1.0.0
type OrganizationOrProject interface { WithKind IsOrganizationOrProject() }
type TrelloBoard ¶ added in v1.9.0
type TrelloBoard struct { Project // contains filtered or unexported fields }
func NewTrelloBoard ¶ added in v1.9.0
func NewTrelloBoard(id string) *TrelloBoard
func (TrelloBoard) Contains ¶ added in v1.9.0
func (e TrelloBoard) Contains(other Entity) bool
func (TrelloBoard) Equals ¶ added in v1.9.0
func (e TrelloBoard) Equals(other Entity) bool
func (TrelloBoard) LocalID ¶ added in v1.10.0
func (e TrelloBoard) LocalID() string
func (TrelloBoard) RelDecodeString ¶ added in v1.9.0
func (e TrelloBoard) RelDecodeString(input string) (Entity, error)
func (TrelloBoard) String ¶ added in v1.9.0
func (e TrelloBoard) String() string
type TrelloCard ¶ added in v1.9.0
type TrelloCard struct { Issue // contains filtered or unexported fields }
func NewTrelloCard ¶ added in v1.9.0
func NewTrelloCard(id string) *TrelloCard
Example ¶
entity := NewTrelloCard("uworIKRP") fmt.Println("entity") fmt.Println(" ", entity.String()) fmt.Println(" ", entity.Kind()) fmt.Println(" ", entity.Provider()) relatives := []string{ "https://trello.com/manfredtouron/boards", "https://trello.com/bertytech/home", "https://trello.com/manfredtouron", "https://trello.com/b/QO8ORojV/test", "https://trello.com/b/QO8ORojV", "https://trello.com/c/uworIKRP/1-card-1", "https://trello.com/c/uworIKRP", "https://trello.com/c/pqon4iMh/2-card-2#comment-5d79f330ae4a3225dff6faf9", "https://trello.com/c/pqon4iMh/blah#action-5d79f2b6053f4c137c9b9a28", "@manfredtouron", } fmt.Println("relationships") for _, name := range relatives { attrs := "" rel, err := entity.RelDecodeString(name) if err != nil { fmt.Printf(" %-80s -> error: %v\n", name, err) continue } if rel.Equals(entity) { attrs += " (equals)" } if entity.Contains(rel) { attrs += " (contains)" } if rel.Contains(entity) { attrs += " (is contained)" } fmt.Printf(" %-80s -> %s %s%s\n", name, rel.String(), rel.Kind(), attrs) }
Output: entity https://trello.com/c/uworIKRP issue trello relationships https://trello.com/manfredtouron/boards -> https://trello.com/manfredtouron user-or-organization https://trello.com/bertytech/home -> https://trello.com/bertytech user-or-organization https://trello.com/manfredtouron -> https://trello.com/manfredtouron user-or-organization https://trello.com/b/QO8ORojV/test -> https://trello.com/b/QO8ORojV project https://trello.com/b/QO8ORojV -> https://trello.com/b/QO8ORojV project https://trello.com/c/uworIKRP/1-card-1 -> https://trello.com/c/uworIKRP issue (equals) https://trello.com/c/uworIKRP -> https://trello.com/c/uworIKRP issue (equals) https://trello.com/c/pqon4iMh/2-card-2#comment-5d79f330ae4a3225dff6faf9 -> https://trello.com/c/pqon4iMh issue https://trello.com/c/pqon4iMh/blah#action-5d79f2b6053f4c137c9b9a28 -> https://trello.com/c/pqon4iMh issue @manfredtouron -> https://trello.com/manfredtouron user-or-organization
func (TrelloCard) Contains ¶ added in v1.9.0
func (e TrelloCard) Contains(other Entity) bool
func (TrelloCard) Equals ¶ added in v1.9.0
func (e TrelloCard) Equals(other Entity) bool
func (TrelloCard) LocalID ¶ added in v1.10.0
func (e TrelloCard) LocalID() string
func (TrelloCard) RelDecodeString ¶ added in v1.9.0
func (e TrelloCard) RelDecodeString(input string) (Entity, error)
func (TrelloCard) String ¶ added in v1.9.0
func (e TrelloCard) String() string
type TrelloService ¶ added in v1.9.0
type TrelloService struct {
Service
}
func NewTrelloService ¶ added in v1.9.0
func NewTrelloService() *TrelloService
func (TrelloService) Contains ¶ added in v1.9.0
func (e TrelloService) Contains(other Entity) bool
func (TrelloService) Equals ¶ added in v1.9.0
func (e TrelloService) Equals(other Entity) bool
func (TrelloService) LocalID ¶ added in v1.10.0
func (e TrelloService) LocalID() string
func (TrelloService) Provider ¶ added in v1.9.0
func (e TrelloService) Provider() Provider
func (TrelloService) RelDecodeString ¶ added in v1.9.0
func (e TrelloService) RelDecodeString(input string) (Entity, error)
func (TrelloService) String ¶ added in v1.9.0
func (e TrelloService) String() string
type TrelloUser ¶ added in v1.9.0
type TrelloUser struct { UserOrOrganization // contains filtered or unexported fields }
func NewTrelloUser ¶ added in v1.9.0
func NewTrelloUser(id string) *TrelloUser
func (TrelloUser) Contains ¶ added in v1.9.0
func (e TrelloUser) Contains(other Entity) bool
func (TrelloUser) Equals ¶ added in v1.9.0
func (e TrelloUser) Equals(other Entity) bool
func (TrelloUser) LocalID ¶ added in v1.10.0
func (e TrelloUser) LocalID() string
func (TrelloUser) RelDecodeString ¶ added in v1.9.0
func (e TrelloUser) RelDecodeString(input string) (Entity, error)
func (TrelloUser) String ¶ added in v1.9.0
func (e TrelloUser) String() string
type UserOrOrganization ¶
type UserOrOrganization interface { WithKind IsUserOrOrganization() }
type WithProvider ¶ added in v1.0.0
type WithProvider interface {
Provider() Provider
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.