nuget

package
v0.0.0-...-552d98a Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w http.ResponseWriter, p interface{})

JSON marchal object to json and set Content-Type

Types

type Any

type Any struct {
	XMLName xml.Name
	Content string `xml:",innerxml"`
}

type ContentFile

type ContentFile struct {
	Include      string `xml:"include,attr"`
	Exclude      string `xml:"excluse,attr"`
	BuildAction  string `xml:"buildAction,attr"`
	CopyToOutput bool   `xml:"copyToOutput,attr"`
	Flatten      bool   `xml:"flatten,attr"`
}

type Dependencies

type Dependencies struct {
	Groups       []*Group
	Dependencies []*Dependency
}

func (*Dependencies) UnmarshalXML

func (deps *Dependencies) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Dependency

type Dependency struct {
	XMLName xml.Name     `xml:"dependency"`
	ID      string       `xml:"id,attr"`
	Version VersionRange `xml:"version,attr"`
	Include string       `xml:"include,attr"`
	Exclude string       `xml:"exclude,attr"`
}

type File

type File struct {
	Src     string `xml:"src,attr"`
	Target  string `xml:"target,attr"`
	Exclude string `xml:"exclude,attr"`
}

type FrameworkAssembly

type FrameworkAssembly struct {
	AssemblyName    string `xml:"assemblyName,attr"`
	TargetFramework string `xml:"targetFramework,attr,omitEmpty"`
}

type Group

type Group struct {
	TargetFramework string
	Dependencies    []*Dependency
}

type Metadata

type Metadata struct {
	ID          string `xml:"id"`
	Version     string `xml:"version"`
	Description string `xml:"description"`
	Authors     string `xml:"authors"`

	Title                    string        `xml:"title"`
	Owners                   string        `xml:"owners"`
	ProjectURL               string        `xml:"projectUrl"`
	LicenseURL               string        `xml:"licenseUrl"`
	License                  string        `xml:"license"`
	IconURL                  string        `xml:"iconUrl"`
	RequireLicenseAcceptance bool          `xml:"requireLicenseAcceptance"`
	DevelopmentDependency    bool          `xml:"developmentDependency"`
	Summary                  string        `xml:"summary"`
	ReleaseNotes             string        `xml:"releaseNotes"`
	Copyright                string        `xml:"copyright"`
	Language                 string        `xml:"language"`
	Tags                     string        `xml:"tags"`
	Serviceable              string        `xml:"serviceable"`
	Dependencies             *Dependencies `xml:"dependencies"`
}

type Nuspec

type Nuspec struct {
	Package Package `xml:"package"`
}

type Package

type Package struct {
	XMLName  xml.Name `xml:"package"`
	Metadata Metadata `xml:"metadata"`
	Files    []File   `xml:"files"`
}

func (*Package) PURL

func (pkg *Package) PURL() purl.PackageURL

type PackageType

type PackageType struct {
	Name    string `xml:"name,attr"`
	Version string `xml:"name,attr"`
}

type Reference

type Reference struct {
	File string
}

type ReferenceGroup

type ReferenceGroup struct {
	TargetFramework string      `xml:"targetFramework,attr"`
	References      []Reference `xml:-`
}

type Repository

type Repository interface {
	Versions(ctx context.Context, id string) Versions
	Download(ctx context.Context, id, version string) (io.ReadCloser, error)
	Upload(ctx context.Context, nupkg io.Reader) error
	Delete(ctx context.Context, id, version string) error
	Search(ctx context.Context, text string) (io.ReadCloser, error)
}

Repository is an interface for a NuGet repository

func NewClient

func NewClient(indexURL string) (Repository, error)

NewClient creates a client repository

func NewLocal

func NewLocal(storage driver.StorageDriver) Repository

NewLocalRepository initialize a new local repository

func NewRemote

func NewRemote(remoteURL string, storage driver.StorageDriver) (Repository, error)

NewRemote initialize a repository that fetch and cache packages from upstream

type Resource

type Resource struct {
	ID      string       `json:"@id"`
	Type    ResourceType `json:"@type"`
	Comment string       `json:"comment"`
}

type ResourceType

type ResourceType string
const (
	PackagePublish       ResourceType = "PackagePublish/2.0.0"
	SearchQueryService   ResourceType = "SearchQueryService"
	RegistrationsBaseUrl ResourceType = "RegistrationsBaseUrl"
	PackageBaseAddress   ResourceType = "PackageBaseAddress/3.0.0"
)

type Server

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

Server expose a repository on HTTP

func (Server) Mount

func (srv Server) Mount(route *mux.Route)

Mount the server on a mux router

type ServiceIndex

type ServiceIndex struct {
	Version   string     `json:"version"`
	Resources []Resource `json:"resources"`
}

type VersionRange

type VersionRange string

func (VersionRange) Min

func (v VersionRange) Min() string

type Versions

type Versions struct {
	io.ReadCloser
	Status int
}

func NewVersions

func NewVersions(versions []string) Versions

func (*Versions) Unmarshal

func (v *Versions) Unmarshal() ([]string, error)

Jump to

Keyboard shortcuts

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