npm

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlobAccess

func BlobAccess(repo string, pkg, version string, opts ...Option) (bpi.BlobAccess, error)

func DataAccess

func DataAccess(repo string, pkg, version string, opts ...Option) (bpi.DataAccess, error)

func Provider

func Provider(repo string, pkg, version string, opts ...Option) bpi.BlobAccessProvider

Types

type Option

type Option = optionutils.Option[*Options]

func WithCachingContext

func WithCachingContext(ctx datacontext.Context) Option

func WithCachingFileSystem

func WithCachingFileSystem(fs vfs.FileSystem) Option

func WithCachingPath

func WithCachingPath(p string) Option

func WithCredentialContext

func WithCredentialContext(ctx credentials.ContextProvider) Option

func WithCredentials

func WithCredentials(c credentials.Credentials) Option

func WithDataContext

func WithDataContext(ctx datacontext.Context) Option

func WithLoggingContext

func WithLoggingContext(ctx logging.ContextProvider) Option

func WithPathFileSystem

func WithPathFileSystem(fs vfs.FileSystem) Option

type Options

func (*Options) ApplyTo

func (o *Options) ApplyTo(opts *Options)

func (*Options) FileSystem

func (o *Options) FileSystem() vfs.FileSystem

func (*Options) GetCredentials

func (o *Options) GetCredentials(repo string, pkg string) (cpi.Credentials, error)

func (*Options) Logger

func (o *Options) Logger(keyValuePairs ...interface{}) logging.Logger

func (*Options) SetDataContext

func (o *Options) SetDataContext(ctx datacontext.Context)

type PackageSpec

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

func NewPackageSpec

func NewPackageSpec(registry, pkg, version string, opts ...Option) (*PackageSpec, error)

NewPackageSpec creates a new NPM registry access PackageSpec version v1.

func (*PackageSpec) GetBlobAccess

func (a *PackageSpec) GetBlobAccess() (blobaccess.BlobAccess, error)

func (*PackageSpec) GetPackageVersion

func (a *PackageSpec) GetPackageVersion() (*npm.Version, error)

func (*PackageSpec) PackageUrl

func (a *PackageSpec) PackageUrl() string

PackageUrl returns the URL of the NPM package (registry/Package).

func (*PackageSpec) PackageVersionUrl

func (a *PackageSpec) PackageVersionUrl() string

PackageVersionUrl returns the URL of the NPM package-version (registry/Package/Version).

Jump to

Keyboard shortcuts

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