ecosystems

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ecosystems provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

View Source
const BaseURL = "https://packages.ecosyste.ms/api/v1"

Variables

This section is empty.

Functions

func NewGetRegistryPackageVersionRequest added in v0.82.0

func NewGetRegistryPackageVersionRequest(server string, registryName string, packageName string, versionNumber string) (*http.Request, error)

NewGetRegistryPackageVersionRequest generates requests for GetRegistryPackageVersion

func NewLookupPackageRequest

func NewLookupPackageRequest(server string, params *LookupPackageParams) (*http.Request, error)

NewLookupPackageRequest generates requests for LookupPackage

Types

type Advisory

type Advisory struct {
	Classification *string                  `json:"classification"`
	CreatedAt      string                   `json:"created_at"`
	CvssScore      *float32                 `json:"cvss_score"`
	CvssVector     *string                  `json:"cvss_vector"`
	Description    *string                  `json:"description"`
	Identifiers    []string                 `json:"identifiers"`
	Origin         *string                  `json:"origin"`
	Packages       []map[string]interface{} `json:"packages"`
	PublishedAt    *string                  `json:"published_at"`
	References     []string                 `json:"references"`
	Severity       *string                  `json:"severity"`
	SourceKind     *string                  `json:"source_kind"`
	Title          *string                  `json:"title"`
	UpdatedAt      string                   `json:"updated_at"`
	Url            *string                  `json:"url"`
	Uuid           string                   `json:"uuid"`
	WithdrawnAt    *string                  `json:"withdrawn_at"`
}

Advisory defines model for Advisory.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

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

Creates a new Client, with reasonable defaults

func (*Client) GetRegistryPackageVersion added in v0.82.0

func (c *Client) GetRegistryPackageVersion(ctx context.Context, registryName string, packageName string, versionNumber string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) LookupPackage

func (c *Client) LookupPackage(ctx context.Context, params *LookupPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// LookupPackage request
	LookupPackage(ctx context.Context, params *LookupPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRegistryPackageVersion request
	GetRegistryPackageVersion(ctx context.Context, registryName string, packageName string, versionNumber string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetRegistryPackageVersionWithResponse added in v0.82.0

func (c *ClientWithResponses) GetRegistryPackageVersionWithResponse(ctx context.Context, registryName string, packageName string, versionNumber string, reqEditors ...RequestEditorFn) (*GetRegistryPackageVersionResponse, error)

GetRegistryPackageVersionWithResponse request returning *GetRegistryPackageVersionResponse

func (*ClientWithResponses) LookupPackageWithResponse

func (c *ClientWithResponses) LookupPackageWithResponse(ctx context.Context, params *LookupPackageParams, reqEditors ...RequestEditorFn) (*LookupPackageResponse, error)

LookupPackageWithResponse request returning *LookupPackageResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// LookupPackageWithResponse request
	LookupPackageWithResponse(ctx context.Context, params *LookupPackageParams, reqEditors ...RequestEditorFn) (*LookupPackageResponse, error)

	// GetRegistryPackageVersionWithResponse request
	GetRegistryPackageVersionWithResponse(ctx context.Context, registryName string, packageName string, versionNumber string, reqEditors ...RequestEditorFn) (*GetRegistryPackageVersionResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Dependency added in v0.82.0

type Dependency struct {
	Ecosystem    string  `json:"ecosystem"`
	Kind         *string `json:"kind"`
	Optional     *bool   `json:"optional"`
	PackageName  string  `json:"package_name"`
	Requirements *string `json:"requirements"`
}

Dependency defines model for Dependency.

type GetRegistryPackageVersionResponse added in v0.82.0

type GetRegistryPackageVersionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VersionWithDependencies
}

func ParseGetRegistryPackageVersionResponse added in v0.82.0

func ParseGetRegistryPackageVersionResponse(rsp *http.Response) (*GetRegistryPackageVersionResponse, error)

ParseGetRegistryPackageVersionResponse parses an HTTP response from a GetRegistryPackageVersionWithResponse call

func (GetRegistryPackageVersionResponse) Status added in v0.82.0

Status returns HTTPResponse.Status

func (GetRegistryPackageVersionResponse) StatusCode added in v0.82.0

func (r GetRegistryPackageVersionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type LookupPackageParams

type LookupPackageParams struct {
	// RepositoryUrl repository URL
	RepositoryUrl *string `form:"repository_url,omitempty" json:"repository_url,omitempty"`

	// Purl package URL
	Purl *string `form:"purl,omitempty" json:"purl,omitempty"`

	// Ecosystem ecosystem name
	Ecosystem *string `form:"ecosystem,omitempty" json:"ecosystem,omitempty"`

	// Name package name
	Name *string `form:"name,omitempty" json:"name,omitempty"`

	// Sort field to sort results by
	Sort *string `form:"sort,omitempty" json:"sort,omitempty"`

	// Order direction to sort results by
	Order *string `form:"order,omitempty" json:"order,omitempty"`
}

LookupPackageParams defines parameters for LookupPackage.

type LookupPackageResponse

type LookupPackageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]PackageWithRegistry
}

func ParseLookupPackageResponse

func ParseLookupPackageResponse(rsp *http.Response) (*LookupPackageResponse, error)

ParseLookupPackageResponse parses an HTTP response from a LookupPackageWithResponse call

func (LookupPackageResponse) Status

func (r LookupPackageResponse) Status() string

Status returns HTTPResponse.Status

func (LookupPackageResponse) StatusCode

func (r LookupPackageResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Maintainer

type Maintainer struct {
	CreatedAt     time.Time `json:"created_at"`
	Email         *string   `json:"email"`
	HtmlUrl       *string   `json:"html_url"`
	Login         *string   `json:"login"`
	Name          *string   `json:"name"`
	PackagesCount int       `json:"packages_count"`
	PackagesUrl   string    `json:"packages_url"`
	Role          *string   `json:"role"`
	UpdatedAt     time.Time `json:"updated_at"`
	Url           *string   `json:"url"`
	Uuid          string    `json:"uuid"`
}

Maintainer defines model for Maintainer.

type Package

type Package struct {
	Advisories               []Advisory              `json:"advisories"`
	CreatedAt                time.Time               `json:"created_at"`
	DependentPackagesCount   int                     `json:"dependent_packages_count"`
	DependentPackagesUrl     string                  `json:"dependent_packages_url"`
	DependentReposCount      int                     `json:"dependent_repos_count"`
	DependentRepositoriesUrl string                  `json:"dependent_repositories_url"`
	Description              *string                 `json:"description"`
	DockerDependentsCount    int                     `json:"docker_dependents_count"`
	DockerDownloadsCount     int                     `json:"docker_downloads_count"`
	DockerUsageUrl           string                  `json:"docker_usage_url"`
	DocumentationUrl         *string                 `json:"documentation_url"`
	Downloads                int                     `json:"downloads"`
	DownloadsPeriod          *string                 `json:"downloads_period"`
	Ecosystem                string                  `json:"ecosystem"`
	FirstReleasePublishedAt  *time.Time              `json:"first_release_published_at"`
	Homepage                 *string                 `json:"homepage"`
	InstallCommand           *string                 `json:"install_command"`
	KeywordsArray            []string                `json:"keywords_array"`
	LastSyncedAt             *time.Time              `json:"last_synced_at"`
	LatestReleaseNumber      *string                 `json:"latest_release_number"`
	LatestReleasePublishedAt *time.Time              `json:"latest_release_published_at"`
	Licenses                 *string                 `json:"licenses"`
	Maintainers              []Maintainer            `json:"maintainers"`
	Metadata                 *map[string]interface{} `json:"metadata"`
	Name                     string                  `json:"name"`
	Namespace                *string                 `json:"namespace"`
	NormalizedLicenses       []string                `json:"normalized_licenses"`
	Purl                     string                  `json:"purl"`
	Rankings                 map[string]interface{}  `json:"rankings"`
	RegistryUrl              *string                 `json:"registry_url"`
	RelatedPackagesUrl       string                  `json:"related_packages_url"`
	RepoMetadata             *map[string]interface{} `json:"repo_metadata"`
	RepoMetadataUpdatedAt    *time.Time              `json:"repo_metadata_updated_at"`
	RepositoryUrl            *string                 `json:"repository_url"`
	UpdatedAt                time.Time               `json:"updated_at"`
	UsageUrl                 string                  `json:"usage_url"`
	VersionNumbersUrl        *string                 `json:"version_numbers_url,omitempty"`
	VersionsCount            int                     `json:"versions_count"`
	VersionsUrl              string                  `json:"versions_url"`
}

Package defines model for Package.

type PackageWithRegistry added in v0.82.0

type PackageWithRegistry struct {
	Advisories               []Advisory              `json:"advisories"`
	CreatedAt                time.Time               `json:"created_at"`
	DependentPackagesCount   int                     `json:"dependent_packages_count"`
	DependentPackagesUrl     string                  `json:"dependent_packages_url"`
	DependentReposCount      int                     `json:"dependent_repos_count"`
	DependentRepositoriesUrl string                  `json:"dependent_repositories_url"`
	Description              *string                 `json:"description"`
	DockerDependentsCount    int                     `json:"docker_dependents_count"`
	DockerDownloadsCount     int                     `json:"docker_downloads_count"`
	DockerUsageUrl           string                  `json:"docker_usage_url"`
	DocumentationUrl         *string                 `json:"documentation_url"`
	Downloads                int                     `json:"downloads"`
	DownloadsPeriod          *string                 `json:"downloads_period"`
	Ecosystem                string                  `json:"ecosystem"`
	FirstReleasePublishedAt  *time.Time              `json:"first_release_published_at"`
	Homepage                 *string                 `json:"homepage"`
	InstallCommand           *string                 `json:"install_command"`
	KeywordsArray            []string                `json:"keywords_array"`
	LastSyncedAt             *time.Time              `json:"last_synced_at"`
	LatestReleaseNumber      *string                 `json:"latest_release_number"`
	LatestReleasePublishedAt *time.Time              `json:"latest_release_published_at"`
	Licenses                 *string                 `json:"licenses"`
	Maintainers              []Maintainer            `json:"maintainers"`
	Metadata                 *map[string]interface{} `json:"metadata"`
	Name                     string                  `json:"name"`
	Namespace                *string                 `json:"namespace"`
	NormalizedLicenses       []string                `json:"normalized_licenses"`
	Purl                     string                  `json:"purl"`
	Rankings                 map[string]interface{}  `json:"rankings"`
	Registry                 Registry                `json:"registry"`
	RegistryUrl              *string                 `json:"registry_url"`
	RelatedPackagesUrl       string                  `json:"related_packages_url"`
	RepoMetadata             *map[string]interface{} `json:"repo_metadata"`
	RepoMetadataUpdatedAt    *time.Time              `json:"repo_metadata_updated_at"`
	RepositoryUrl            *string                 `json:"repository_url"`
	UpdatedAt                time.Time               `json:"updated_at"`
	UsageUrl                 string                  `json:"usage_url"`
	VersionNumbersUrl        *string                 `json:"version_numbers_url,omitempty"`
	VersionsCount            int                     `json:"versions_count"`
	VersionsUrl              string                  `json:"versions_url"`
}

PackageWithRegistry defines model for PackageWithRegistry.

type Registry added in v0.82.0

type Registry struct {
	CreatedAt        time.Time               `json:"created_at"`
	Default          bool                    `json:"default"`
	Ecosystem        string                  `json:"ecosystem"`
	Github           *string                 `json:"github"`
	IconUrl          string                  `json:"icon_url"`
	KeywordsCount    *int64                  `json:"keywords_count,omitempty"`
	MaintainersCount int64                   `json:"maintainers_count"`
	MaintainersUrl   string                  `json:"maintainers_url"`
	Metadata         *map[string]interface{} `json:"metadata"`
	Name             string                  `json:"name"`
	NamespacesCount  *int64                  `json:"namespaces_count,omitempty"`
	PackagesCount    int64                   `json:"packages_count"`
	PackagesUrl      string                  `json:"packages_url"`
	UpdatedAt        time.Time               `json:"updated_at"`
	Url              string                  `json:"url"`
	VersionsCount    *int64                  `json:"versions_count,omitempty"`
}

Registry defines model for Registry.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type VersionWithDependencies added in v0.82.0

type VersionWithDependencies struct {
	CreatedAt        time.Time               `json:"created_at"`
	Dependencies     []Dependency            `json:"dependencies"`
	DocumentationUrl *string                 `json:"documentation_url"`
	DownloadUrl      *string                 `json:"download_url"`
	InstallCommand   *string                 `json:"install_command"`
	Integrity        *string                 `json:"integrity"`
	Licenses         *string                 `json:"licenses"`
	Metadata         *map[string]interface{} `json:"metadata"`
	Number           string                  `json:"number"`
	PublishedAt      *string                 `json:"published_at"`
	Purl             string                  `json:"purl"`
	RegistryUrl      *string                 `json:"registry_url"`
	Status           *string                 `json:"status"`
	UpdatedAt        time.Time               `json:"updated_at"`
}

VersionWithDependencies defines model for VersionWithDependencies.

Jump to

Keyboard shortcuts

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