githubrepodetails

package module
v0.0.0-...-ed669d8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 4 Imported by: 0

README

GitHub Repo Details

The library to fetch repo details to simplify due diligence when assessing it for further usage.

Features

  • v0.0.1:

    • Source: GraphQL

      • Repo URL

      • License type

      • Is forked

      • Is archived

      • Is disabled

      • Creation Date

      • Last Update Date

      • Adoption:

        • Stargazes:

          • Total count

          • Dynamics: count in time

        • Forks:

          • Count

          • Dynamics: count in time

        • Watchers:

          • Total count

          • Dynamics: count in time on a daily, weekly, monthly basis

      • Issues:

        • Open issues count

        • Closed issues count

        • Dynamics:

          • Count of issues in time

          • Median duration of issue resolution

      • Releases:

        • Number of releases

        • Last release date

        • Dynamics: time between release

    • Source: RestAPI

License

The library and tooling is distributed under the MIT license.

Applications

The app generates the list of trending repos on daily and weekly basis. It has integration to telegram.

Logic

  1. GET https://github.com/trending/{{Language}}?since=daily

  2. Extract the info according to the list of features

  3. Generate the output to be displayed as markdown table

  4. Publish to using telegram bot API

Documentation

Overview

Module to fetch details of a github repo using github API and github graphQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines the client to fetch data.

func NewClient

func NewClient(opts ...ClientOption) (*Client, error)

NewClient defines the function to init a Client.

func (*Client) GetGraphQLData

func (c *Client) GetGraphQLData(owner, repo string) (result *respGraphQL, err error)

func (*Client) Run

func (c *Client) Run(owner, repo string) (Response, error)

Run defines the function to fetch repo details. Requires owner - the repo owner repo - the repo name

type ClientOption

type ClientOption func(*Client)

ClientOption defines the option to modify Client's behavior.

func WithAPIKey

func WithAPIKey(key string) ClientOption

WithAPIKey defines the option to set github API key.

type RepoDetails

type RepoDetails struct {
	// URL contains the repo url
	URL string `json:"url"`
	// Timestamp contains response timestamp in unix epochs
	Timestamp int64 `json:"timestamp"`
	// CreatedAt contains the repo creation timestamp
	CreatedAt string `json:"created_at"`
	// LastUpdatedAt contains the timestamp of repo last update
	LastUpdatedAt string `json:"last_updated_at"`
	// StargazerCount contains the count of start for the repo
	StargazerCnt int `json:"stargazer_count"`
	// ForksCnt contains the count of the repo forks
	ForksCnt int `json:"forks_count"`
}

RepoDetails defines the features about the repo.

type Response

type Response struct {
	// Status response http status code.
	Status int8
	// Details
	Details *RepoDetails
}

Response defines the response object.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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