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.
Index ¶
- func WithBaseURL(input string) func(*options)
- func WithContext(input context.Context) func(*options)
- func WithJSONOptions(input flags.JSONFlags) func(*options)
- type AnalysisRequest
- type Context
- type Package
- type Problem
- type Request
- type Response
- type Verdict
- type VerdictsRequest
- func NewBulkVerdictsRequests(names []string, versions semver.Collection) ([]*VerdictsRequest, error)
- func NewBulkVerdictsRequestsFromMap(deps map[string]*semver.Version) ([]*VerdictsRequest, error)
- func NewVerdictsRequest(args []string) (*VerdictsRequest, error)
- func NewVerdictsRequestWithContext(args []string, c *Context) (*VerdictsRequest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBaseURL ¶
func WithBaseURL(input string) func(*options)
func WithContext ¶
func WithJSONOptions ¶
Types ¶
type AnalysisRequest ¶
type AnalysisRequest struct { PackageLockJSON npm.PackageLockJSON `json:"package-lock" name:"package lock" validate:"mandatory"` Context *Context `json:"context,omitempty"` }
func NewAnalysisRequest ¶
func NewAnalysisRequest(packageLockJSON npm.PackageLockJSON) (*AnalysisRequest, error)
func (AnalysisRequest) IsRequest ¶
func (req AnalysisRequest) IsRequest() bool
func (AnalysisRequest) MarshalJSON ¶
func (req AnalysisRequest) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaler that encodes the content of the package lock in the receiving AnalysisRequest.
func (*AnalysisRequest) Ok ¶
func (req *AnalysisRequest) Ok() (bool, error)
type Context ¶
type Context struct { ID uuid.UUID `json:"id"` Version version.Version `json:"version"` Git *git.Context `json:"git,omitempty"` OS *lstnos.Info `json:"os,omitempty"` PMs map[string]string `json:"packagemanagers,omitempty"` }
func NewContext ¶
func NewContext(funcs ...git.GetDirFunc) *Context
type Response ¶
type Response []Package
func BulkPackages ¶ added in v0.3.0
func BulkPackages(requests []*VerdictsRequest, opts ...func(*options)) (*Response, []byte, error)
type VerdictsRequest ¶
type VerdictsRequest struct { Name string `json:"name" name:"name" validate:"mandatory"` Version string `json:"version,omitempty" validate:"omitempty,semver"` Shasum string `json:"shasum,omitempty" validate:"omitempty,shasum"` Context *Context `json:"context,omitempty"` }
VerdictsRequest represents the payload for the verdicts listen.dev endpoint.
func NewBulkVerdictsRequests ¶ added in v0.3.0
func NewBulkVerdictsRequests(names []string, versions semver.Collection) ([]*VerdictsRequest, error)
func NewBulkVerdictsRequestsFromMap ¶ added in v0.3.0
func NewBulkVerdictsRequestsFromMap(deps map[string]*semver.Version) ([]*VerdictsRequest, error)
func NewVerdictsRequest ¶
func NewVerdictsRequest(args []string) (*VerdictsRequest, error)
func NewVerdictsRequestWithContext ¶ added in v0.3.0
func NewVerdictsRequestWithContext(args []string, c *Context) (*VerdictsRequest, error)
func (VerdictsRequest) IsRequest ¶
func (req VerdictsRequest) IsRequest() bool
func (VerdictsRequest) MarshalJSON ¶
func (req VerdictsRequest) MarshalJSON() ([]byte, error)
func (*VerdictsRequest) Ok ¶
func (req *VerdictsRequest) Ok() (bool, error)