ecosystems

package
v0.81.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

This section is empty.

Variables

This section is empty.

Functions

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) 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)
}

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) 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)
}

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

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      *[]Package
}

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 RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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