snyk_api

package
v0.0.0-...-28ae1cc Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SastEnabledOperation = "sastEnabled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FFResponse

type FFResponse struct {
	Ok          bool   `json:"ok"`
	UserMessage string `json:"userMessage,omitempty"`
}

type FakeApiClient

type FakeApiClient struct {
	Calls           map[string][][]any
	CodeEnabled     bool
	LocalCodeEngine LocalCodeEngine
	AutofixEnabled  bool
	ApiError        *SnykApiError
	Responses       map[string]any
}

func (*FakeApiClient) Clear

func (f *FakeApiClient) Clear()

func (*FakeApiClient) FeatureFlagStatus

func (f *FakeApiClient) FeatureFlagStatus(featureFlagType FeatureFlagType) (FFResponse, error)

func (*FakeApiClient) GetAllCalls

func (f *FakeApiClient) GetAllCalls(op string) [][]any

func (*FakeApiClient) GetCallParams

func (f *FakeApiClient) GetCallParams(callNo int, op string) []any

func (*FakeApiClient) SastSettings

func (f *FakeApiClient) SastSettings() (SastResponse, error)

func (*FakeApiClient) SetResponse

func (f *FakeApiClient) SetResponse(method string, response any)

type FeatureFlagType

type FeatureFlagType string
const (
	FeatureFlagSnykCodeConsistentIgnores FeatureFlagType = "snykCodeConsistentIgnores"
)

type LocalCodeEngine

type LocalCodeEngine struct {
	AllowCloudUpload bool   `json:"allowCloudUpload"`
	Url              string `json:"url"`
	Enabled          bool   `json:"enabled"`
}

type SastResponse

type SastResponse struct {
	SastEnabled                 bool            `json:"sastEnabled"`
	LocalCodeEngine             LocalCodeEngine `json:"localCodeEngine"`
	Org                         string          `json:"org"`
	SupportedLanguages          []string        `json:"supportedLanguages"`
	ReportFalsePositivesEnabled bool            `json:"reportFalsePositivesEnabled"`
	AutofixEnabled              bool            `json:"autofixEnabled"`
}

type SnykApiClient

type SnykApiClient interface {
	SastSettings() (SastResponse, error)
	FeatureFlagStatus(featureFlagType FeatureFlagType) (FFResponse, error)
}

func NewSnykApiClient

func NewSnykApiClient(c *config.Config, client func() *http.Client) SnykApiClient

type SnykApiClientImpl

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

func (*SnykApiClientImpl) FeatureFlagStatus

func (s *SnykApiClientImpl) FeatureFlagStatus(featureFlagType FeatureFlagType) (FFResponse, error)

func (*SnykApiClientImpl) SastSettings

func (s *SnykApiClientImpl) SastSettings() (SastResponse, error)

type SnykApiError

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

func NewSnykApiError

func NewSnykApiError(msg string, statusCode int) *SnykApiError

func (*SnykApiError) Error

func (e *SnykApiError) Error() string

func (*SnykApiError) StatusCode

func (e *SnykApiError) StatusCode() int

Jump to

Keyboard shortcuts

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