npm

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

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
}

func (*Client) DownloadCount

func (c *Client) DownloadCount(packageName string, opts *DownloadCountOpts) (*DownloadCountResonse, error)

func (*Client) Package

func (c *Client) Package(packageName string) (*PackageResponse, error)

type DownloadCountOpts

type DownloadCountOpts struct {
	LastDay   bool
	LastWeek  bool
	LastMonth bool
	StartDate time.Time
	EndDate   time.Time
}

func (*DownloadCountOpts) Period

func (o *DownloadCountOpts) Period() string

type DownloadCountResonse

type DownloadCountResonse struct {
	Downloads uint64 `json:"downloads"`
	Start     string `json:"start"`
	End       string `json:"end"`
	Package   string `json:"package"`
}

type PackageBug

type PackageBug struct {
	URL string `json:"url"`
}

type PackageRepository

type PackageRepository struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type PackageResponse

type PackageResponse struct {
	Name       string                     `json:"name"`
	DistTags   map[string]string          `json:"dist-tags"`
	Versions   map[string]*PackageVersion `json:"versions"`
	Time       map[string]string          `json:"time"`
	Repository *PackageRepository         `json:"repository"`
	Homepage   string                     `json:"homepage"`
	Bugs       *PackageBug                `json:"bugs"`
	License    string                     `json:"license"`
}

type PackageVersion

type PackageVersion struct {
	Name     string              `json:"name"`
	Version  string              `json:"version"`
	Dist     *PackageVersionDist `json:"dist"`
	GitHead  string              `json:"gitHead"`
	Homepage string              `json:"homepage"`
	License  string              `json:"license"`
}

type PackageVersionDist

type PackageVersionDist struct {
	Integrity    string `json:"integrity"`
	Shasum       string `json:"shasum"`
	Tarball      string `json:"tarball"`
	FileCount    uint64 `json:"fileCount"`
	UnpackedSize uint64 `json:"unpackedSize"`
}

type Provider

type Provider struct{}

func NewProvider

func NewProvider() (*Provider, error)

func (*Provider) Open

func (p *Provider) Open(rawurl string) (provider.Repo, error)

func (*Provider) Parse

func (p *Provider) Parse(uri string) (provider.Repo, error)

func (*Provider) Ping

func (p *Provider) Ping(rawurl string) error

func (*Provider) ProviderName

func (p *Provider) ProviderName() string

type Repo

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

func (*Repo) Analyze

func (r *Repo) Analyze() (provider.Report, error)

func (*Repo) Close

func (r *Repo) Close() error

func (*Repo) Derived

func (r *Repo) Derived() ([]string, error)

type Report

type Report struct {
	*prvdutils.StaticReport
}

Jump to

Keyboard shortcuts

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