Documentation
¶
Overview ¶
Package client is the ogen-generated Go server + client for the WebSec101 API.
It hosts both the server-side Handler interface (implemented internally by cmd/websec0) and the Client struct (importable by external Go programs). Request and response types are shared between both.
Regenerate with `go generate ./...` (or `make gen`). All other files in this directory are produced by ogen and must not be edited by hand.
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Check
- func (s *Check) Decode(d *jx.Decoder) error
- func (s *Check) Encode(e *jx.Encoder)
- func (s *Check) GetDefaultSeverity() Severity
- func (s *Check) GetDescription() OptString
- func (s *Check) GetFamily() string
- func (s *Check) GetID() string
- func (s *Check) GetRfcRefs() []string
- func (s *Check) GetTitle() OptString
- func (s *Check) MarshalJSON() ([]byte, error)
- func (s *Check) SetDefaultSeverity(val Severity)
- func (s *Check) SetDescription(val OptString)
- func (s *Check) SetFamily(val string)
- func (s *Check) SetID(val string)
- func (s *Check) SetRfcRefs(val []string)
- func (s *Check) SetTitle(val OptString)
- func (s *Check) UnmarshalJSON(data []byte) error
- func (s *Check) Validate() error
- type Client
- func (c *Client) CreateScan(ctx context.Context, request *ScanRequest) (CreateScanRes, error)
- func (c *Client) DeleteScan(ctx context.Context, params DeleteScanParams) (DeleteScanRes, error)
- func (c *Client) GetCheck(ctx context.Context, params GetCheckParams) (GetCheckRes, error)
- func (c *Client) GetHealth(ctx context.Context) (*Health, error)
- func (c *Client) GetOpenAPI(ctx context.Context) (GetOpenAPIOK, error)
- func (c *Client) GetScan(ctx context.Context, params GetScanParams) (GetScanRes, error)
- func (c *Client) GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (GetScanMarkdownRes, error)
- func (c *Client) GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (GetScanSARIFRes, error)
- func (c *Client) GetVersion(ctx context.Context) (*Version, error)
- func (c *Client) ListChecks(ctx context.Context) ([]Check, error)
- type ClientOption
- type CreateScanRes
- type DeleteScanNoContent
- type DeleteScanParams
- type DeleteScanRes
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() string
- func (s *Error) GetDetails() OptErrorDetails
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val string)
- func (s *Error) SetDetails(val OptErrorDetails)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorDetails
- type ErrorHandler
- type ErrorStatusCode
- type Finding
- func (s *Finding) Decode(d *jx.Decoder) error
- func (s *Finding) Encode(e *jx.Encoder)
- func (s *Finding) GetDescription() OptString
- func (s *Finding) GetEvidence() OptFindingEvidence
- func (s *Finding) GetFamily() string
- func (s *Finding) GetID() string
- func (s *Finding) GetRemediation() OptFindingRemediation
- func (s *Finding) GetSeverity() Severity
- func (s *Finding) GetStatus() FindingStatus
- func (s *Finding) GetTitle() OptString
- func (s *Finding) MarshalJSON() ([]byte, error)
- func (s *Finding) SetDescription(val OptString)
- func (s *Finding) SetEvidence(val OptFindingEvidence)
- func (s *Finding) SetFamily(val string)
- func (s *Finding) SetID(val string)
- func (s *Finding) SetRemediation(val OptFindingRemediation)
- func (s *Finding) SetSeverity(val Severity)
- func (s *Finding) SetStatus(val FindingStatus)
- func (s *Finding) SetTitle(val OptString)
- func (s *Finding) UnmarshalJSON(data []byte) error
- func (s *Finding) Validate() error
- type FindingEvidence
- type FindingRemediation
- type FindingStatus
- func (FindingStatus) AllValues() []FindingStatus
- func (s *FindingStatus) Decode(d *jx.Decoder) error
- func (s FindingStatus) Encode(e *jx.Encoder)
- func (s FindingStatus) MarshalJSON() ([]byte, error)
- func (s FindingStatus) MarshalText() ([]byte, error)
- func (s *FindingStatus) UnmarshalJSON(data []byte) error
- func (s *FindingStatus) UnmarshalText(data []byte) error
- func (s FindingStatus) Validate() error
- type GetCheckParams
- type GetCheckRes
- type GetOpenAPIOK
- type GetScanMarkdownOK
- type GetScanMarkdownParams
- type GetScanMarkdownRes
- type GetScanParams
- type GetScanRes
- type GetScanSARIFOK
- type GetScanSARIFParams
- type GetScanSARIFRes
- type Handler
- type Health
- func (s *Health) Decode(d *jx.Decoder) error
- func (s *Health) Encode(e *jx.Encoder)
- func (s *Health) GetStatus() HealthStatus
- func (s *Health) GetUptimeSeconds() int64
- func (s *Health) GetVersion() string
- func (s *Health) MarshalJSON() ([]byte, error)
- func (s *Health) SetStatus(val HealthStatus)
- func (s *Health) SetUptimeSeconds(val int64)
- func (s *Health) SetVersion(val string)
- func (s *Health) UnmarshalJSON(data []byte) error
- func (s *Health) Validate() error
- type HealthStatus
- func (HealthStatus) AllValues() []HealthStatus
- func (s *HealthStatus) Decode(d *jx.Decoder) error
- func (s HealthStatus) Encode(e *jx.Encoder)
- func (s HealthStatus) MarshalJSON() ([]byte, error)
- func (s HealthStatus) MarshalText() ([]byte, error)
- func (s *HealthStatus) UnmarshalJSON(data []byte) error
- func (s *HealthStatus) UnmarshalText(data []byte) error
- func (s HealthStatus) Validate() error
- type Invoker
- type Labeler
- type Middleware
- type OperationName
- type OptBool
- func (o *OptBool) Decode(d *jx.Decoder) error
- func (o OptBool) Encode(e *jx.Encoder)
- func (o OptBool) Get() (v bool, ok bool)
- func (o OptBool) IsSet() bool
- func (s OptBool) MarshalJSON() ([]byte, error)
- func (o OptBool) Or(d bool) bool
- func (o *OptBool) Reset()
- func (o *OptBool) SetTo(v bool)
- func (s *OptBool) UnmarshalJSON(data []byte) error
- type OptDateTime
- func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error
- func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))
- func (o OptDateTime) Get() (v time.Time, ok bool)
- func (o OptDateTime) IsSet() bool
- func (s OptDateTime) MarshalJSON() ([]byte, error)
- func (o OptDateTime) Or(d time.Time) time.Time
- func (o *OptDateTime) Reset()
- func (o *OptDateTime) SetTo(v time.Time)
- func (s *OptDateTime) UnmarshalJSON(data []byte) error
- type OptErrorDetails
- func (o *OptErrorDetails) Decode(d *jx.Decoder) error
- func (o OptErrorDetails) Encode(e *jx.Encoder)
- func (o OptErrorDetails) Get() (v ErrorDetails, ok bool)
- func (o OptErrorDetails) IsSet() bool
- func (s OptErrorDetails) MarshalJSON() ([]byte, error)
- func (o OptErrorDetails) Or(d ErrorDetails) ErrorDetails
- func (o *OptErrorDetails) Reset()
- func (o *OptErrorDetails) SetTo(v ErrorDetails)
- func (s *OptErrorDetails) UnmarshalJSON(data []byte) error
- type OptFindingEvidence
- func (o *OptFindingEvidence) Decode(d *jx.Decoder) error
- func (o OptFindingEvidence) Encode(e *jx.Encoder)
- func (o OptFindingEvidence) Get() (v FindingEvidence, ok bool)
- func (o OptFindingEvidence) IsSet() bool
- func (s OptFindingEvidence) MarshalJSON() ([]byte, error)
- func (o OptFindingEvidence) Or(d FindingEvidence) FindingEvidence
- func (o *OptFindingEvidence) Reset()
- func (o *OptFindingEvidence) SetTo(v FindingEvidence)
- func (s *OptFindingEvidence) UnmarshalJSON(data []byte) error
- type OptFindingRemediation
- func (o *OptFindingRemediation) Decode(d *jx.Decoder) error
- func (o OptFindingRemediation) Encode(e *jx.Encoder)
- func (o OptFindingRemediation) Get() (v FindingRemediation, ok bool)
- func (o OptFindingRemediation) IsSet() bool
- func (s OptFindingRemediation) MarshalJSON() ([]byte, error)
- func (o OptFindingRemediation) Or(d FindingRemediation) FindingRemediation
- func (o *OptFindingRemediation) Reset()
- func (o *OptFindingRemediation) SetTo(v FindingRemediation)
- func (s *OptFindingRemediation) UnmarshalJSON(data []byte) error
- type OptInt
- func (o *OptInt) Decode(d *jx.Decoder) error
- func (o OptInt) Encode(e *jx.Encoder)
- func (o OptInt) Get() (v int, ok bool)
- func (o OptInt) IsSet() bool
- func (s OptInt) MarshalJSON() ([]byte, error)
- func (o OptInt) Or(d int) int
- func (o *OptInt) Reset()
- func (o *OptInt) SetTo(v int)
- func (s *OptInt) UnmarshalJSON(data []byte) error
- type OptProgress
- func (o *OptProgress) Decode(d *jx.Decoder) error
- func (o OptProgress) Encode(e *jx.Encoder)
- func (o OptProgress) Get() (v Progress, ok bool)
- func (o OptProgress) IsSet() bool
- func (s OptProgress) MarshalJSON() ([]byte, error)
- func (o OptProgress) Or(d Progress) Progress
- func (o *OptProgress) Reset()
- func (o *OptProgress) SetTo(v Progress)
- func (s *OptProgress) UnmarshalJSON(data []byte) error
- type OptScanOptions
- func (o *OptScanOptions) Decode(d *jx.Decoder) error
- func (o OptScanOptions) Encode(e *jx.Encoder)
- func (o OptScanOptions) Get() (v ScanOptions, ok bool)
- func (o OptScanOptions) IsSet() bool
- func (s OptScanOptions) MarshalJSON() ([]byte, error)
- func (o OptScanOptions) Or(d ScanOptions) ScanOptions
- func (o *OptScanOptions) Reset()
- func (o *OptScanOptions) SetTo(v ScanOptions)
- func (s *OptScanOptions) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type Progress
- func (s *Progress) Decode(d *jx.Decoder) error
- func (s *Progress) Encode(e *jx.Encoder)
- func (s *Progress) GetCompleted() int
- func (s *Progress) GetCurrentPhase() OptString
- func (s *Progress) GetTotal() int
- func (s *Progress) MarshalJSON() ([]byte, error)
- func (s *Progress) SetCompleted(val int)
- func (s *Progress) SetCurrentPhase(val OptString)
- func (s *Progress) SetTotal(val int)
- func (s *Progress) UnmarshalJSON(data []byte) error
- type Route
- type Scan
- func (s *Scan) Decode(d *jx.Decoder) error
- func (s *Scan) Encode(e *jx.Encoder)
- func (s *Scan) GetCompletedAt() OptDateTime
- func (s *Scan) GetError() OptString
- func (s *Scan) GetFindings() []Finding
- func (s *Scan) GetGrade() OptString
- func (s *Scan) GetID() uuid.UUID
- func (s *Scan) GetLinks() ScanLinks
- func (s *Scan) GetProgress() OptProgress
- func (s *Scan) GetScore() OptInt
- func (s *Scan) GetStartedAt() time.Time
- func (s *Scan) GetStatus() ScanStatus
- func (s *Scan) GetTarget() string
- func (s *Scan) MarshalJSON() ([]byte, error)
- func (s *Scan) SetCompletedAt(val OptDateTime)
- func (s *Scan) SetError(val OptString)
- func (s *Scan) SetFindings(val []Finding)
- func (s *Scan) SetGrade(val OptString)
- func (s *Scan) SetID(val uuid.UUID)
- func (s *Scan) SetLinks(val ScanLinks)
- func (s *Scan) SetProgress(val OptProgress)
- func (s *Scan) SetScore(val OptInt)
- func (s *Scan) SetStartedAt(val time.Time)
- func (s *Scan) SetStatus(val ScanStatus)
- func (s *Scan) SetTarget(val string)
- func (s *Scan) UnmarshalJSON(data []byte) error
- func (s *Scan) Validate() error
- type ScanCreated
- func (s *ScanCreated) Decode(d *jx.Decoder) error
- func (s *ScanCreated) Encode(e *jx.Encoder)
- func (s *ScanCreated) GetID() uuid.UUID
- func (s *ScanCreated) GetLinks() ScanLinks
- func (s *ScanCreated) GetPrivateToken() OptString
- func (s *ScanCreated) GetStatus() ScanStatus
- func (s *ScanCreated) GetTarget() string
- func (s *ScanCreated) MarshalJSON() ([]byte, error)
- func (s *ScanCreated) SetID(val uuid.UUID)
- func (s *ScanCreated) SetLinks(val ScanLinks)
- func (s *ScanCreated) SetPrivateToken(val OptString)
- func (s *ScanCreated) SetStatus(val ScanStatus)
- func (s *ScanCreated) SetTarget(val string)
- func (s *ScanCreated) UnmarshalJSON(data []byte) error
- func (s *ScanCreated) Validate() error
- type ScanCreatedHeaders
- func (s *ScanCreatedHeaders) GetLocation() OptString
- func (s *ScanCreatedHeaders) GetResponse() ScanCreated
- func (s *ScanCreatedHeaders) GetRetryAfter() OptInt
- func (s *ScanCreatedHeaders) SetLocation(val OptString)
- func (s *ScanCreatedHeaders) SetResponse(val ScanCreated)
- func (s *ScanCreatedHeaders) SetRetryAfter(val OptInt)
- func (s *ScanCreatedHeaders) Validate() error
- type ScanLinks
- func (s *ScanLinks) Decode(d *jx.Decoder) error
- func (s *ScanLinks) Encode(e *jx.Encoder)
- func (s *ScanLinks) GetEvents() OptString
- func (s *ScanLinks) GetMarkdown() OptString
- func (s *ScanLinks) GetSarif() OptString
- func (s *ScanLinks) GetSelf() string
- func (s *ScanLinks) MarshalJSON() ([]byte, error)
- func (s *ScanLinks) SetEvents(val OptString)
- func (s *ScanLinks) SetMarkdown(val OptString)
- func (s *ScanLinks) SetSarif(val OptString)
- func (s *ScanLinks) SetSelf(val string)
- func (s *ScanLinks) UnmarshalJSON(data []byte) error
- type ScanOptions
- func (s *ScanOptions) Decode(d *jx.Decoder) error
- func (s *ScanOptions) Encode(e *jx.Encoder)
- func (s *ScanOptions) GetPrivate() OptBool
- func (s *ScanOptions) GetSkipCategories() []string
- func (s *ScanOptions) GetWaitSeconds() OptInt
- func (s *ScanOptions) MarshalJSON() ([]byte, error)
- func (s *ScanOptions) SetPrivate(val OptBool)
- func (s *ScanOptions) SetSkipCategories(val []string)
- func (s *ScanOptions) SetWaitSeconds(val OptInt)
- func (s *ScanOptions) UnmarshalJSON(data []byte) error
- func (s *ScanOptions) Validate() error
- type ScanRequest
- func (s *ScanRequest) Decode(d *jx.Decoder) error
- func (s *ScanRequest) Encode(e *jx.Encoder)
- func (s *ScanRequest) GetOptions() OptScanOptions
- func (s *ScanRequest) GetTarget() string
- func (s *ScanRequest) MarshalJSON() ([]byte, error)
- func (s *ScanRequest) SetOptions(val OptScanOptions)
- func (s *ScanRequest) SetTarget(val string)
- func (s *ScanRequest) UnmarshalJSON(data []byte) error
- func (s *ScanRequest) Validate() error
- type ScanStatus
- func (ScanStatus) AllValues() []ScanStatus
- func (s *ScanStatus) Decode(d *jx.Decoder) error
- func (s ScanStatus) Encode(e *jx.Encoder)
- func (s ScanStatus) MarshalJSON() ([]byte, error)
- func (s ScanStatus) MarshalText() ([]byte, error)
- func (s *ScanStatus) UnmarshalJSON(data []byte) error
- func (s *ScanStatus) UnmarshalText(data []byte) error
- func (s ScanStatus) Validate() error
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type Severity
- func (Severity) AllValues() []Severity
- func (s *Severity) Decode(d *jx.Decoder) error
- func (s Severity) Encode(e *jx.Encoder)
- func (s Severity) MarshalJSON() ([]byte, error)
- func (s Severity) MarshalText() ([]byte, error)
- func (s *Severity) UnmarshalJSON(data []byte) error
- func (s *Severity) UnmarshalText(data []byte) error
- func (s Severity) Validate() error
- type UnimplementedHandler
- func (UnimplementedHandler) CreateScan(ctx context.Context, req *ScanRequest) (r CreateScanRes, _ error)
- func (UnimplementedHandler) DeleteScan(ctx context.Context, params DeleteScanParams) (r DeleteScanRes, _ error)
- func (UnimplementedHandler) GetCheck(ctx context.Context, params GetCheckParams) (r GetCheckRes, _ error)
- func (UnimplementedHandler) GetHealth(ctx context.Context) (r *Health, _ error)
- func (UnimplementedHandler) GetOpenAPI(ctx context.Context) (r GetOpenAPIOK, _ error)
- func (UnimplementedHandler) GetScan(ctx context.Context, params GetScanParams) (r GetScanRes, _ error)
- func (UnimplementedHandler) GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (r GetScanMarkdownRes, _ error)
- func (UnimplementedHandler) GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (r GetScanSARIFRes, _ error)
- func (UnimplementedHandler) GetVersion(ctx context.Context) (r *Version, _ error)
- func (UnimplementedHandler) ListChecks(ctx context.Context) (r []Check, _ error)
- type Version
- func (s *Version) Decode(d *jx.Decoder) error
- func (s *Version) Encode(e *jx.Encoder)
- func (s *Version) GetBuildDate() string
- func (s *Version) GetCommit() string
- func (s *Version) GetVersion() string
- func (s *Version) MarshalJSON() ([]byte, error)
- func (s *Version) SetBuildDate(val string)
- func (s *Version) SetCommit(val string)
- func (s *Version) SetVersion(val string)
- func (s *Version) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Family string `json:"family"`
DefaultSeverity Severity `json:"default_severity"`
Title OptString `json:"title"`
Description OptString `json:"description"`
RfcRefs []string `json:"rfc_refs"`
}
Ref: #/components/schemas/Check
func (*Check) GetDefaultSeverity ¶
GetDefaultSeverity returns the value of DefaultSeverity.
func (*Check) GetDescription ¶
GetDescription returns the value of Description.
func (*Check) GetRfcRefs ¶
GetRfcRefs returns the value of RfcRefs.
func (*Check) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Check) SetDefaultSeverity ¶
SetDefaultSeverity sets the value of DefaultSeverity.
func (*Check) SetDescription ¶
SetDescription sets the value of Description.
func (*Check) SetRfcRefs ¶
SetRfcRefs sets the value of RfcRefs.
func (*Check) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) CreateScan ¶
func (c *Client) CreateScan(ctx context.Context, request *ScanRequest) (CreateScanRes, error)
CreateScan invokes createScan operation.
Always returns 202 with a freshly minted GUIDv4 and a `Location` header. Use `options.wait_seconds` for short synchronous waits.
POST /api/v1/scans
func (*Client) DeleteScan ¶
func (c *Client) DeleteScan(ctx context.Context, params DeleteScanParams) (DeleteScanRes, error)
DeleteScan invokes deleteScan operation.
Delete a scan (private mode requires token).
DELETE /api/v1/scans/{guid}
func (*Client) GetCheck ¶
func (c *Client) GetCheck(ctx context.Context, params GetCheckParams) (GetCheckRes, error)
GetCheck invokes getCheck operation.
Fetch a single check definition.
GET /api/v1/checks/{check_id}
func (*Client) GetHealth ¶
GetHealth invokes getHealth operation.
Liveness/health probe.
GET /api/v1/health
func (*Client) GetOpenAPI ¶
func (c *Client) GetOpenAPI(ctx context.Context) (GetOpenAPIOK, error)
GetOpenAPI invokes getOpenAPI operation.
Embedded OpenAPI 3.0 specification.
GET /api/v1/openapi.json
func (*Client) GetScan ¶
func (c *Client) GetScan(ctx context.Context, params GetScanParams) (GetScanRes, error)
GetScan invokes getScan operation.
Fetch a scan (always 200).
GET /api/v1/scans/{guid}
func (*Client) GetScanMarkdown ¶
func (c *Client) GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (GetScanMarkdownRes, error)
GetScanMarkdown invokes getScanMarkdown operation.
Markdown report.
GET /api/v1/scans/{guid}/markdown
func (*Client) GetScanSARIF ¶
func (c *Client) GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (GetScanSARIFRes, error)
GetScanSARIF invokes getScanSARIF operation.
SARIF 2.1.0 report.
GET /api/v1/scans/{guid}/sarif
func (*Client) GetVersion ¶
GetVersion invokes getVersion operation.
Build metadata.
GET /api/v1/version
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type CreateScanRes ¶
type CreateScanRes interface {
// contains filtered or unexported methods
}
type DeleteScanNoContent ¶
type DeleteScanNoContent struct{}
DeleteScanNoContent is response for DeleteScan operation.
type DeleteScanParams ¶
DeleteScanParams is parameters of deleteScan operation.
type DeleteScanRes ¶
type DeleteScanRes interface {
// contains filtered or unexported methods
}
type Error ¶
type Error struct {
Code string `json:"code"`
Message string `json:"message"`
Details OptErrorDetails `json:"details"`
}
Ref: #/components/schemas/Error
func (*Error) GetDetails ¶
func (s *Error) GetDetails() OptErrorDetails
GetDetails returns the value of Details.
func (*Error) GetMessage ¶
GetMessage returns the value of Message.
func (*Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) SetDetails ¶
func (s *Error) SetDetails(val OptErrorDetails)
SetDetails sets the value of Details.
func (*Error) SetMessage ¶
SetMessage sets the value of Message.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorDetails ¶
func (*ErrorDetails) Decode ¶
func (s *ErrorDetails) Decode(d *jx.Decoder) error
Decode decodes ErrorDetails from json.
func (ErrorDetails) Encode ¶
func (s ErrorDetails) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (ErrorDetails) MarshalJSON ¶
func (s ErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ErrorDetails) UnmarshalJSON ¶
func (s *ErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorStatusCode ¶
ErrorStatusCode wraps Error with StatusCode.
func (*ErrorStatusCode) GetResponse ¶
func (s *ErrorStatusCode) GetResponse() Error
GetResponse returns the value of Response.
func (*ErrorStatusCode) GetStatusCode ¶
func (s *ErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*ErrorStatusCode) SetResponse ¶
func (s *ErrorStatusCode) SetResponse(val Error)
SetResponse sets the value of Response.
func (*ErrorStatusCode) SetStatusCode ¶
func (s *ErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type Finding ¶
type Finding struct {
ID string `json:"id"`
Family string `json:"family"`
Severity Severity `json:"severity"`
Status FindingStatus `json:"status"`
Title OptString `json:"title"`
Description OptString `json:"description"`
Evidence OptFindingEvidence `json:"evidence"`
Remediation OptFindingRemediation `json:"remediation"`
}
Ref: #/components/schemas/Finding
func (*Finding) GetDescription ¶
GetDescription returns the value of Description.
func (*Finding) GetEvidence ¶
func (s *Finding) GetEvidence() OptFindingEvidence
GetEvidence returns the value of Evidence.
func (*Finding) GetRemediation ¶
func (s *Finding) GetRemediation() OptFindingRemediation
GetRemediation returns the value of Remediation.
func (*Finding) GetSeverity ¶
GetSeverity returns the value of Severity.
func (*Finding) GetStatus ¶
func (s *Finding) GetStatus() FindingStatus
GetStatus returns the value of Status.
func (*Finding) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Finding) SetDescription ¶
SetDescription sets the value of Description.
func (*Finding) SetEvidence ¶
func (s *Finding) SetEvidence(val OptFindingEvidence)
SetEvidence sets the value of Evidence.
func (*Finding) SetRemediation ¶
func (s *Finding) SetRemediation(val OptFindingRemediation)
SetRemediation sets the value of Remediation.
func (*Finding) SetSeverity ¶
SetSeverity sets the value of Severity.
func (*Finding) SetStatus ¶
func (s *Finding) SetStatus(val FindingStatus)
SetStatus sets the value of Status.
func (*Finding) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type FindingEvidence ¶
func (*FindingEvidence) Decode ¶
func (s *FindingEvidence) Decode(d *jx.Decoder) error
Decode decodes FindingEvidence from json.
func (FindingEvidence) Encode ¶
func (s FindingEvidence) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (FindingEvidence) MarshalJSON ¶
func (s FindingEvidence) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*FindingEvidence) UnmarshalJSON ¶
func (s *FindingEvidence) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type FindingRemediation ¶
func (*FindingRemediation) Decode ¶
func (s *FindingRemediation) Decode(d *jx.Decoder) error
Decode decodes FindingRemediation from json.
func (FindingRemediation) Encode ¶
func (s FindingRemediation) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (FindingRemediation) MarshalJSON ¶
func (s FindingRemediation) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*FindingRemediation) UnmarshalJSON ¶
func (s *FindingRemediation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type FindingStatus ¶
type FindingStatus string
Ref: #/components/schemas/FindingStatus
const ( FindingStatusPass FindingStatus = "pass" FindingStatusFail FindingStatus = "fail" FindingStatusWarn FindingStatus = "warn" FindingStatusError FindingStatus = "error" FindingStatusSkipped FindingStatus = "skipped" )
func (FindingStatus) AllValues ¶
func (FindingStatus) AllValues() []FindingStatus
AllValues returns all FindingStatus values.
func (*FindingStatus) Decode ¶
func (s *FindingStatus) Decode(d *jx.Decoder) error
Decode decodes FindingStatus from json.
func (FindingStatus) Encode ¶
func (s FindingStatus) Encode(e *jx.Encoder)
Encode encodes FindingStatus as json.
func (FindingStatus) MarshalJSON ¶
func (s FindingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (FindingStatus) MarshalText ¶
func (s FindingStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*FindingStatus) UnmarshalJSON ¶
func (s *FindingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*FindingStatus) UnmarshalText ¶
func (s *FindingStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (FindingStatus) Validate ¶
func (s FindingStatus) Validate() error
type GetCheckParams ¶
type GetCheckParams struct {
// Stable check identifier (SCREAMING-KEBAB-CASE).
CheckID string
}
GetCheckParams is parameters of getCheck operation.
type GetCheckRes ¶
type GetCheckRes interface {
// contains filtered or unexported methods
}
type GetOpenAPIOK ¶
func (*GetOpenAPIOK) Decode ¶
func (s *GetOpenAPIOK) Decode(d *jx.Decoder) error
Decode decodes GetOpenAPIOK from json.
func (GetOpenAPIOK) Encode ¶
func (s GetOpenAPIOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (GetOpenAPIOK) MarshalJSON ¶
func (s GetOpenAPIOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetOpenAPIOK) UnmarshalJSON ¶
func (s *GetOpenAPIOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetScanMarkdownOK ¶
type GetScanMarkdownParams ¶
GetScanMarkdownParams is parameters of getScanMarkdown operation.
type GetScanMarkdownRes ¶
type GetScanMarkdownRes interface {
// contains filtered or unexported methods
}
type GetScanParams ¶
GetScanParams is parameters of getScan operation.
type GetScanRes ¶
type GetScanRes interface {
// contains filtered or unexported methods
}
type GetScanSARIFOK ¶
func (*GetScanSARIFOK) Decode ¶
func (s *GetScanSARIFOK) Decode(d *jx.Decoder) error
Decode decodes GetScanSARIFOK from json.
func (GetScanSARIFOK) Encode ¶
func (s GetScanSARIFOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (GetScanSARIFOK) MarshalJSON ¶
func (s GetScanSARIFOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetScanSARIFOK) UnmarshalJSON ¶
func (s *GetScanSARIFOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetScanSARIFParams ¶
GetScanSARIFParams is parameters of getScanSARIF operation.
type GetScanSARIFRes ¶
type GetScanSARIFRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// CreateScan implements createScan operation.
//
// Always returns 202 with a freshly minted GUIDv4 and a `Location`
// header. Use `options.wait_seconds` for short synchronous waits.
//
// POST /api/v1/scans
CreateScan(ctx context.Context, req *ScanRequest) (CreateScanRes, error)
// DeleteScan implements deleteScan operation.
//
// Delete a scan (private mode requires token).
//
// DELETE /api/v1/scans/{guid}
DeleteScan(ctx context.Context, params DeleteScanParams) (DeleteScanRes, error)
// GetCheck implements getCheck operation.
//
// Fetch a single check definition.
//
// GET /api/v1/checks/{check_id}
GetCheck(ctx context.Context, params GetCheckParams) (GetCheckRes, error)
// GetHealth implements getHealth operation.
//
// Liveness/health probe.
//
// GET /api/v1/health
GetHealth(ctx context.Context) (*Health, error)
// GetOpenAPI implements getOpenAPI operation.
//
// Embedded OpenAPI 3.0 specification.
//
// GET /api/v1/openapi.json
GetOpenAPI(ctx context.Context) (GetOpenAPIOK, error)
// GetScan implements getScan operation.
//
// Fetch a scan (always 200).
//
// GET /api/v1/scans/{guid}
GetScan(ctx context.Context, params GetScanParams) (GetScanRes, error)
// GetScanMarkdown implements getScanMarkdown operation.
//
// Markdown report.
//
// GET /api/v1/scans/{guid}/markdown
GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (GetScanMarkdownRes, error)
// GetScanSARIF implements getScanSARIF operation.
//
// SARIF 2.1.0 report.
//
// GET /api/v1/scans/{guid}/sarif
GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (GetScanSARIFRes, error)
// GetVersion implements getVersion operation.
//
// Build metadata.
//
// GET /api/v1/version
GetVersion(ctx context.Context) (*Version, error)
// ListChecks implements listChecks operation.
//
// List all supported checks.
//
// GET /api/v1/checks
ListChecks(ctx context.Context) ([]Check, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Health ¶
type Health struct {
Status HealthStatus `json:"status"`
UptimeSeconds int64 `json:"uptime_seconds"`
Version string `json:"version"`
}
Ref: #/components/schemas/Health
func (*Health) GetStatus ¶
func (s *Health) GetStatus() HealthStatus
GetStatus returns the value of Status.
func (*Health) GetUptimeSeconds ¶
GetUptimeSeconds returns the value of UptimeSeconds.
func (*Health) GetVersion ¶
GetVersion returns the value of Version.
func (*Health) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Health) SetStatus ¶
func (s *Health) SetStatus(val HealthStatus)
SetStatus sets the value of Status.
func (*Health) SetUptimeSeconds ¶
SetUptimeSeconds sets the value of UptimeSeconds.
func (*Health) SetVersion ¶
SetVersion sets the value of Version.
func (*Health) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type HealthStatus ¶
type HealthStatus string
const (
HealthStatusOk HealthStatus = "ok"
)
func (HealthStatus) AllValues ¶
func (HealthStatus) AllValues() []HealthStatus
AllValues returns all HealthStatus values.
func (*HealthStatus) Decode ¶
func (s *HealthStatus) Decode(d *jx.Decoder) error
Decode decodes HealthStatus from json.
func (HealthStatus) Encode ¶
func (s HealthStatus) Encode(e *jx.Encoder)
Encode encodes HealthStatus as json.
func (HealthStatus) MarshalJSON ¶
func (s HealthStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (HealthStatus) MarshalText ¶
func (s HealthStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*HealthStatus) UnmarshalJSON ¶
func (s *HealthStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*HealthStatus) UnmarshalText ¶
func (s *HealthStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (HealthStatus) Validate ¶
func (s HealthStatus) Validate() error
type Invoker ¶
type Invoker interface {
// CreateScan invokes createScan operation.
//
// Always returns 202 with a freshly minted GUIDv4 and a `Location`
// header. Use `options.wait_seconds` for short synchronous waits.
//
// POST /api/v1/scans
CreateScan(ctx context.Context, request *ScanRequest) (CreateScanRes, error)
// DeleteScan invokes deleteScan operation.
//
// Delete a scan (private mode requires token).
//
// DELETE /api/v1/scans/{guid}
DeleteScan(ctx context.Context, params DeleteScanParams) (DeleteScanRes, error)
// GetCheck invokes getCheck operation.
//
// Fetch a single check definition.
//
// GET /api/v1/checks/{check_id}
GetCheck(ctx context.Context, params GetCheckParams) (GetCheckRes, error)
// GetHealth invokes getHealth operation.
//
// Liveness/health probe.
//
// GET /api/v1/health
GetHealth(ctx context.Context) (*Health, error)
// GetOpenAPI invokes getOpenAPI operation.
//
// Embedded OpenAPI 3.0 specification.
//
// GET /api/v1/openapi.json
GetOpenAPI(ctx context.Context) (GetOpenAPIOK, error)
// GetScan invokes getScan operation.
//
// Fetch a scan (always 200).
//
// GET /api/v1/scans/{guid}
GetScan(ctx context.Context, params GetScanParams) (GetScanRes, error)
// GetScanMarkdown invokes getScanMarkdown operation.
//
// Markdown report.
//
// GET /api/v1/scans/{guid}/markdown
GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (GetScanMarkdownRes, error)
// GetScanSARIF invokes getScanSARIF operation.
//
// SARIF 2.1.0 report.
//
// GET /api/v1/scans/{guid}/sarif
GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (GetScanSARIFRes, error)
// GetVersion invokes getVersion operation.
//
// Build metadata.
//
// GET /api/v1/version
GetVersion(ctx context.Context) (*Version, error)
// ListChecks invokes listChecks operation.
//
// List all supported checks.
//
// GET /api/v1/checks
ListChecks(ctx context.Context) ([]Check, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler is used to allow adding custom attributes to the server request metrics.
func LabelerFromContext ¶
LabelerFromContext retrieves the Labeler from the provided context, if present.
If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
func (*Labeler) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( CreateScanOperation OperationName = "CreateScan" DeleteScanOperation OperationName = "DeleteScan" GetCheckOperation OperationName = "GetCheck" GetHealthOperation OperationName = "GetHealth" GetOpenAPIOperation OperationName = "GetOpenAPI" GetScanOperation OperationName = "GetScan" GetScanMarkdownOperation OperationName = "GetScanMarkdown" GetScanSARIFOperation OperationName = "GetScanSARIF" GetVersionOperation OperationName = "GetVersion" ListChecksOperation OperationName = "ListChecks" )
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
func (OptBool) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptBool) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptDateTime ¶
OptDateTime is optional time.Time.
func NewOptDateTime ¶
func NewOptDateTime(v time.Time) OptDateTime
NewOptDateTime returns new OptDateTime with value set to v.
func (OptDateTime) Get ¶
func (o OptDateTime) Get() (v time.Time, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptDateTime) IsSet ¶
func (o OptDateTime) IsSet() bool
IsSet returns true if OptDateTime was set.
func (OptDateTime) MarshalJSON ¶
func (s OptDateTime) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptDateTime) Or ¶
func (o OptDateTime) Or(d time.Time) time.Time
Or returns value if set, or given parameter if does not.
func (*OptDateTime) UnmarshalJSON ¶
func (s *OptDateTime) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptErrorDetails ¶
type OptErrorDetails struct {
Value ErrorDetails
Set bool
}
OptErrorDetails is optional ErrorDetails.
func NewOptErrorDetails ¶
func NewOptErrorDetails(v ErrorDetails) OptErrorDetails
NewOptErrorDetails returns new OptErrorDetails with value set to v.
func (*OptErrorDetails) Decode ¶
func (o *OptErrorDetails) Decode(d *jx.Decoder) error
Decode decodes ErrorDetails from json.
func (OptErrorDetails) Encode ¶
func (o OptErrorDetails) Encode(e *jx.Encoder)
Encode encodes ErrorDetails as json.
func (OptErrorDetails) Get ¶
func (o OptErrorDetails) Get() (v ErrorDetails, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptErrorDetails) IsSet ¶
func (o OptErrorDetails) IsSet() bool
IsSet returns true if OptErrorDetails was set.
func (OptErrorDetails) MarshalJSON ¶
func (s OptErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptErrorDetails) Or ¶
func (o OptErrorDetails) Or(d ErrorDetails) ErrorDetails
Or returns value if set, or given parameter if does not.
func (*OptErrorDetails) SetTo ¶
func (o *OptErrorDetails) SetTo(v ErrorDetails)
SetTo sets value to v.
func (*OptErrorDetails) UnmarshalJSON ¶
func (s *OptErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptFindingEvidence ¶
type OptFindingEvidence struct {
Value FindingEvidence
Set bool
}
OptFindingEvidence is optional FindingEvidence.
func NewOptFindingEvidence ¶
func NewOptFindingEvidence(v FindingEvidence) OptFindingEvidence
NewOptFindingEvidence returns new OptFindingEvidence with value set to v.
func (*OptFindingEvidence) Decode ¶
func (o *OptFindingEvidence) Decode(d *jx.Decoder) error
Decode decodes FindingEvidence from json.
func (OptFindingEvidence) Encode ¶
func (o OptFindingEvidence) Encode(e *jx.Encoder)
Encode encodes FindingEvidence as json.
func (OptFindingEvidence) Get ¶
func (o OptFindingEvidence) Get() (v FindingEvidence, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptFindingEvidence) IsSet ¶
func (o OptFindingEvidence) IsSet() bool
IsSet returns true if OptFindingEvidence was set.
func (OptFindingEvidence) MarshalJSON ¶
func (s OptFindingEvidence) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptFindingEvidence) Or ¶
func (o OptFindingEvidence) Or(d FindingEvidence) FindingEvidence
Or returns value if set, or given parameter if does not.
func (*OptFindingEvidence) SetTo ¶
func (o *OptFindingEvidence) SetTo(v FindingEvidence)
SetTo sets value to v.
func (*OptFindingEvidence) UnmarshalJSON ¶
func (s *OptFindingEvidence) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptFindingRemediation ¶
type OptFindingRemediation struct {
Value FindingRemediation
Set bool
}
OptFindingRemediation is optional FindingRemediation.
func NewOptFindingRemediation ¶
func NewOptFindingRemediation(v FindingRemediation) OptFindingRemediation
NewOptFindingRemediation returns new OptFindingRemediation with value set to v.
func (*OptFindingRemediation) Decode ¶
func (o *OptFindingRemediation) Decode(d *jx.Decoder) error
Decode decodes FindingRemediation from json.
func (OptFindingRemediation) Encode ¶
func (o OptFindingRemediation) Encode(e *jx.Encoder)
Encode encodes FindingRemediation as json.
func (OptFindingRemediation) Get ¶
func (o OptFindingRemediation) Get() (v FindingRemediation, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptFindingRemediation) IsSet ¶
func (o OptFindingRemediation) IsSet() bool
IsSet returns true if OptFindingRemediation was set.
func (OptFindingRemediation) MarshalJSON ¶
func (s OptFindingRemediation) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptFindingRemediation) Or ¶
func (o OptFindingRemediation) Or(d FindingRemediation) FindingRemediation
Or returns value if set, or given parameter if does not.
func (*OptFindingRemediation) SetTo ¶
func (o *OptFindingRemediation) SetTo(v FindingRemediation)
SetTo sets value to v.
func (*OptFindingRemediation) UnmarshalJSON ¶
func (s *OptFindingRemediation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptProgress ¶
OptProgress is optional Progress.
func NewOptProgress ¶
func NewOptProgress(v Progress) OptProgress
NewOptProgress returns new OptProgress with value set to v.
func (*OptProgress) Decode ¶
func (o *OptProgress) Decode(d *jx.Decoder) error
Decode decodes Progress from json.
func (OptProgress) Encode ¶
func (o OptProgress) Encode(e *jx.Encoder)
Encode encodes Progress as json.
func (OptProgress) Get ¶
func (o OptProgress) Get() (v Progress, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptProgress) IsSet ¶
func (o OptProgress) IsSet() bool
IsSet returns true if OptProgress was set.
func (OptProgress) MarshalJSON ¶
func (s OptProgress) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptProgress) Or ¶
func (o OptProgress) Or(d Progress) Progress
Or returns value if set, or given parameter if does not.
func (*OptProgress) UnmarshalJSON ¶
func (s *OptProgress) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptScanOptions ¶
type OptScanOptions struct {
Value ScanOptions
Set bool
}
OptScanOptions is optional ScanOptions.
func NewOptScanOptions ¶
func NewOptScanOptions(v ScanOptions) OptScanOptions
NewOptScanOptions returns new OptScanOptions with value set to v.
func (*OptScanOptions) Decode ¶
func (o *OptScanOptions) Decode(d *jx.Decoder) error
Decode decodes ScanOptions from json.
func (OptScanOptions) Encode ¶
func (o OptScanOptions) Encode(e *jx.Encoder)
Encode encodes ScanOptions as json.
func (OptScanOptions) Get ¶
func (o OptScanOptions) Get() (v ScanOptions, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptScanOptions) IsSet ¶
func (o OptScanOptions) IsSet() bool
IsSet returns true if OptScanOptions was set.
func (OptScanOptions) MarshalJSON ¶
func (s OptScanOptions) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptScanOptions) Or ¶
func (o OptScanOptions) Or(d ScanOptions) ScanOptions
Or returns value if set, or given parameter if does not.
func (*OptScanOptions) UnmarshalJSON ¶
func (s *OptScanOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithAttributes ¶
WithAttributes specifies default otel attributes.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type Progress ¶
type Progress struct {
Total int `json:"total"`
Completed int `json:"completed"`
CurrentPhase OptString `json:"current_phase"`
}
Ref: #/components/schemas/Progress
func (*Progress) GetCompleted ¶
GetCompleted returns the value of Completed.
func (*Progress) GetCurrentPhase ¶
GetCurrentPhase returns the value of CurrentPhase.
func (*Progress) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Progress) SetCompleted ¶
SetCompleted sets the value of Completed.
func (*Progress) SetCurrentPhase ¶
SetCurrentPhase sets the value of CurrentPhase.
func (*Progress) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationGroup ¶
OperationGroup returns the x-ogen-operation-group value.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type Scan ¶
type Scan struct {
ID uuid.UUID `json:"id"`
Status ScanStatus `json:"status"`
Target string `json:"target"`
StartedAt time.Time `json:"started_at"`
CompletedAt OptDateTime `json:"completed_at"`
Progress OptProgress `json:"progress"`
Links ScanLinks `json:"links"`
Findings []Finding `json:"findings"`
Grade OptString `json:"grade"`
Score OptInt `json:"score"`
Error OptString `json:"error"`
}
Ref: #/components/schemas/Scan
func (*Scan) GetCompletedAt ¶
func (s *Scan) GetCompletedAt() OptDateTime
GetCompletedAt returns the value of CompletedAt.
func (*Scan) GetFindings ¶
GetFindings returns the value of Findings.
func (*Scan) GetProgress ¶
func (s *Scan) GetProgress() OptProgress
GetProgress returns the value of Progress.
func (*Scan) GetStartedAt ¶
GetStartedAt returns the value of StartedAt.
func (*Scan) GetStatus ¶
func (s *Scan) GetStatus() ScanStatus
GetStatus returns the value of Status.
func (*Scan) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Scan) SetCompletedAt ¶
func (s *Scan) SetCompletedAt(val OptDateTime)
SetCompletedAt sets the value of CompletedAt.
func (*Scan) SetFindings ¶
SetFindings sets the value of Findings.
func (*Scan) SetProgress ¶
func (s *Scan) SetProgress(val OptProgress)
SetProgress sets the value of Progress.
func (*Scan) SetStartedAt ¶
SetStartedAt sets the value of StartedAt.
func (*Scan) SetStatus ¶
func (s *Scan) SetStatus(val ScanStatus)
SetStatus sets the value of Status.
func (*Scan) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ScanCreated ¶
type ScanCreated struct {
ID uuid.UUID `json:"id"`
Status ScanStatus `json:"status"`
Target string `json:"target"`
// Set only when options.private=true (returned once).
PrivateToken OptString `json:"private_token"`
Links ScanLinks `json:"links"`
}
Ref: #/components/schemas/ScanCreated
func (*ScanCreated) Decode ¶
func (s *ScanCreated) Decode(d *jx.Decoder) error
Decode decodes ScanCreated from json.
func (*ScanCreated) Encode ¶
func (s *ScanCreated) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ScanCreated) GetLinks ¶
func (s *ScanCreated) GetLinks() ScanLinks
GetLinks returns the value of Links.
func (*ScanCreated) GetPrivateToken ¶
func (s *ScanCreated) GetPrivateToken() OptString
GetPrivateToken returns the value of PrivateToken.
func (*ScanCreated) GetStatus ¶
func (s *ScanCreated) GetStatus() ScanStatus
GetStatus returns the value of Status.
func (*ScanCreated) GetTarget ¶
func (s *ScanCreated) GetTarget() string
GetTarget returns the value of Target.
func (*ScanCreated) MarshalJSON ¶
func (s *ScanCreated) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ScanCreated) SetLinks ¶
func (s *ScanCreated) SetLinks(val ScanLinks)
SetLinks sets the value of Links.
func (*ScanCreated) SetPrivateToken ¶
func (s *ScanCreated) SetPrivateToken(val OptString)
SetPrivateToken sets the value of PrivateToken.
func (*ScanCreated) SetStatus ¶
func (s *ScanCreated) SetStatus(val ScanStatus)
SetStatus sets the value of Status.
func (*ScanCreated) SetTarget ¶
func (s *ScanCreated) SetTarget(val string)
SetTarget sets the value of Target.
func (*ScanCreated) UnmarshalJSON ¶
func (s *ScanCreated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ScanCreated) Validate ¶
func (s *ScanCreated) Validate() error
type ScanCreatedHeaders ¶
type ScanCreatedHeaders struct {
Location OptString
RetryAfter OptInt
Response ScanCreated
}
ScanCreatedHeaders wraps ScanCreated with response headers.
func (*ScanCreatedHeaders) GetLocation ¶
func (s *ScanCreatedHeaders) GetLocation() OptString
GetLocation returns the value of Location.
func (*ScanCreatedHeaders) GetResponse ¶
func (s *ScanCreatedHeaders) GetResponse() ScanCreated
GetResponse returns the value of Response.
func (*ScanCreatedHeaders) GetRetryAfter ¶
func (s *ScanCreatedHeaders) GetRetryAfter() OptInt
GetRetryAfter returns the value of RetryAfter.
func (*ScanCreatedHeaders) SetLocation ¶
func (s *ScanCreatedHeaders) SetLocation(val OptString)
SetLocation sets the value of Location.
func (*ScanCreatedHeaders) SetResponse ¶
func (s *ScanCreatedHeaders) SetResponse(val ScanCreated)
SetResponse sets the value of Response.
func (*ScanCreatedHeaders) SetRetryAfter ¶
func (s *ScanCreatedHeaders) SetRetryAfter(val OptInt)
SetRetryAfter sets the value of RetryAfter.
func (*ScanCreatedHeaders) Validate ¶
func (s *ScanCreatedHeaders) Validate() error
type ScanLinks ¶
type ScanLinks struct {
Self string `json:"self"`
Events OptString `json:"events"`
Markdown OptString `json:"markdown"`
Sarif OptString `json:"sarif"`
}
Ref: #/components/schemas/ScanLinks
func (*ScanLinks) GetMarkdown ¶
GetMarkdown returns the value of Markdown.
func (*ScanLinks) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*ScanLinks) SetMarkdown ¶
SetMarkdown sets the value of Markdown.
func (*ScanLinks) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ScanOptions ¶
type ScanOptions struct {
SkipCategories []string `json:"skip_categories"`
Private OptBool `json:"private"`
WaitSeconds OptInt `json:"wait_seconds"`
}
Ref: #/components/schemas/ScanOptions
func (*ScanOptions) Decode ¶
func (s *ScanOptions) Decode(d *jx.Decoder) error
Decode decodes ScanOptions from json.
func (*ScanOptions) Encode ¶
func (s *ScanOptions) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ScanOptions) GetPrivate ¶
func (s *ScanOptions) GetPrivate() OptBool
GetPrivate returns the value of Private.
func (*ScanOptions) GetSkipCategories ¶
func (s *ScanOptions) GetSkipCategories() []string
GetSkipCategories returns the value of SkipCategories.
func (*ScanOptions) GetWaitSeconds ¶
func (s *ScanOptions) GetWaitSeconds() OptInt
GetWaitSeconds returns the value of WaitSeconds.
func (*ScanOptions) MarshalJSON ¶
func (s *ScanOptions) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ScanOptions) SetPrivate ¶
func (s *ScanOptions) SetPrivate(val OptBool)
SetPrivate sets the value of Private.
func (*ScanOptions) SetSkipCategories ¶
func (s *ScanOptions) SetSkipCategories(val []string)
SetSkipCategories sets the value of SkipCategories.
func (*ScanOptions) SetWaitSeconds ¶
func (s *ScanOptions) SetWaitSeconds(val OptInt)
SetWaitSeconds sets the value of WaitSeconds.
func (*ScanOptions) UnmarshalJSON ¶
func (s *ScanOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ScanOptions) Validate ¶
func (s *ScanOptions) Validate() error
type ScanRequest ¶
type ScanRequest struct {
Target string `json:"target"`
Options OptScanOptions `json:"options"`
}
Ref: #/components/schemas/ScanRequest
func (*ScanRequest) Decode ¶
func (s *ScanRequest) Decode(d *jx.Decoder) error
Decode decodes ScanRequest from json.
func (*ScanRequest) Encode ¶
func (s *ScanRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ScanRequest) GetOptions ¶
func (s *ScanRequest) GetOptions() OptScanOptions
GetOptions returns the value of Options.
func (*ScanRequest) GetTarget ¶
func (s *ScanRequest) GetTarget() string
GetTarget returns the value of Target.
func (*ScanRequest) MarshalJSON ¶
func (s *ScanRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ScanRequest) SetOptions ¶
func (s *ScanRequest) SetOptions(val OptScanOptions)
SetOptions sets the value of Options.
func (*ScanRequest) SetTarget ¶
func (s *ScanRequest) SetTarget(val string)
SetTarget sets the value of Target.
func (*ScanRequest) UnmarshalJSON ¶
func (s *ScanRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ScanRequest) Validate ¶
func (s *ScanRequest) Validate() error
type ScanStatus ¶
type ScanStatus string
Ref: #/components/schemas/ScanStatus
const ( ScanStatusQueued ScanStatus = "queued" ScanStatusRunning ScanStatus = "running" ScanStatusCompleted ScanStatus = "completed" ScanStatusFailed ScanStatus = "failed" )
func (ScanStatus) AllValues ¶
func (ScanStatus) AllValues() []ScanStatus
AllValues returns all ScanStatus values.
func (*ScanStatus) Decode ¶
func (s *ScanStatus) Decode(d *jx.Decoder) error
Decode decodes ScanStatus from json.
func (ScanStatus) Encode ¶
func (s ScanStatus) Encode(e *jx.Encoder)
Encode encodes ScanStatus as json.
func (ScanStatus) MarshalJSON ¶
func (s ScanStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (ScanStatus) MarshalText ¶
func (s ScanStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*ScanStatus) UnmarshalJSON ¶
func (s *ScanStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ScanStatus) UnmarshalText ¶
func (s *ScanStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (ScanStatus) Validate ¶
func (s ScanStatus) Validate() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type Severity ¶
type Severity string
Ref: #/components/schemas/Severity
func (Severity) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (Severity) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Severity) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CreateScan ¶
func (UnimplementedHandler) CreateScan(ctx context.Context, req *ScanRequest) (r CreateScanRes, _ error)
CreateScan implements createScan operation.
Always returns 202 with a freshly minted GUIDv4 and a `Location` header. Use `options.wait_seconds` for short synchronous waits.
POST /api/v1/scans
func (UnimplementedHandler) DeleteScan ¶
func (UnimplementedHandler) DeleteScan(ctx context.Context, params DeleteScanParams) (r DeleteScanRes, _ error)
DeleteScan implements deleteScan operation.
Delete a scan (private mode requires token).
DELETE /api/v1/scans/{guid}
func (UnimplementedHandler) GetCheck ¶
func (UnimplementedHandler) GetCheck(ctx context.Context, params GetCheckParams) (r GetCheckRes, _ error)
GetCheck implements getCheck operation.
Fetch a single check definition.
GET /api/v1/checks/{check_id}
func (UnimplementedHandler) GetHealth ¶
func (UnimplementedHandler) GetHealth(ctx context.Context) (r *Health, _ error)
GetHealth implements getHealth operation.
Liveness/health probe.
GET /api/v1/health
func (UnimplementedHandler) GetOpenAPI ¶
func (UnimplementedHandler) GetOpenAPI(ctx context.Context) (r GetOpenAPIOK, _ error)
GetOpenAPI implements getOpenAPI operation.
Embedded OpenAPI 3.0 specification.
GET /api/v1/openapi.json
func (UnimplementedHandler) GetScan ¶
func (UnimplementedHandler) GetScan(ctx context.Context, params GetScanParams) (r GetScanRes, _ error)
GetScan implements getScan operation.
Fetch a scan (always 200).
GET /api/v1/scans/{guid}
func (UnimplementedHandler) GetScanMarkdown ¶
func (UnimplementedHandler) GetScanMarkdown(ctx context.Context, params GetScanMarkdownParams) (r GetScanMarkdownRes, _ error)
GetScanMarkdown implements getScanMarkdown operation.
Markdown report.
GET /api/v1/scans/{guid}/markdown
func (UnimplementedHandler) GetScanSARIF ¶
func (UnimplementedHandler) GetScanSARIF(ctx context.Context, params GetScanSARIFParams) (r GetScanSARIFRes, _ error)
GetScanSARIF implements getScanSARIF operation.
SARIF 2.1.0 report.
GET /api/v1/scans/{guid}/sarif
func (UnimplementedHandler) GetVersion ¶
func (UnimplementedHandler) GetVersion(ctx context.Context) (r *Version, _ error)
GetVersion implements getVersion operation.
Build metadata.
GET /api/v1/version
func (UnimplementedHandler) ListChecks ¶
func (UnimplementedHandler) ListChecks(ctx context.Context) (r []Check, _ error)
ListChecks implements listChecks operation.
List all supported checks.
GET /api/v1/checks
type Version ¶
type Version struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
}
Ref: #/components/schemas/Version
func (*Version) GetBuildDate ¶
GetBuildDate returns the value of BuildDate.
func (*Version) GetVersion ¶
GetVersion returns the value of Version.
func (*Version) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Version) SetBuildDate ¶
SetBuildDate sets the value of BuildDate.
func (*Version) SetVersion ¶
SetVersion sets the value of Version.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
Source Files
¶
- doc.go
- oas_cfg_gen.go
- oas_client_gen.go
- oas_defaults_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go