client

package
v0.0.1-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package client is the ogen-generated Go server + client for the WebSec0 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

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) Decode

func (s *Check) Decode(d *jx.Decoder) error

Decode decodes Check from json.

func (*Check) Encode

func (s *Check) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Check) GetDefaultSeverity

func (s *Check) GetDefaultSeverity() Severity

GetDefaultSeverity returns the value of DefaultSeverity.

func (*Check) GetDescription

func (s *Check) GetDescription() OptString

GetDescription returns the value of Description.

func (*Check) GetFamily

func (s *Check) GetFamily() string

GetFamily returns the value of Family.

func (*Check) GetID

func (s *Check) GetID() string

GetID returns the value of ID.

func (*Check) GetRfcRefs

func (s *Check) GetRfcRefs() []string

GetRfcRefs returns the value of RfcRefs.

func (*Check) GetTitle

func (s *Check) GetTitle() OptString

GetTitle returns the value of Title.

func (*Check) MarshalJSON

func (s *Check) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Check) SetDefaultSeverity

func (s *Check) SetDefaultSeverity(val Severity)

SetDefaultSeverity sets the value of DefaultSeverity.

func (*Check) SetDescription

func (s *Check) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*Check) SetFamily

func (s *Check) SetFamily(val string)

SetFamily sets the value of Family.

func (*Check) SetID

func (s *Check) SetID(val string)

SetID sets the value of ID.

func (*Check) SetRfcRefs

func (s *Check) SetRfcRefs(val []string)

SetRfcRefs sets the value of RfcRefs.

func (*Check) SetTitle

func (s *Check) SetTitle(val OptString)

SetTitle sets the value of Title.

func (*Check) UnmarshalJSON

func (s *Check) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Check) Validate

func (s *Check) Validate() error

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

func (c *Client) GetHealth(ctx context.Context) (*Health, error)

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

func (c *Client) GetVersion(ctx context.Context) (*Version, error)

GetVersion invokes getVersion operation.

Build metadata.

GET /api/v1/version

func (*Client) ListChecks

func (c *Client) ListChecks(ctx context.Context) ([]Check, error)

ListChecks invokes listChecks operation.

List all supported checks.

GET /api/v1/checks

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

type DeleteScanParams struct {
	// GUIDv4 of the scan.
	GUID uuid.UUID
}

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) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (*Error) Encode

func (s *Error) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Error) GetCode

func (s *Error) GetCode() string

GetCode returns the value of Code.

func (*Error) GetDetails

func (s *Error) GetDetails() OptErrorDetails

GetDetails returns the value of Details.

func (*Error) GetMessage

func (s *Error) GetMessage() string

GetMessage returns the value of Message.

func (*Error) MarshalJSON

func (s *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetCode

func (s *Error) SetCode(val string)

SetCode sets the value of Code.

func (*Error) SetDetails

func (s *Error) SetDetails(val OptErrorDetails)

SetDetails sets the value of Details.

func (*Error) SetMessage

func (s *Error) SetMessage(val string)

SetMessage sets the value of Message.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorDetails

type ErrorDetails map[string]jx.Raw

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 ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

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) Decode

func (s *Finding) Decode(d *jx.Decoder) error

Decode decodes Finding from json.

func (*Finding) Encode

func (s *Finding) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Finding) GetDescription

func (s *Finding) GetDescription() OptString

GetDescription returns the value of Description.

func (*Finding) GetEvidence

func (s *Finding) GetEvidence() OptFindingEvidence

GetEvidence returns the value of Evidence.

func (*Finding) GetFamily

func (s *Finding) GetFamily() string

GetFamily returns the value of Family.

func (*Finding) GetID

func (s *Finding) GetID() string

GetID returns the value of ID.

func (*Finding) GetRemediation

func (s *Finding) GetRemediation() OptFindingRemediation

GetRemediation returns the value of Remediation.

func (*Finding) GetSeverity

func (s *Finding) GetSeverity() Severity

GetSeverity returns the value of Severity.

func (*Finding) GetStatus

func (s *Finding) GetStatus() FindingStatus

GetStatus returns the value of Status.

func (*Finding) GetTitle

func (s *Finding) GetTitle() OptString

GetTitle returns the value of Title.

func (*Finding) MarshalJSON

func (s *Finding) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Finding) SetDescription

func (s *Finding) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*Finding) SetEvidence

func (s *Finding) SetEvidence(val OptFindingEvidence)

SetEvidence sets the value of Evidence.

func (*Finding) SetFamily

func (s *Finding) SetFamily(val string)

SetFamily sets the value of Family.

func (*Finding) SetID

func (s *Finding) SetID(val string)

SetID sets the value of ID.

func (*Finding) SetRemediation

func (s *Finding) SetRemediation(val OptFindingRemediation)

SetRemediation sets the value of Remediation.

func (*Finding) SetSeverity

func (s *Finding) SetSeverity(val Severity)

SetSeverity sets the value of Severity.

func (*Finding) SetStatus

func (s *Finding) SetStatus(val FindingStatus)

SetStatus sets the value of Status.

func (*Finding) SetTitle

func (s *Finding) SetTitle(val OptString)

SetTitle sets the value of Title.

func (*Finding) UnmarshalJSON

func (s *Finding) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Finding) Validate

func (s *Finding) Validate() error

type FindingEvidence

type FindingEvidence map[string]jx.Raw

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

type FindingRemediation map[string]jx.Raw

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

type GetOpenAPIOK map[string]jx.Raw

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 GetScanMarkdownOK struct {
	Data io.Reader
}

func (GetScanMarkdownOK) Read

func (s GetScanMarkdownOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type GetScanMarkdownParams

type GetScanMarkdownParams struct {
	// GUIDv4 of the scan.
	GUID uuid.UUID
}

GetScanMarkdownParams is parameters of getScanMarkdown operation.

type GetScanMarkdownRes

type GetScanMarkdownRes interface {
	// contains filtered or unexported methods
}

type GetScanParams

type GetScanParams struct {
	// GUIDv4 of the scan.
	GUID uuid.UUID
}

GetScanParams is parameters of getScan operation.

type GetScanRes

type GetScanRes interface {
	// contains filtered or unexported methods
}

type GetScanSARIFOK

type GetScanSARIFOK map[string]jx.Raw

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

type GetScanSARIFParams struct {
	// GUIDv4 of the scan.
	GUID uuid.UUID
}

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) Decode

func (s *Health) Decode(d *jx.Decoder) error

Decode decodes Health from json.

func (*Health) Encode

func (s *Health) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Health) GetStatus

func (s *Health) GetStatus() HealthStatus

GetStatus returns the value of Status.

func (*Health) GetUptimeSeconds

func (s *Health) GetUptimeSeconds() int64

GetUptimeSeconds returns the value of UptimeSeconds.

func (*Health) GetVersion

func (s *Health) GetVersion() string

GetVersion returns the value of Version.

func (*Health) MarshalJSON

func (s *Health) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Health) SetStatus

func (s *Health) SetStatus(val HealthStatus)

SetStatus sets the value of Status.

func (*Health) SetUptimeSeconds

func (s *Health) SetUptimeSeconds(val int64)

SetUptimeSeconds sets the value of UptimeSeconds.

func (*Health) SetVersion

func (s *Health) SetVersion(val string)

SetVersion sets the value of Version.

func (*Health) UnmarshalJSON

func (s *Health) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Health) Validate

func (s *Health) Validate() error

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

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

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) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

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

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

func (s OptBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

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) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

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

Or returns value if set, or given parameter if does not.

func (*OptErrorDetails) Reset

func (o *OptErrorDetails) Reset()

Reset unsets value.

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

Or returns value if set, or given parameter if does not.

func (*OptFindingEvidence) Reset

func (o *OptFindingEvidence) Reset()

Reset unsets value.

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

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

Or returns value if set, or given parameter if does not.

func (*OptFindingRemediation) Reset

func (o *OptFindingRemediation) Reset()

Reset unsets value.

func (*OptFindingRemediation) SetTo

SetTo sets value to v.

func (*OptFindingRemediation) UnmarshalJSON

func (s *OptFindingRemediation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptProgress

type OptProgress struct {
	Value Progress
	Set   bool
}

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) Reset

func (o *OptProgress) Reset()

Reset unsets value.

func (*OptProgress) SetTo

func (o *OptProgress) SetTo(v Progress)

SetTo sets value to v.

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

Or returns value if set, or given parameter if does not.

func (*OptScanOptions) Reset

func (o *OptScanOptions) Reset()

Reset unsets value.

func (*OptScanOptions) SetTo

func (o *OptScanOptions) SetTo(v ScanOptions)

SetTo sets value to v.

func (*OptScanOptions) UnmarshalJSON

func (s *OptScanOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

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) Decode

func (s *Progress) Decode(d *jx.Decoder) error

Decode decodes Progress from json.

func (*Progress) Encode

func (s *Progress) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Progress) GetCompleted

func (s *Progress) GetCompleted() int

GetCompleted returns the value of Completed.

func (*Progress) GetCurrentPhase

func (s *Progress) GetCurrentPhase() OptString

GetCurrentPhase returns the value of CurrentPhase.

func (*Progress) GetTotal

func (s *Progress) GetTotal() int

GetTotal returns the value of Total.

func (*Progress) MarshalJSON

func (s *Progress) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Progress) SetCompleted

func (s *Progress) SetCompleted(val int)

SetCompleted sets the value of Completed.

func (*Progress) SetCurrentPhase

func (s *Progress) SetCurrentPhase(val OptString)

SetCurrentPhase sets the value of CurrentPhase.

func (*Progress) SetTotal

func (s *Progress) SetTotal(val int)

SetTotal sets the value of Total.

func (*Progress) UnmarshalJSON

func (s *Progress) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

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) Decode

func (s *Scan) Decode(d *jx.Decoder) error

Decode decodes Scan from json.

func (*Scan) Encode

func (s *Scan) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Scan) GetCompletedAt

func (s *Scan) GetCompletedAt() OptDateTime

GetCompletedAt returns the value of CompletedAt.

func (*Scan) GetError

func (s *Scan) GetError() OptString

GetError returns the value of Error.

func (*Scan) GetFindings

func (s *Scan) GetFindings() []Finding

GetFindings returns the value of Findings.

func (*Scan) GetGrade

func (s *Scan) GetGrade() OptString

GetGrade returns the value of Grade.

func (*Scan) GetID

func (s *Scan) GetID() uuid.UUID

GetID returns the value of ID.

func (s *Scan) GetLinks() ScanLinks

GetLinks returns the value of Links.

func (*Scan) GetProgress

func (s *Scan) GetProgress() OptProgress

GetProgress returns the value of Progress.

func (*Scan) GetScore

func (s *Scan) GetScore() OptInt

GetScore returns the value of Score.

func (*Scan) GetStartedAt

func (s *Scan) GetStartedAt() time.Time

GetStartedAt returns the value of StartedAt.

func (*Scan) GetStatus

func (s *Scan) GetStatus() ScanStatus

GetStatus returns the value of Status.

func (*Scan) GetTarget

func (s *Scan) GetTarget() string

GetTarget returns the value of Target.

func (*Scan) MarshalJSON

func (s *Scan) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Scan) SetCompletedAt

func (s *Scan) SetCompletedAt(val OptDateTime)

SetCompletedAt sets the value of CompletedAt.

func (*Scan) SetError

func (s *Scan) SetError(val OptString)

SetError sets the value of Error.

func (*Scan) SetFindings

func (s *Scan) SetFindings(val []Finding)

SetFindings sets the value of Findings.

func (*Scan) SetGrade

func (s *Scan) SetGrade(val OptString)

SetGrade sets the value of Grade.

func (*Scan) SetID

func (s *Scan) SetID(val uuid.UUID)

SetID sets the value of ID.

func (s *Scan) SetLinks(val ScanLinks)

SetLinks sets the value of Links.

func (*Scan) SetProgress

func (s *Scan) SetProgress(val OptProgress)

SetProgress sets the value of Progress.

func (*Scan) SetScore

func (s *Scan) SetScore(val OptInt)

SetScore sets the value of Score.

func (*Scan) SetStartedAt

func (s *Scan) SetStartedAt(val time.Time)

SetStartedAt sets the value of StartedAt.

func (*Scan) SetStatus

func (s *Scan) SetStatus(val ScanStatus)

SetStatus sets the value of Status.

func (*Scan) SetTarget

func (s *Scan) SetTarget(val string)

SetTarget sets the value of Target.

func (*Scan) UnmarshalJSON

func (s *Scan) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Scan) Validate

func (s *Scan) Validate() error

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) GetID

func (s *ScanCreated) GetID() uuid.UUID

GetID returns the value of ID.

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) SetID

func (s *ScanCreated) SetID(val uuid.UUID)

SetID sets the value of ID.

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 struct {
	Self     string    `json:"self"`
	Events   OptString `json:"events"`
	Markdown OptString `json:"markdown"`
	Sarif    OptString `json:"sarif"`
}

Ref: #/components/schemas/ScanLinks

func (*ScanLinks) Decode

func (s *ScanLinks) Decode(d *jx.Decoder) error

Decode decodes ScanLinks from json.

func (*ScanLinks) Encode

func (s *ScanLinks) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ScanLinks) GetEvents

func (s *ScanLinks) GetEvents() OptString

GetEvents returns the value of Events.

func (*ScanLinks) GetMarkdown

func (s *ScanLinks) GetMarkdown() OptString

GetMarkdown returns the value of Markdown.

func (*ScanLinks) GetSarif

func (s *ScanLinks) GetSarif() OptString

GetSarif returns the value of Sarif.

func (*ScanLinks) GetSelf

func (s *ScanLinks) GetSelf() string

GetSelf returns the value of Self.

func (*ScanLinks) MarshalJSON

func (s *ScanLinks) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ScanLinks) SetEvents

func (s *ScanLinks) SetEvents(val OptString)

SetEvents sets the value of Events.

func (*ScanLinks) SetMarkdown

func (s *ScanLinks) SetMarkdown(val OptString)

SetMarkdown sets the value of Markdown.

func (*ScanLinks) SetSarif

func (s *ScanLinks) SetSarif(val OptString)

SetSarif sets the value of Sarif.

func (*ScanLinks) SetSelf

func (s *ScanLinks) SetSelf(val string)

SetSelf sets the value of Self.

func (*ScanLinks) UnmarshalJSON

func (s *ScanLinks) UnmarshalJSON(data []byte) error

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.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

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

const (
	SeverityInfo     Severity = "info"
	SeverityLow      Severity = "low"
	SeverityMedium   Severity = "medium"
	SeverityHigh     Severity = "high"
	SeverityCritical Severity = "critical"
)

func (Severity) AllValues

func (Severity) AllValues() []Severity

AllValues returns all Severity values.

func (*Severity) Decode

func (s *Severity) Decode(d *jx.Decoder) error

Decode decodes Severity from json.

func (Severity) Encode

func (s Severity) Encode(e *jx.Encoder)

Encode encodes Severity as json.

func (Severity) MarshalJSON

func (s Severity) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (Severity) MarshalText

func (s Severity) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Severity) UnmarshalJSON

func (s *Severity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Severity) UnmarshalText

func (s *Severity) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Severity) Validate

func (s Severity) Validate() error

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

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

GetScanMarkdown implements getScanMarkdown operation.

Markdown report.

GET /api/v1/scans/{guid}/markdown

func (UnimplementedHandler) GetScanSARIF

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) Decode

func (s *Version) Decode(d *jx.Decoder) error

Decode decodes Version from json.

func (*Version) Encode

func (s *Version) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Version) GetBuildDate

func (s *Version) GetBuildDate() string

GetBuildDate returns the value of BuildDate.

func (*Version) GetCommit

func (s *Version) GetCommit() string

GetCommit returns the value of Commit.

func (*Version) GetVersion

func (s *Version) GetVersion() string

GetVersion returns the value of Version.

func (*Version) MarshalJSON

func (s *Version) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Version) SetBuildDate

func (s *Version) SetBuildDate(val string)

SetBuildDate sets the value of BuildDate.

func (*Version) SetCommit

func (s *Version) SetCommit(val string)

SetCommit sets the value of Commit.

func (*Version) SetVersion

func (s *Version) SetVersion(val string)

SetVersion sets the value of Version.

func (*Version) UnmarshalJSON

func (s *Version) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

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