Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright © 2023 The listen.dev team <engineering@garnet.ai>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func DefaultVersionResolutionStrategy(versions semver.Collection) *semver.Version
- func GetFromRegistry(ctx context.Context, name, version string) (io.ReadCloser, string, error)
- func GetVersionsFromRegistry(ctx context.Context, name string, constraints *semver.Constraints) (semver.Collection, error)
- func GetVersionsFromRegistryResponse(body io.ReadCloser, constraints *semver.Constraints) (semver.Collection, error)
- func Version(ctx context.Context) (string, error)
- type LockfileVersion
- type Package
- type PackageJSON
- type PackageLockDependency
- type PackageLockJSON
- func GetPackageLockJSONFromDir(dir string) (PackageLockJSON, error)
- func NewPackageLockJSON() PackageLockJSON
- func NewPackageLockJSONFromBytes(b []byte) (PackageLockJSON, error)
- func NewPackageLockJSONFromDir(ctx context.Context, dir string) (PackageLockJSON, error)
- func NewPackageLockJSONFromReader(reader io.Reader) (PackageLockJSON, error)
- type Packages
- type VersionResolutionStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultVersionResolutionStrategy ¶ added in v0.3.0
func DefaultVersionResolutionStrategy(versions semver.Collection) *semver.Version
DefaultVersionResolutionStrategy returns the highest semantic version in a collection of versions.
func GetFromRegistry ¶
GetFromRegistry asks to the npm registry for the details of a package by name, and optionally, by version.
func GetVersionsFromRegistry ¶ added in v0.3.0
func GetVersionsFromRegistryResponse ¶ added in v0.3.0
func GetVersionsFromRegistryResponse(body io.ReadCloser, constraints *semver.Constraints) (semver.Collection, error)
Types ¶
type LockfileVersion ¶
type LockfileVersion struct {
Value int `json:"lockfileVersion" name:"lockfile version" validate:"gte=1,lte=3"`
}
type Package ¶
type PackageJSON ¶ added in v0.3.0
type PackageJSON interface { FilterOutByTypes(...npmdeptype.Enum) FilterOutByNames(...string) Deps(context.Context, VersionResolutionStrategy) map[npmdeptype.Enum]map[string]*semver.Version }
func GetPackageJSONFromDir ¶ added in v0.3.0
func GetPackageJSONFromDir(dir string) (PackageJSON, error)
GetPackageJSONFromDir creates a PackageJSON instance from the existing package.json in dir, if any.
func NewPackageJSONFromReader ¶ added in v0.3.0
func NewPackageJSONFromReader(reader io.Reader) (PackageJSON, error)
type PackageLockDependency ¶
type PackageLockJSON ¶
type PackageLockJSON interface { listentype.AnalysisRequester Deps() map[string]PackageLockDependency Version() int }
func GetPackageLockJSONFromDir ¶ added in v0.11.0
func GetPackageLockJSONFromDir(dir string) (PackageLockJSON, error)
GetPackageLockJSONFromDir creates a PackageLockJSON instance from the existing package-lock.json in dir, if any.
func NewPackageLockJSON ¶
func NewPackageLockJSON() PackageLockJSON
NewPackageLockJSON is a factory to create an empty (and invalid) PackageLockJSON.
func NewPackageLockJSONFromBytes ¶
func NewPackageLockJSONFromBytes(b []byte) (PackageLockJSON, error)
func NewPackageLockJSONFromDir ¶
func NewPackageLockJSONFromDir(ctx context.Context, dir string) (PackageLockJSON, error)
NewPackageLockJSONFromDir creates a PackageLockJSON instance from the package.json in the dir directory (if any).
func NewPackageLockJSONFromReader ¶
func NewPackageLockJSONFromReader(reader io.Reader) (PackageLockJSON, error)
NewPackageLockJSONFromReader creates a PackageLockJSON instance from by reading the contents of a package-lock.json file.
type VersionResolutionStrategy ¶ added in v0.3.0
type VersionResolutionStrategy func(semver.Collection) *semver.Version
The VersionResolutionStrategy is a function that, given a version constraints, returns back an exact version.