Help us shape the future of Go! Take the 2026 Go Developer Survey

nuget

package
v3.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Metadata = &EdmxMetadata{
	XmlnsEdmx: "http://schemas.microsoft.com/ado/2007/06/edmx",
	Version:   "1.0",
	DataServices: EdmxDataServices{
		XmlnsM:                "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata",
		DataServiceVersion:    "2.0",
		MaxDataServiceVersion: "2.0",
		Schema: []EdmxSchema{
			{
				Xmlns:     "http://schemas.microsoft.com/ado/2006/04/edm",
				Namespace: "NuGetGallery.OData",
				EntityType: &EdmxEntityType{
					Name:      "V2FeedPackage",
					HasStream: true,
					Keys: []EdmxPropertyRef{
						{Name: "Id"},
						{Name: "Version"},
					},
					Properties: []EdmxProperty{
						{
							Name: "Id",
							Type: "Edm.String",
						},
						{
							Name: "Version",
							Type: "Edm.String",
						},
						{
							Name:     "NormalizedVersion",
							Type:     "Edm.String",
							Nullable: true,
						},
						{
							Name:     "Authors",
							Type:     "Edm.String",
							Nullable: true,
						},
						{
							Name: "Created",
							Type: "Edm.DateTime",
						},
						{
							Name: "Dependencies",
							Type: "Edm.String",
						},
						{
							Name: "Description",
							Type: "Edm.String",
						},
						{
							Name: "DownloadCount",
							Type: "Edm.Int64",
						},
						{
							Name: "LastUpdated",
							Type: "Edm.DateTime",
						},
						{
							Name: "Published",
							Type: "Edm.DateTime",
						},
						{
							Name: "PackageSize",
							Type: "Edm.Int64",
						},
						{
							Name:     "ProjectUrl",
							Type:     "Edm.String",
							Nullable: true,
						},
						{
							Name:     "ReleaseNotes",
							Type:     "Edm.String",
							Nullable: true,
						},
						{
							Name:     "RequireLicenseAcceptance",
							Type:     "Edm.Boolean",
							Nullable: false,
						},
						{
							Name:     "Title",
							Type:     "Edm.String",
							Nullable: true,
						},
						{
							Name:     "VersionDownloadCount",
							Type:     "Edm.Int64",
							Nullable: false,
						},
					},
				},
			},
			{
				Xmlns:     "http://schemas.microsoft.com/ado/2006/04/edm",
				Namespace: "NuGetGallery",
				EntityContainer: &EdmxEntityContainer{
					Name:                     "V2FeedContext",
					IsDefaultEntityContainer: true,
					EntitySet: EdmxEntitySet{
						Name:       "Packages",
						EntityType: "NuGetGallery.OData.V2FeedPackage",
					},
					FunctionImports: []EdmxFunctionImport{
						{
							Name:       "Search",
							ReturnType: "Collection(NuGetGallery.OData.V2FeedPackage)",
							EntitySet:  "Packages",
							Parameter: []EdmxFunctionParameter{
								{
									Name: "searchTerm",
									Type: "Edm.String",
								},
							},
						},
						{
							Name:       "FindPackagesById",
							ReturnType: "Collection(NuGetGallery.OData.V2FeedPackage)",
							EntitySet:  "Packages",
							Parameter: []EdmxFunctionParameter{
								{
									Name: "id",
									Type: "Edm.String",
								},
							},
						},
					},
				},
			},
		},
	},
}

Functions

func DeletePackage

func DeletePackage(ctx *context.Context)

DeletePackage hard deletes the package https://docs.microsoft.com/en-us/nuget/api/package-publish-resource#delete-a-package

func ServiceIndexV3

func ServiceIndexV3(ctx *context.Context)

https://docs.microsoft.com/en-us/nuget/api/service-index

func UploadPackage

func UploadPackage(ctx *context.Context)

UploadPackage creates a new package with the metadata contained in the uploaded nupgk file https://docs.microsoft.com/en-us/nuget/api/package-publish-resource#push-a-package

func UploadSymbolPackage

func UploadSymbolPackage(ctx *context.Context)

UploadSymbolPackage adds a symbol package to an existing package https://docs.microsoft.com/en-us/nuget/api/symbol-package-publish-resource

Types

type AtomTitle

type AtomTitle struct {
	Type string `xml:"type,attr"`
	Text string `xml:",chardata"`
}

type Auth

type Auth struct{}

func (*Auth) Name

func (a *Auth) Name() string

type CatalogEntry

type CatalogEntry struct {
	CatalogLeafURL           string                    `json:"@id"`
	Authors                  string                    `json:"authors"`
	Copyright                string                    `json:"copyright"`
	DependencyGroups         []*PackageDependencyGroup `json:"dependencyGroups"`
	Description              string                    `json:"description"`
	IconURL                  string                    `json:"iconUrl"`
	ID                       string                    `json:"id"`
	IsPrerelease             bool                      `json:"isPrerelease"`
	Language                 string                    `json:"language"`
	LicenseURL               string                    `json:"licenseUrl"`
	PackageContentURL        string                    `json:"packageContent"`
	ProjectURL               string                    `json:"projectUrl"`
	RequireLicenseAcceptance bool                      `json:"requireLicenseAcceptance"`
	Summary                  string                    `json:"summary"`
	Tags                     string                    `json:"tags"`
	Version                  string                    `json:"version"`
	ReleaseNotes             string                    `json:"releaseNotes"`
	Published                time.Time                 `json:"published"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#catalog-entry

type EdmxDataServices

type EdmxDataServices struct {
	XmlnsM                string       `xml:"xmlns:m,attr"`
	DataServiceVersion    string       `xml:"m:DataServiceVersion,attr"`
	MaxDataServiceVersion string       `xml:"m:MaxDataServiceVersion,attr"`
	Schema                []EdmxSchema `xml:"Schema"`
}

type EdmxEntityContainer

type EdmxEntityContainer struct {
	Name                     string               `xml:"Name,attr"`
	IsDefaultEntityContainer bool                 `xml:"m:IsDefaultEntityContainer,attr"`
	EntitySet                EdmxEntitySet        `xml:"EntitySet"`
	FunctionImports          []EdmxFunctionImport `xml:"FunctionImport"`
}

type EdmxEntitySet

type EdmxEntitySet struct {
	Name       string `xml:"Name,attr"`
	EntityType string `xml:"EntityType,attr"`
}

type EdmxEntityType

type EdmxEntityType struct {
	Name       string            `xml:"Name,attr"`
	HasStream  bool              `xml:"m:HasStream,attr"`
	Keys       []EdmxPropertyRef `xml:"Key>PropertyRef"`
	Properties []EdmxProperty    `xml:"Property"`
}

type EdmxFunctionImport

type EdmxFunctionImport struct {
	Name       string                  `xml:"Name,attr"`
	ReturnType string                  `xml:"ReturnType,attr"`
	EntitySet  string                  `xml:"EntitySet,attr"`
	Parameter  []EdmxFunctionParameter `xml:"Parameter"`
}

type EdmxFunctionParameter

type EdmxFunctionParameter struct {
	Name string `xml:"Name,attr"`
	Type string `xml:"Type,attr"`
}

type EdmxMetadata

type EdmxMetadata struct {
	XMLName      xml.Name         `xml:"edmx:Edmx"`
	XmlnsEdmx    string           `xml:"xmlns:edmx,attr"`
	Version      string           `xml:"Version,attr"`
	DataServices EdmxDataServices `xml:"edmx:DataServices"`
}

type EdmxProperty

type EdmxProperty struct {
	Name     string `xml:"Name,attr"`
	Type     string `xml:"Type,attr"`
	Nullable bool   `xml:"Nullable,attr"`
}

type EdmxPropertyRef

type EdmxPropertyRef struct {
	Name string `xml:"Name,attr"`
}

type EdmxSchema

type EdmxSchema struct {
	Xmlns           string               `xml:"xmlns,attr"`
	Namespace       string               `xml:"Namespace,attr"`
	EntityType      *EdmxEntityType      `xml:"EntityType,omitempty"`
	EntityContainer *EdmxEntityContainer `xml:"EntityContainer,omitempty"`
}

type FeedEntry

type FeedEntry struct {
	XMLName    xml.Name             `xml:"entry"`
	Xmlns      string               `xml:"xmlns,attr,omitempty"`
	XmlnsD     string               `xml:"xmlns:d,attr,omitempty"`
	XmlnsM     string               `xml:"xmlns:m,attr,omitempty"`
	Base       string               `xml:"xml:base,attr,omitempty"`
	ID         string               `xml:"id"`
	Category   FeedEntryCategory    `xml:"category"`
	Links      []FeedEntryLink      `xml:"link"`
	Title      TypedValue[string]   `xml:"title"`
	Updated    time.Time            `xml:"updated"`
	Author     string               `xml:"author>name"`
	Summary    string               `xml:"summary"`
	Properties *FeedEntryProperties `xml:"m:properties"`
	Content    string               `xml:",innerxml"`
}

type FeedEntryCategory

type FeedEntryCategory struct {
	Term   string `xml:"term,attr"`
	Scheme string `xml:"scheme,attr"`
}
type FeedEntryLink struct {
	Rel  string `xml:"rel,attr"`
	Href string `xml:"href,attr"`
}

type FeedEntryProperties

type FeedEntryProperties struct {
	Authors                  string                `xml:"d:Authors"`
	Copyright                string                `xml:"d:Copyright,omitempty"`
	Created                  TypedValue[time.Time] `xml:"d:Created"`
	Dependencies             string                `xml:"d:Dependencies"`
	Description              string                `xml:"d:Description"`
	DevelopmentDependency    TypedValue[bool]      `xml:"d:DevelopmentDependency"`
	DownloadCount            TypedValue[int64]     `xml:"d:DownloadCount"`
	ID                       string                `xml:"d:Id"`
	IconURL                  string                `xml:"d:IconUrl,omitempty"`
	Language                 string                `xml:"d:Language,omitempty"`
	LastUpdated              TypedValue[time.Time] `xml:"d:LastUpdated"`
	LicenseURL               string                `xml:"d:LicenseUrl,omitempty"`
	MinClientVersion         string                `xml:"d:MinClientVersion,omitempty"`
	NormalizedVersion        string                `xml:"d:NormalizedVersion"`
	Owners                   string                `xml:"d:Owners,omitempty"`
	PackageSize              TypedValue[int64]     `xml:"d:PackageSize"`
	ProjectURL               string                `xml:"d:ProjectUrl,omitempty"`
	Published                TypedValue[time.Time] `xml:"d:Published"`
	ReleaseNotes             string                `xml:"d:ReleaseNotes,omitempty"`
	RequireLicenseAcceptance TypedValue[bool]      `xml:"d:RequireLicenseAcceptance"`
	Tags                     string                `xml:"d:Tags,omitempty"`
	Title                    string                `xml:"d:Title,omitempty"`
	Version                  string                `xml:"d:Version"`
	VersionDownloadCount     TypedValue[int64]     `xml:"d:VersionDownloadCount"`
}

type FeedResponse

type FeedResponse struct {
	XMLName xml.Name           `xml:"feed"`
	Xmlns   string             `xml:"xmlns,attr,omitempty"`
	XmlnsD  string             `xml:"xmlns:d,attr,omitempty"`
	XmlnsM  string             `xml:"xmlns:m,attr,omitempty"`
	Base    string             `xml:"xml:base,attr,omitempty"`
	ID      string             `xml:"id"`
	Title   TypedValue[string] `xml:"title"`
	Updated time.Time          `xml:"updated"`
	Links   []FeedEntryLink    `xml:"link"`
	Entries []*FeedEntry       `xml:"entry"`
	Count   int64              `xml:"m:count"`
}

type PackageDependency

type PackageDependency struct {
	ID    string `json:"id"`
	Range string `json:"range"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#package-dependency

type PackageDependencyGroup

type PackageDependencyGroup struct {
	TargetFramework string               `json:"targetFramework"`
	Dependencies    []*PackageDependency `json:"dependencies"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#package-dependency-group

type PackageVersionsResponse

type PackageVersionsResponse struct {
	Versions []string `json:"versions"`
}

https://docs.microsoft.com/en-us/nuget/api/package-base-address-resource#response

type RegistrationIndexPage

type RegistrationIndexPage struct {
	RegistrationPageURL string                       `json:"@id"`
	Lower               string                       `json:"lower"`
	Upper               string                       `json:"upper"`
	Count               int                          `json:"count"`
	Items               []*RegistrationIndexPageItem `json:"items"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#registration-page-object

type RegistrationIndexPageItem

type RegistrationIndexPageItem struct {
	RegistrationLeafURL string        `json:"@id"`
	PackageContentURL   string        `json:"packageContent"`
	CatalogEntry        *CatalogEntry `json:"catalogEntry"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#registration-leaf-object-in-a-page

type RegistrationIndexResponse

type RegistrationIndexResponse struct {
	RegistrationIndexURL string                   `json:"@id"`
	Type                 []string                 `json:"@type"`
	Count                int                      `json:"count"`
	Pages                []*RegistrationIndexPage `json:"items"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#response

type RegistrationLeafResponse

type RegistrationLeafResponse struct {
	RegistrationLeafURL  string       `json:"@id"`
	Type                 []string     `json:"@type"`
	PackageContentURL    string       `json:"packageContent"`
	RegistrationIndexURL string       `json:"registration"`
	CatalogEntry         CatalogEntry `json:"catalogEntry"`
}

https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#registration-leaf

type SearchResult

type SearchResult struct {
	Authors                  string                    `json:"authors"`
	Copyright                string                    `json:"copyright"`
	DependencyGroups         []*PackageDependencyGroup `json:"dependencyGroups"`
	Description              string                    `json:"description"`
	IconURL                  string                    `json:"iconUrl"`
	ID                       string                    `json:"id"`
	IsPrerelease             bool                      `json:"isPrerelease"`
	Language                 string                    `json:"language"`
	LicenseURL               string                    `json:"licenseUrl"`
	ProjectURL               string                    `json:"projectUrl"`
	RequireLicenseAcceptance bool                      `json:"requireLicenseAcceptance"`
	Summary                  string                    `json:"summary"`
	Tags                     string                    `json:"tags"`
	Title                    string                    `json:"title"`
	TotalDownloads           int64                     `json:"totalDownloads"`
	Version                  string                    `json:"version"`
	Versions                 []*SearchResultVersion    `json:"versions"`
	RegistrationIndexURL     string                    `json:"registration"`
}

https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource#search-result

type SearchResultResponse

type SearchResultResponse struct {
	TotalHits int64           `json:"totalHits"`
	Data      []*SearchResult `json:"data"`
}

https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource#response

type SearchResultVersion

type SearchResultVersion struct {
	RegistrationLeafURL string `json:"@id"`
	Version             string `json:"version"`
	Downloads           int64  `json:"downloads"`
}

https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource#search-result

type ServiceCollection

type ServiceCollection struct {
	Href  string    `xml:"href,attr"`
	Title AtomTitle `xml:"atom:title"`
}

type ServiceIndexResponseV2

type ServiceIndexResponseV2 struct {
	XMLName   xml.Name         `xml:"service"`
	Base      string           `xml:"base,attr"`
	Xmlns     string           `xml:"xmlns,attr"`
	XmlnsAtom string           `xml:"xmlns:atom,attr"`
	Workspace ServiceWorkspace `xml:"workspace"`
}

type ServiceIndexResponseV3

type ServiceIndexResponseV3 struct {
	Version   string            `json:"version"`
	Resources []ServiceResource `json:"resources"`
}

https://docs.microsoft.com/en-us/nuget/api/service-index#resources

type ServiceResource

type ServiceResource struct {
	ID   string `json:"@id"`
	Type string `json:"@type"`
}

https://docs.microsoft.com/en-us/nuget/api/service-index#resource

type ServiceWorkspace

type ServiceWorkspace struct {
	Title      AtomTitle         `xml:"atom:title"`
	Collection ServiceCollection `xml:"collection"`
}

type TypedValue

type TypedValue[T any] struct {
	Type  string `xml:"type,attr,omitempty"`
	Value T      `xml:",chardata"`
}

Source Files

  • api_v2.go
  • api_v3.go
  • auth.go
  • links.go
  • nuget.go

Jump to

Keyboard shortcuts

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