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 ¶
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 { 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 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 NewVerdictsRequest ¶
func NewVerdictsRequest(args []string) (*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)