cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute of the reposcraper command

Types

type BitbucketRepo

type BitbucketRepo struct {
	Name  string `json:"name"`
	Links struct {
		HTML struct {
			HREF string `json:"href"`
		} `json:"html"`
	} `json:"links"`
	Description string `json:"description"`
	IsPrivate   bool   `json:"is_private"`
}

func (BitbucketRepo) GetDescription

func (r BitbucketRepo) GetDescription() string

func (BitbucketRepo) GetName

func (r BitbucketRepo) GetName() string

func (BitbucketRepo) GetType

func (r BitbucketRepo) GetType() string

func (BitbucketRepo) GetURL

func (r BitbucketRepo) GetURL() string

func (BitbucketRepo) GetVisibility

func (r BitbucketRepo) GetVisibility() string

type BitbucketResp

type BitbucketResp struct {
	Pagelen int             `json="pagelen"`
	Values  []BitbucketRepo `json="values"`
	Page    int             `json="page"`
	Size    int             `json="size"`
	Next    string          `json="next"`
}

BitbucketResp struct to unpack from Bitbucket response

type BitbucketToken

type BitbucketToken struct {
	Scopes       string `json:"scopes"`
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	TokenType    string `json:"token_type"`
	State        string `json:"state"`
	RefreshToken string `json:"refresh_token"`
}

BitbucketToken struct used for the token request

type Config

type Config struct {
	GitHub    *ServiceConfig `json:"github,omitempty"`
	GitLab    *ServiceConfig `json:"gitlab,omitempty"`
	Bitbucket *ServiceConfig `json:"bitbucket,omitempty"`
}

Config of the Scraper

type GitHubRepo

type GitHubRepo struct {
	Name        string `json:"name"`
	HTMLURL     string `json:"html_url"`
	Description string `json:"description"`
	Language    string `json:"language"`
	Private     bool   `json:"private"`
	Fork        bool   `json:"fork"`
}

GitHubRepo struct to unpack from GitHub response

func (GitHubRepo) GetDescription

func (r GitHubRepo) GetDescription() string

func (GitHubRepo) GetName

func (r GitHubRepo) GetName() string

func (GitHubRepo) GetType

func (r GitHubRepo) GetType() string

func (GitHubRepo) GetURL

func (r GitHubRepo) GetURL() string

func (GitHubRepo) GetVisibility

func (r GitHubRepo) GetVisibility() string

type GitLabRepo

type GitLabRepo struct {
	Name        string `json:"name"`
	WebURL      string `json:"web_url"`
	Description string `json:"description"`
	Visibility  string `json:"visibility"`
}

GitLabRepo struct to unpack from GitLab response

func (GitLabRepo) GetDescription

func (r GitLabRepo) GetDescription() string

func (GitLabRepo) GetName

func (r GitLabRepo) GetName() string

func (GitLabRepo) GetType

func (r GitLabRepo) GetType() string

func (GitLabRepo) GetURL

func (r GitLabRepo) GetURL() string

func (GitLabRepo) GetVisibility

func (r GitLabRepo) GetVisibility() string

type Scraper

type Scraper struct {
	Repositories []ScraperRepo
	Counters     struct {
		GitHub    int
		GitLab    int
		Bitbucket int
	}
	// contains filtered or unexported fields
}

Scraper base structure

func (*Scraper) Collect

func (s *Scraper) Collect()

Collect all the repositories owned and starred by the user

func (*Scraper) LoadConfig

func (s *Scraper) LoadConfig(filename string) error

LoadConfig loads manually the Scraper configuration file (without using viper)

type ScraperRepo

type ScraperRepo interface {
	GetName() string
	GetDescription() string
	GetURL() string
	GetVisibility() string
	GetType() string
}

ScraperRepo interface contract for a service

type ServiceConfig

type ServiceConfig struct {
	Username string `json:"username"`
	Token    string `json:"token"`
	Key      string `json:"key"`
	Secret   string `json:"secret"`
}

ServiceConfig for a single service of the Scraper

Jump to

Keyboard shortcuts

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