model

package
v0.0.0-...-d26fc85 Latest Latest
Warning

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

Go to latest
Published: May 2, 2015 License: BSD-3-Clause Imports: 1 Imported by: 6

Documentation

Overview

Package model provides data models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	ID               *int64      `json:"id"`
	Repository       *Repository `json:"repository,omitempty"`
	Message          *string     `json:"message"`
	Author           *User       `json:"author,omitempty"`
	Committer        *User       `json:"committer,omitempty"`
	AuthorDate       *time.Time  `json:"author_date"`
	CommitDate       *time.Time  `json:"commit_date"`
	FileChangedCount *int64      `json:"file_changed_count"`
	InsertionsCount  *int64      `json:"insertions_count"`
	DeletionsCount   *int64      `json:"deletions_count"`
}

Commit is a representation of a VCS commit.

type Feature

type Feature struct {
	ID            *int64  `json:"id"`
	Name          *string `json:"name"`
	Category      *string `json:"category"`
	DefaultWeight *int64  `json:"default_weight"`
}

Feature represents a feature.

type GhOrganization

type GhOrganization struct {
	ID                 *int64     `json:"id"`
	GithubID           *int64     `json:"github_id"`
	Login              *string    `json:"login"`
	AvatarURL          *string    `json:"avatar_url"`
	HTMLURL            *string    `json:"html_url"`
	Name               *string    `json:"name"`
	Company            *string    `json:"company"`
	Blog               *string    `json:"blog"`
	Location           *string    `json:"location"`
	Email              *string    `json:"email"`
	CollaboratorsCount *int64     `json:"collaborators_count"`
	CreatedAt          *time.Time `json:"created_at"`
	UpdatedAt          *time.Time `json:"updated_at"`
}

GhOrganization represents a GitHub organization.

type GhRepository

type GhRepository struct {
	ID               *int64     `json:"id"`
	RepositoryID     *int64     `json:"-"`
	GithubID         *int64     `json:"github_id"`
	FullName         *string    `json:"full_name"`
	Description      *string    `json:"description"`
	Homepage         *string    `json:"homepage"`
	Fork             *bool      `json:"fork"`
	DefaultBranch    *string    `json:"default_branch"`
	MasterBranch     *string    `json:"master_branch"`
	HTMLURL          *string    `json:"html_url"`
	ForksCount       *int64     `json:"forks_count"`
	OpenIssuesCount  *int64     `json:"open_issues_count"`
	StargazersCount  *int64     `json:"stargazers_count"`
	SubscribersCount *int64     `json:"subscribers_count"`
	WatchersCount    *int64     `json:"watchers_count"`
	SizeInKb         *int64     `json:"size_in_kb"`
	CreatedAt        *time.Time `json:"created_at"`
	UpdatedAt        *time.Time `json:"updated_at"`
	PushedAt         *time.Time `json:"pushed_at"`
}

GhRepository represents a GitHub repository.

type GhUser

type GhUser struct {
	ID                 *int64            `json:"id"`
	UserID             *int64            `json:"-"`
	GithubID           *int64            `json:"github_id"`
	Login              *string           `json:"login"`
	Bio                *string           `json:"bio"`
	Blog               *string           `json:"blog"`
	Company            *string           `json:"company"`
	Email              *string           `json:"email"`
	Hireable           *bool             `json:"hireable"`
	Location           *string           `json:"location"`
	AvatarURL          *string           `json:"avatar_url"`
	HTMLURL            *string           `json:"html_url"`
	FollowersCount     *int64            `json:"followers_count"`
	FollowingCount     *int64            `json:"following_count"`
	CollaboratorsCount *int64            `json:"collaborators_count"`
	CreatedAt          *time.Time        `json:"created_at"`
	UpdatedAt          *time.Time        `json:"updated_at"`
	GhOrganizations    []*GhOrganization `json:"gh_organizations,omitempty"`
}

GhUser represents a GitHub user.

type Repository

type Repository struct {
	ID              *int64        `json:"id"`
	Name            *string       `json:"name"`
	PrimaryLanguage *string       `json:"primary_language"`
	CloneURL        *string       `json:"clone_url"`
	ClonePath       *string       `json:"clone_path"`
	VCS             *string       `json:"vcs"`
	GhRepository    *GhRepository `json:"gh_repository,omitempty"`
}

Repository represents a repository.

type Score

type Score struct {
	ID        *int64   `json:"id"`
	UserID    *int64   `json:"-"`
	FeatureID *int64   `json:"-"`
	Score     *float64 `json:"score"`
}

Score represents a score.

type SearchResult

type SearchResult struct {
	User
	Rank float64 `json:"rank"`
}

SearchResult represents a search result, as from the results of a user query which the Rank() function from score package computes.

type SearchResults

type SearchResults []SearchResult

SearchResults is used to store search results and is sortable by SearchResult.Rank.

func (SearchResults) Len

func (sr SearchResults) Len() int

Len is the number of elements in a collection of search results.

func (SearchResults) Less

func (sr SearchResults) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (SearchResults) Swap

func (sr SearchResults) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type Stats

type Stats struct {
	UsersCount           *int64 `json:"users_count"`
	RepositoriesCount    *int64 `json:"repositories_count"`
	CommitsCount         *int64 `json:"commits_count"`
	CommitDeltasCount    *int64 `json:"commit_deltas_count"`
	FeaturesCount        *int64 `json:"features_count"`
	GhUsersCount         *int64 `json:"gh_users_count"`
	GhOrganizationsCount *int64 `json:"gh_organizations_count"`
	GhRepositoriesCount  *int64 `json:"gh_repositories_count"`
}

Stats represents various statistics about users, repositories and so on.

type User

type User struct {
	ID       *int64  `json:"id"`
	Username *string `json:"username"`
	Name     *string `json:"name"`
	Email    *string `json:"email"`
	GhUser   *GhUser `json:"gh_user,omitempty"`
}

User represents a user.

Jump to

Keyboard shortcuts

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