Documentation
¶
Overview ¶
Package v2 implements the NuGet v2 OData protocol.
It provides feed detection, package search, metadata access, and package download functionality for NuGet v2 feeds.
Index ¶
- type Collection
- type Content
- type DownloadClient
- type Entry
- type Feed
- type FeedClient
- type MetadataClient
- func (c *MetadataClient) FindPackagesByID(ctx context.Context, feedURL, packageID string) ([]*PackageMetadata, error)
- func (c *MetadataClient) GetPackageMetadata(ctx context.Context, feedURL, packageID, version string) (*PackageMetadata, error)
- func (c *MetadataClient) ListVersions(ctx context.Context, feedURL, packageID string) ([]string, error)
- type PackageMetadata
- type Properties
- type SearchClient
- type SearchOptions
- type SearchResult
- type Service
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
Collection represents an OData collection.
type DownloadClient ¶
type DownloadClient struct {
// contains filtered or unexported fields
}
DownloadClient provides v2 package download functionality.
func NewDownloadClient ¶
func NewDownloadClient(httpClient *nugethttp.Client) *DownloadClient
NewDownloadClient creates a new v2 download client.
func (*DownloadClient) DownloadLatestPackage ¶
func (c *DownloadClient) DownloadLatestPackage(ctx context.Context, feedURL, packageID string) (io.ReadCloser, error)
DownloadLatestPackage downloads the latest version of a package. Caller is responsible for closing the response body.
func (*DownloadClient) DownloadPackage ¶
func (c *DownloadClient) DownloadPackage(ctx context.Context, feedURL, packageID, version string) (io.ReadCloser, error)
DownloadPackage downloads a .nupkg file and returns the response body. Caller is responsible for closing the response body.
type Entry ¶
type Entry struct {
XMLName xml.Name `xml:"entry"`
ID string `xml:"id"`
Title string `xml:"title"`
Updated string `xml:"updated"`
Properties Properties `xml:"properties"`
Content Content `xml:"content"`
}
Entry represents a single entry in an Atom feed.
type Feed ¶
type Feed struct {
XMLName xml.Name `xml:"feed"`
Title string `xml:"title"`
ID string `xml:"id"`
Updated string `xml:"updated"`
Entries []Entry `xml:"entry"`
}
Feed represents an Atom feed response.
type FeedClient ¶
type FeedClient struct {
// contains filtered or unexported fields
}
FeedClient provides v2 feed detection and access.
func NewFeedClient ¶
func NewFeedClient(httpClient *nugethttp.Client) *FeedClient
NewFeedClient creates a new v2 feed client.
func (*FeedClient) DetectV2Feed ¶
DetectV2Feed checks if a URL is a valid NuGet v2 feed. Returns true if the feed is detected, false otherwise.
func (*FeedClient) GetServiceDocument ¶
GetServiceDocument retrieves the OData service document.
type MetadataClient ¶
type MetadataClient struct {
// contains filtered or unexported fields
}
MetadataClient provides v2 metadata functionality.
func NewMetadataClient ¶
func NewMetadataClient(httpClient *nugethttp.Client) *MetadataClient
NewMetadataClient creates a new v2 metadata client.
func (*MetadataClient) FindPackagesByID ¶
func (c *MetadataClient) FindPackagesByID(ctx context.Context, feedURL, packageID string) ([]*PackageMetadata, error)
FindPackagesByID retrieves all versions of a package with full metadata in a single call. This is the efficient method matching NuGet.Client's DependencyInfoResourceV2Feed approach. Uses the /FindPackagesById() endpoint which returns all versions with dependencies.
func (*MetadataClient) GetPackageMetadata ¶
func (c *MetadataClient) GetPackageMetadata(ctx context.Context, feedURL, packageID, version string) (*PackageMetadata, error)
GetPackageMetadata retrieves metadata for a specific package version. Uses the /Packages(Id='...',Version='...') endpoint.
func (*MetadataClient) ListVersions ¶
func (c *MetadataClient) ListVersions(ctx context.Context, feedURL, packageID string) ([]string, error)
ListVersions returns all available versions for a package ID. Uses the /FindPackagesById() endpoint.
type PackageMetadata ¶
type PackageMetadata struct {
ID string
Version string
Description string
Authors string
IconURL string
LicenseURL string
ProjectURL string
Tags []string
Dependencies string
DownloadCount int64
IsPrerelease bool
Published string
RequireLicenseAcceptance bool
DownloadURL string
Title string
Updated string
}
PackageMetadata represents detailed metadata for a package version.
type Properties ¶
type Properties struct {
XMLName xml.Name `xml:"properties"`
ID string `xml:"Id"`
Version string `xml:"Version"`
Description string `xml:"Description"`
Authors string `xml:"Authors"`
IconURL string `xml:"IconUrl"`
LicenseURL string `xml:"LicenseUrl"`
ProjectURL string `xml:"ProjectUrl"`
Tags string `xml:"Tags"`
Dependencies string `xml:"Dependencies"`
DownloadCount int64 `xml:"DownloadCount"`
IsPrerelease bool `xml:"IsPrerelease"`
Published string `xml:"Published"`
RequireLicenseAcceptance bool `xml:"RequireLicenseAcceptance"`
}
Properties contains package metadata.
type SearchClient ¶
type SearchClient struct {
// contains filtered or unexported fields
}
SearchClient provides v2 search functionality.
func NewSearchClient ¶
func NewSearchClient(httpClient *nugethttp.Client) *SearchClient
NewSearchClient creates a new v2 search client.
func (*SearchClient) FindPackagesByID ¶
func (c *SearchClient) FindPackagesByID(ctx context.Context, feedURL, packageID string) ([]SearchResult, error)
FindPackagesByID searches for all versions of a specific package ID.
func (*SearchClient) Search ¶
func (c *SearchClient) Search(ctx context.Context, feedURL string, opts SearchOptions) ([]SearchResult, error)
Search searches for packages using OData query syntax.
type SearchOptions ¶
type SearchOptions struct {
Query string
Skip int
Top int
Filter string
OrderBy string
IncludePrerelease bool
}
SearchOptions holds v2 search parameters.
type SearchResult ¶
type SearchResult struct {
ID string
Version string
Description string
Authors string
IconURL string
LicenseURL string
ProjectURL string
Tags []string
Dependencies string
DownloadCount int64
IsPrerelease bool
Published string
RequireLicenseAcceptance bool
DownloadURL string
}
SearchResult represents a v2 search result.
type Service ¶
type Service struct {
XMLName xml.Name `xml:"service"`
Workspace Workspace `xml:"workspace"`
Base string `xml:"base,attr"`
}
Service represents the OData service document.
type Workspace ¶
type Workspace struct {
Title string `xml:"title"`
Collections []Collection `xml:"collection"`
}
Workspace contains collections in the OData service.