models

package
v0.0.0-...-ab9d506 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GitHubAggregateStore string = "gh_aggregates"

GitHubAggregateStore indicates the store name to save GitHubAggregates into

View Source
const GitHubAggregateStoreKey string = "main"

GitHubAggregateStoreKey is the key GitHub Aggregates will always be stored under

View Source
const GitHubUserStore string = "gh_users"

GitHubUserStore holds the name of the store used to save GitHub user models.

View Source
const IssueModelName string = "issue"

IssueModelName is the name of the Issue model type

View Source
const JiraAggregateStore string = "jira_aggregates"

JiraAggregateStore indicates the store name to save JiraAggregates into

View Source
const JiraAggregateStoreKey string = "main"

JiraAggregateStoreKey is the key Jira Aggregates will always be stored under

View Source
const JiraIssueStore string = "jira_issues"

JiraIssueStore is the name of the store to keep Jira Issues in

View Source
const JiraUserStore string = "jira_users"

JiraUserStore is the name of the store used to saved JiraUser models

View Source
const LabelModelName string = "label"

LabelModelName is the name of the Label model type

View Source
const LinkAggregateStore string = "link_aggregates"

LinkAggregateStore is the store used to save link aggregates

View Source
const UserModelName string = "user"

UserModelName is the name of the User model type

Variables

This section is empty.

Functions

func StringerFromJIComments

func StringerFromJIComments(cs []JiraIssueComment) []fmt.Stringer

StringerFromJIComments creates a slice of fmt.Stringers from a slice of JiraIssueComments

func StringerFromJILinks(ls []JiraIssueLink) []fmt.Stringer

StringerFromJILinks creates a slice of fmt.Stringers from a slice of JiraIssueLinks

Types

type GitHubAggregate

type GitHubAggregate struct {
	// Users holds the GitHubUsersAggregate
	Users *GitHubUsersAggregate
	// contains filtered or unexported fields
}

GitHubAggregate provides an overview of all the retrieved GitHub models

func NewGitHubAggregate

func NewGitHubAggregate() *GitHubAggregate

NewGitHubAggregate creates a new GitHubAggregate

func (GitHubAggregate) Hash

func (a GitHubAggregate) Hash() string

Hash implements hash.Hashable.Hash

func (GitHubAggregate) MarshalJSON

func (a GitHubAggregate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (GitHubAggregate) String

func (a GitHubAggregate) String() string

type GitHubUser

type GitHubUser struct {
	// ID is the User's unique identifier.
	ID int64

	// Login is the User's username
	Login string

	// Email is the User's email address
	Email string

	// Name is the User's name
	Name string
}

GitHubUser holds information about a GitHub user.

func NewGitHubUser

func NewGitHubUser(from github.User) GitHubUser

NewGitHubUser creates a new GitHubUser from a github.User

func (GitHubUser) Hash

func (u GitHubUser) Hash() string

Hash implements hash.Hashable.Hash

func (GitHubUser) MarshalJSON

func (u GitHubUser) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (GitHubUser) String

func (u GitHubUser) String() string

type GitHubUsersAggregate

type GitHubUsersAggregate struct {
	// Logins holds all the GitHubUser logins
	Logins []string
	// contains filtered or unexported fields
}

GitHubUsersAggregate aggregates all retrieved GitHub User models

func NewGitHubUsersAggregate

func NewGitHubUsersAggregate() *GitHubUsersAggregate

NewGitHubUsersAggregate creates a new GitHubUsersAggregate

func (GitHubUsersAggregate) String

func (a GitHubUsersAggregate) String() string

type JiraAggregate

type JiraAggregate struct {
	// Issues holds the JiraIssuesAggregate
	Issues *JiraIssuesAggregate
	// contains filtered or unexported fields
}

JiraAggregate provides an overview of all the retrieved Jira models

func NewJiraAggregate

func NewJiraAggregate() *JiraAggregate

NewJiraAggregate creates a new JiraAggregate

func (JiraAggregate) Hash

func (a JiraAggregate) Hash() string

Hash implements hash.Hashable.Hash

func (JiraAggregate) MarshalJSON

func (a JiraAggregate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (JiraAggregate) String

func (a JiraAggregate) String() string

type JiraIssue

type JiraIssue struct {
	// ID holds the Jira issue ID.
	ID string

	// Type the style of Jira issue.
	Type string

	// ProjectID holds the ID of the Jira project which the issue belongs to.
	ProjectID string

	// AssigneeKey holds the Key of the Jira user who is assigned to the
	// issue
	AssigneeKey string

	// Assignee holds the JiraUser model for the corresponding
	// AsigneeKey. Only populated when the JiraIssue is created from a
	// Jira API query response.
	Assignee *JiraUser `json:"-"`

	// Resolution holds the final status of the Jira issue
	Resolution string

	// Priority indicate how urgent an issue is
	Priority string

	// Status indicates the current work state of the issue
	Status string

	// Title holds a short summary of the Jira issue
	Title string

	// Description holds a longer write up about the Jira issue
	Description string

	// Progress indicates how complete an issue is. In the range from:
	// [0, 1]
	Progress float32

	// Links holds the Jira Issue Links associated with the issue
	Links []JiraIssueLink

	// Comments holds the Jira Issue Comments associated with the issue
	Comments []JiraIssueComment

	// Labels holds the Jira labels put in the issue
	Labels []string
}

JiraIssue holds the information we can tranfer to GitHub from a Jira issue.

func NewJiraIssue

func NewJiraIssue(from jira.Issue) (JiraIssue, error)

NewJiraIssue creates a new JiraIssue from a jira.Issue. An error is returned if one occurs.

func (JiraIssue) Hash

func (i JiraIssue) Hash() string

Hash implements Hashable.Hash

func (JiraIssue) MarshalJSON

func (i JiraIssue) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (JiraIssue) String

func (i JiraIssue) String() string

String implements fmt.Stringer.String

type JiraIssueComment

type JiraIssueComment struct {
	// ID is the Jira Issue Comment unique ID
	ID string

	// AuthorKey is the Jira User's Key who wrote the comment
	AuthorKey string

	// Text is the Jira Issue Comment body
	Text string
}

JiraIssueComment is a comment on a Jira Issue

func NewJiraIssueComment

func NewJiraIssueComment(from jira.Comment) JiraIssueComment

NewJiraIssueComment creates a new JiraIssueComment from a jira.Comment

func (JiraIssueComment) String

func (c JiraIssueComment) String() string

func (JiraIssueComment) Stringer

func (c JiraIssueComment) Stringer() fmt.Stringer
type JiraIssueLink struct {
	// ID unique identifier of Jira Issue Link
	ID string

	// Type notes the class of issue link
	Type string

	// InID is the input Jira Issue ID
	InID string

	// OutID is the output Jira Issue ID
	OutID string

	// Comment on the jira issue link
	Comment *JiraIssueComment
}

JiraIssueLink notes a link between 2 Jira issues

func NewJiraIssueLink(from jira.IssueLink) JiraIssueLink

NewJiraIssueLink creates a new JiraIssueLink for a jira.IssueLink

func (JiraIssueLink) String

func (l JiraIssueLink) String() string

func (JiraIssueLink) Stringer

func (l JiraIssueLink) Stringer() fmt.Stringer

type JiraIssuesAggregate

type JiraIssuesAggregate struct {
	// IDs is a list of all the Jira Issue IDs
	IDs []int

	// MaxID indicates the highest Jira Issue ID we have
	MaxID int

	// Labels holds all the labels present in the retrieved issues
	Labels []string
	// contains filtered or unexported fields
}

JiraIssuesAggregate collects all the information related to Jira Issue models

func NewJiraIssuesAggregate

func NewJiraIssuesAggregate() *JiraIssuesAggregate

NewJiraIssuesAggregate creates a new JiraIssuesAggregate

func (JiraIssuesAggregate) String

func (a JiraIssuesAggregate) String() string

type JiraProject

type JiraProject struct {
	// ID holds the Jira project ID.
	ID string

	// Key holds the human readable ID of the Jira project.
	Key string

	// IssueTypes holds the names of the types of issues that can be
	// created in the project.
	IssueTypes []string
}

JiraProject holds relevant Jira project information

func NewJiraProject

func NewJiraProject(from jira.Project) JiraProject

NewJiraProject creates a JiraProject from a jira.Project

type JiraUser

type JiraUser struct {
	// Key is a unique user handle
	Key string

	// Name is the user's name
	Name string

	// Email is the user's email address
	Email string

	// DisplayName is the name the user chooses to display
	DisplayName string
}

JiraUser holds information about a Jira user

func NewJiraUser

func NewJiraUser(from jira.User) JiraUser

NewJiraUser creates a new JiraUser from a jira.User

func (JiraUser) Hash

func (u JiraUser) Hash() string

Hash implements hash.Hashable.Hash

func (JiraUser) MarshalJSON

func (u JiraUser) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (JiraUser) String

func (u JiraUser) String() string
type Link struct {
	// Model is the type of model being linked
	Model string

	// GitHubID is the ID of the GitHub entity which is linked
	GitHubID string

	// GitHubHash is the hash of the GitHub entity at the time of linking.
	GitHubHash string

	// JiraID is the ID of the Jira entity which is linked
	JiraID string

	// JiraHash is the hash of the Jira entity at the time of linking.
	JiraHash string
}

Link indicates an association between a Jira and GitHub entity. The type of entity will be determined by the name of the store the Link is saved in.

func (Link) Hash

func (l Link) Hash() string

Hash implements hash.Hashable.Hash

func (Link) MarshalJSON

func (l Link) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshalable.Marshal

func (Link) String

func (l Link) String() string

type LinkAggregate

type LinkAggregate struct {
	// Model is the model the aggregate is generated for
	Model string

	// JiraIndex maps Jira IDs to GH IDs
	JiraIndex map[string]string
}

LinkAggregate collects all links for a specific model

func NewLinkAggregate

func NewLinkAggregate() *LinkAggregate

NewLinkAggregate creates a new LinkAggregate instance

func (LinkAggregate) Hash

func (a LinkAggregate) Hash() string

Hash implements hash.Hashable.Hash

func (LinkAggregate) MarshalJSON

func (a LinkAggregate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.MarshalJSON

func (LinkAggregate) String

func (a LinkAggregate) String() string

Jump to

Keyboard shortcuts

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