khulnasoft_api

package
v0.0.0-...-df5614f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 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 FakeApiClient

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

func (*FakeApiClient) Clear

func (f *FakeApiClient) Clear()

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)

type KhulnasoftApiClient

type KhulnasoftApiClient interface {
	SastSettings() (SastResponse, error)
}

func NewKhulnasoftApiClient

func NewKhulnasoftApiClient(client func() *http.Client) KhulnasoftApiClient

type KhulnasoftApiClientImpl

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

func (*KhulnasoftApiClientImpl) SastSettings

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

type KhulnasoftApiError

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

func NewKhulnasoftApiError

func NewKhulnasoftApiError(msg string, statusCode int) *KhulnasoftApiError

func (*KhulnasoftApiError) Error

func (e *KhulnasoftApiError) Error() string

func (*KhulnasoftApiError) StatusCode

func (e *KhulnasoftApiError) StatusCode() int

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"`
}

Jump to

Keyboard shortcuts

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