nuget

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 5 Imported by: 0

README

Nuget Client

Go Reference Workflows

A nuget client for golang. See examples to see how it can be used.

Currently only the Catalog API is implemented, as its how I intend to use the API.

$ go get github.com/gdwr/nuget

Contributing

Ensure you utilise the pre-commit hooks.

pre-commit install

Reference

Documentation

Index

Constants

View Source
const TimestampFormat = time.RFC3339Nano

Variables

View Source
var ErrServiceNotListed = errors.New("service was not listed by the service index")

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Id               string        `json:"@id"`
	CommitId         string        `json:"commitId"`
	CommitTimeStamp  string        `json:"commitTimeStamp"`
	Count            int           `json:"count"`
	NugetLastCreated string        `json:"nuget:lastCreated"`
	NugetLastDeleted string        `json:"nuget:lastDeleted"`
	NugetLastEdited  string        `json:"nuget:lastEdited"`
	Items            []CatalogItem `json:"items"`
}

type CatalogItem

type CatalogItem struct {
	Id              string `json:"@id"`
	Type            string `json:"@type"`
	CommitId        string `json:"commitId"`
	CommitTimestamp string `json:"commitTimeStamp"`
	Count           int    `json:"count"`
}

type CatalogLeaf added in v1.0.2

type CatalogLeaf struct {
	Id                       string          `json:"@id"`
	Type                     []string        `json:"@type"`
	Authors                  string          `json:"authors"`
	CatalogCommitId          string          `json:"catalog:commitId"`
	CatalogCommitTimeStamp   string          `json:"catalog:commitTimeStamp"`
	Copyright                string          `json:"copyright"`
	Created                  string          `json:"created"`
	Description              string          `json:"description"`
	IconUrl                  string          `json:"iconUrl"`
	PackageId                string          `json:"id"`
	IsPrerelease             bool            `json:"isPrerelease"`
	LastEdited               string          `json:"lastEdited"`
	Listed                   bool            `json:"listed"`
	PackageHash              string          `json:"packageHash"`
	PackageHashAlgorithm     string          `json:"packageHashAlgorithm"`
	PackageSize              int             `json:"packageSize"`
	ProjectUrl               string          `json:"projectUrl"`
	Published                string          `json:"published"`
	RequireLicenseAcceptance bool            `json:"requireLicenseAcceptance"`
	VerbatimVersion          string          `json:"verbatimVersion"`
	Version                  string          `json:"version"`
	DependencyGroups         json.RawMessage `json:"dependencyGroups"`
	PackageEntries           json.RawMessage `json:"packageEntries"`
}

type Cursor

type Cursor = time.Time

type NugetCatalog

type NugetCatalog struct {
	Cursor Cursor
	// contains filtered or unexported fields
}

func NewCatalog

func NewCatalog(h *http.Client, cursor Cursor) (*NugetCatalog, error)

func (*NugetCatalog) Catalog

func (c *NugetCatalog) Catalog() (*Catalog, error)

func (*NugetCatalog) Leaves

func (c *NugetCatalog) Leaves() ([]CatalogItem, error)

func (*NugetCatalog) Pages

func (c *NugetCatalog) Pages() ([]CatalogItem, error)

func (*NugetCatalog) StreamLeaves added in v1.0.1

func (c *NugetCatalog) StreamLeaves() <-chan CatalogLeaf

type NugetRepository

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

func NewRepository

func NewRepository(h *http.Client) (*NugetRepository, error)

func (*NugetRepository) GetCatalog

func (r *NugetRepository) GetCatalog(cursor Cursor) (*NugetCatalog, error)

type ServiceResource

type ServiceResource struct {
	Id      string `json:"@id"`
	Type    string `json:"@type"`
	Comment string `json:"comment"`
}

type Services

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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