api-server: github.com/DevMine/api-server/model Index | Files

package model

import "github.com/DevMine/api-server/model"

Package model provides data models.

Index

Package Files

commit.go feature.go gh_organization.go gh_repository.go gh_user.go model.go repository.go score.go search_result.go stats.go user.go

type Commit Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Score represents a score.

type SearchResult Uses

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 Uses

type SearchResults []SearchResult

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

func (SearchResults) Len Uses

func (sr SearchResults) Len() int

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

func (SearchResults) Less Uses

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 Uses

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

Swap swaps the elements with indexes i and j.

type Stats Uses

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 Uses

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.

Package model imports 1 packages (graph) and is imported by 6 packages. Updated 2016-07-21. Refresh now. Tools for package owners.