Documentation ¶
Index ¶
- type Assets
- type Attributes
- type Auth
- type Config
- type Data
- type GitRelease
- type Insight
- type OpensourceID
- type ProviderDownloadSummary
- type ProviderVersion
- type Source
- func (s *Source) GetPlatform() (string, error)
- func (s *Source) GitHubMetrics(sourceID string, httpClient *resty.Client) (any, error)
- func (s *Source) NewClient(caContent []byte) *resty.Client
- func (s *Source) SetLogger(log *logrus.Logger)
- func (s *Source) TerraformMetrics(name, sourceID string, httpClient *resty.Client) (any, error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assets ¶
type Assets struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` DownloadCount int `json:"download_count,omitempty" yaml:"download_count,omitempty"` }
Assets holds download count information of a specific release of GitHub.
type Attributes ¶
type Attributes struct { Month int `json:"month,omitempty" yaml:"month,omitempty"` Total int `json:"total,omitempty" yaml:"total,omitempty"` Week int `json:"week,omitempty" yaml:"week,omitempty"` Year int `json:"year,omitempty" yaml:"year,omitempty"` }
Attributes holds the download attributes of a Terraform provider.
type Auth ¶
type Auth struct { UserName string `json:"username,omitempty" yaml:"username,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty"` BearerToken string `json:"bearer_token,omitempty" yaml:"bearer_token,omitempty"` }
Auth holds the authorization information of selected platforms.
type Config ¶
type Config struct { Sources []Source `json:"sources,omitempty" yaml:"sources,omitempty"` LogLevel string `json:"log_level,omitempty" yaml:"log_level,omitempty"` // contains filtered or unexported fields }
Config holds the configuration of multiple projects for which metrics need to be collected.
func (*Config) GetInsight ¶
GetInsight gets insight into the downloads of all specified projects.
type Data ¶
type Data struct { Type string `json:"type,omitempty" yaml:"type,omitempty"` ID string `json:"id,omitempty" yaml:"id,omitempty"` Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty"` }
Data holds the download data of a Terraform provider.
type GitRelease ¶
type GitRelease struct { TagName string `json:"tag_name,omitempty" yaml:"tag_name,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Assets []Assets `json:"assets,omitempty" yaml:"assets,omitempty"` }
GitRelease holds information of the releases downloaded metrics of GitHub.
type Insight ¶
type Insight struct { Platform string `json:"platform,omitempty" yaml:"platform,omitempty"` ID string `json:"id,omitempty" yaml:"id,omitempty"` Summary any `json:"summary,omitempty" yaml:"summary,omitempty"` }
Insight holds the download metrics for a particular project.
type OpensourceID ¶
type OpensourceID struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Alias string `json:"alias,omitempty" yaml:"alias,omitempty"` }
OpensourceID holds information about the ID of the project for which metrics are to be pulled.
func (OpensourceID) GetID ¶
func (id OpensourceID) GetID() string
GetID gets ID of the project by validating the alias if set.
type ProviderDownloadSummary ¶
type ProviderDownloadSummary struct {
Data Data `json:"data,omitempty" yaml:"data,omitempty"`
}
ProviderDownloadSummary holds the information of the download metrics of a Terraform provider.
type ProviderVersion ¶
type ProviderVersion struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` Owner string `json:"owner,omitempty" yaml:"owner,omitempty"` NameSpace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` }
ProviderVersion Holds the information of all available versions of a provider.
type Source ¶
type Source struct { Platform string `json:"platform,omitempty" yaml:"platform,omitempty"` BaseURL string `json:"base_url,omitempty" yaml:"base_url,omitempty"` ResourceIDs []OpensourceID `json:"resource_ids,omitempty" yaml:"resource_ids,omitempty"` CaFilePath string `json:"ca_file_path,omitempty" yaml:"ca_file_path,omitempty"` Auth Auth `json:"auth,omitempty" yaml:"auth,omitempty"` // contains filtered or unexported fields }
Source holds the information about the project for which metrics are to be pulled.
func (*Source) GetPlatform ¶
GetPlatform returns the platform by identifying it from the URL of the project passed.
func (*Source) GitHubMetrics ¶
GitHubMetrics is responsible for making https calls to pull the metrics for the appropriate project.