sdk

package
v0.0.0-...-0a3c54e Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (
	VERSION             = "0.0.1"
	USER_AGENT          = "go-vulnerability/" + VERSION
	ACCEPT_HEADER       = "application/json"
	CONTENT_TYPE_HEADER = "application/json"
)

Variables

This section is empty.

Functions

func EvaluateVulnerability

func EvaluateVulnerability(vuln *model.Vulnerability) *finding.RiskenTriage

func StructToQueryParams

func StructToQueryParams(data interface{}) (string, error)

Types

type APIError

type APIError struct {
	// StatusCode is the HTTP response status code
	Status  int    `json:"status"`
	Message string `json:"error"`
}

func (APIError) Error

func (a APIError) Error() string

Error satisfies the error interface, and should contain the StatusCode, APIErrorObject.Message, and APIErrorObject.Code.

type Client

type Client struct {
	HTTPClient HTTPClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiEndpoint string, options ...ClientOptions) *Client

func (*Client) Do

func (c *Client) Do(r *http.Request) (*http.Response, error)

Do sets some headers on the request, before actioning it using the internal HTTPClient. This also assumes any request body is in JSON format and sets the Content-Type to application/json.

func (*Client) GetVulnerability

func (*Client) Import

func (*Client) ListVulnerability

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, path string, param string) (*http.Request, error)

type ClientOptions

type ClientOptions func(*Client)

func WithApiKey

func WithApiKey(apiKey string) ClientOptions

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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