npmi

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version    = "dev"
	Commit     = "none"
	CommitDate = "unknown"
)

Functions

func New added in v0.4.0

func New(options *Options, log hclog.Logger) (*main, error)

New builds a configuration for the current runtime and returns a pre-configured NPMI main

func NewConfigBuilder added in v0.4.0

func NewConfigBuilder() *configBuilder

func NewWithConfig added in v0.4.0

func NewWithConfig(options *Options, config *Config, log hclog.Logger) (*main, error)

NewWithConfig creates a NPMI main using the supplied options and config

Types

type Config added in v0.4.0

type Config struct {
	Platform string
	// contains filtered or unexported fields
}

type LocalCacheOptions added in v0.4.0

type LocalCacheOptions struct {
	Dir string `env:"NPMI_LOCAL_DIR"`
}

LocalCacheOptions constains configuration for Local Cache

type LogLevel added in v0.9.0

type LogLevel int32
const (
	NoLevel LogLevel = iota
	Info
	Debug
	Trace
)

func LogLevelFromString added in v0.9.0

func LogLevelFromString(levelStr string) LogLevel

func (LogLevel) String added in v0.9.0

func (l LogLevel) String() string

type MinioCacheOptions added in v0.4.0

type MinioCacheOptions struct {
	Endpoint        string `env:"NPMI_MINIO_ENDPOINT"`
	AccessKeyID     string `env:"NPMI_MINIO_ACCESS_KEY_ID"`
	SecretAccessKey string `env:"NPMI_MINIO_SECRET_ACCESS_KEY"`
	Bucket          string `env:"NPMI_MINIO_BUCKET"`
	UseTLS          bool   `env:"NPMI_MINIO_TLS"`
	InsecureTLS     bool   `env:"NPMI_MINIO_TLS_INSECURE"`
}

MinioCacheOptions contains configuration for Minio Cache

type NpmInstaller added in v0.4.0

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

func NewNpmInstaller added in v0.4.0

func NewNpmInstaller(config *Config, log hclog.Logger) *NpmInstaller

func (*NpmInstaller) Run added in v0.4.0

func (i *NpmInstaller) Run() (stdout string, stderr string, err error)

Run installs packages from NPM

func (*NpmInstaller) RunPrecacheCommand added in v0.4.0

func (i *NpmInstaller) RunPrecacheCommand(commandLine string) (stdout string, stderr string, err error)

RunPrecacheCommand runs a given command before inserting freshly installed NPM deps into cache

type Options added in v0.4.0

type Options struct {
	Verbose            bool `env:"NPMI_VERBOSE"`
	Force              bool `env:"NPMI_FORCE"`
	LocalCache         *LocalCacheOptions
	LogLevel           LogLevel `env:"NPMI_LOGLEVEL"`
	MinioCache         *MinioCacheOptions
	PrecacheCommand    string `env:"NPMI_PRECACHE"`
	TempDir            string `env:"NPMI_TEMP_DIR"`
	UseLocalCache      bool   `env:"NPMI_LOCAL"`
	UseMinioCache      bool   `env:"NPMI_MINIO"`
	Json               bool   `env:"NPMI_JSON"`
	TarDoubleDotPaths  bool   `env:"NPMI_TAR_DOUBLE_DOT_PATHS"`
	TarAbsolutePaths   bool   `env:"NPMI_TAR_ABSOLUTE_PATHS"`
	TarLinksOutsideCwd bool   `env:"NPMI_TAR_LINKS_OUTSIDE_CWD"`
}

Options describes the runtime configuration

Jump to

Keyboard shortcuts

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