client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 12 Imported by: 0

README

client

import "github.com/brittonhayes/citadel/gen/http/vulnerabilities/client"

Index

func BuildFindPayload

func BuildFindPayload(vulnerabilitiesFindID string) (*vulnerabilities.FindPayload, error)

BuildFindPayload builds the payload for the vulnerabilities find endpoint from CLI flags.

func BuildListPayload

func BuildListPayload(vulnerabilitiesListLimit string) (*vulnerabilities.LimitPayload, error)

BuildListPayload builds the payload for the vulnerabilities list endpoint from CLI flags.

func BuildSubmitPayload

func BuildSubmitPayload(vulnerabilitiesSubmitBody string) (*vulnerabilities.SubmitPayload, error)

BuildSubmitPayload builds the payload for the vulnerabilities submit endpoint from CLI flags.

func DecodeFindResponse

func DecodeFindResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeFindResponse returns a decoder for responses returned by the vulnerabilities find endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeFindResponse may return the following errors: - "no_match" (type vulnerabilities.NoMatch): http.StatusNotFound - error: internal error

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeListResponse returns a decoder for responses returned by the vulnerabilities list endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeSubmitResponse

func DecodeSubmitResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeSubmitResponse returns a decoder for responses returned by the vulnerabilities submit endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeSubmitResponse may return the following errors: - "no_match" (type vulnerabilities.NoMatch): http.StatusNotFound - error: internal error

func EncodeListRequest

func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeListRequest returns an encoder for requests sent to the vulnerabilities list server.

func EncodeSubmitRequest

func EncodeSubmitRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeSubmitRequest returns an encoder for requests sent to the vulnerabilities submit server.

func FindVulnerabilitiesPath

func FindVulnerabilitiesPath(id uint64) string

FindVulnerabilitiesPath returns the URL path to the vulnerabilities service find HTTP endpoint.

func ListVulnerabilitiesPath

func ListVulnerabilitiesPath() string

ListVulnerabilitiesPath returns the URL path to the vulnerabilities service list HTTP endpoint.

func NewFindNoMatch

func NewFindNoMatch(body FindNoMatchResponseBody) vulnerabilities.NoMatch

NewFindNoMatch builds a vulnerabilities service find endpoint no_match error.

func NewFindVulnerabilityOK

func NewFindVulnerabilityOK(body *FindResponseBody) *vulnerabilities.Vulnerability

NewFindVulnerabilityOK builds a "vulnerabilities" service "find" endpoint result from a HTTP "OK" response.

func NewListVulnerabilityOK

func NewListVulnerabilityOK(body []*VulnerabilityResponse) []*vulnerabilities.Vulnerability

NewListVulnerabilityOK builds a "vulnerabilities" service "list" endpoint result from a HTTP "OK" response.

func NewSubmitNoMatch

func NewSubmitNoMatch(body SubmitNoMatchResponseBody) vulnerabilities.NoMatch

NewSubmitNoMatch builds a vulnerabilities service submit endpoint no_match error.

func SubmitVulnerabilitiesPath

func SubmitVulnerabilitiesPath() string

SubmitVulnerabilitiesPath returns the URL path to the vulnerabilities service submit HTTP endpoint.

func ValidateFindResponseBody

func ValidateFindResponseBody(body *FindResponseBody) (err error)

ValidateFindResponseBody runs the validations defined on FindResponseBody

func ValidateVulnerabilityResponse

func ValidateVulnerabilityResponse(body *VulnerabilityResponse) (err error)

ValidateVulnerabilityResponse runs the validations defined on VulnerabilityResponse

type Client

Client lists the vulnerabilities service endpoint HTTP clients.

type Client struct {
    // Find Doer is the HTTP client used to make requests to the find endpoint.
    FindDoer goahttp.Doer

    // List Doer is the HTTP client used to make requests to the list endpoint.
    ListDoer goahttp.Doer

    // Submit Doer is the HTTP client used to make requests to the submit endpoint.
    SubmitDoer goahttp.Doer

    // RestoreResponseBody controls whether the response bodies are reset after
    // decoding so they can be read again.
    RestoreResponseBody bool
    // contains filtered or unexported fields
}
func NewClient
func NewClient(
    scheme string,
    host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the vulnerabilities service servers.

func (*Client) BuildFindRequest
func (c *Client) BuildFindRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildFindRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "find" endpoint

func (*Client) BuildListRequest
func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "list" endpoint

func (*Client) BuildSubmitRequest
func (c *Client) BuildSubmitRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildSubmitRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "submit" endpoint

func (*Client) Find
func (c *Client) Find() endpoint.Endpoint

Find returns an endpoint that makes HTTP requests to the vulnerabilities service find server.

func (*Client) List
func (c *Client) List() endpoint.Endpoint

List returns an endpoint that makes HTTP requests to the vulnerabilities service list server.

func (*Client) Submit
func (c *Client) Submit() endpoint.Endpoint

Submit returns an endpoint that makes HTTP requests to the vulnerabilities service submit server.

type FindNoMatchResponseBody

FindNoMatchResponseBody is the type of the "vulnerabilities" service "find" endpoint HTTP response body for the "no_match" error.

type FindNoMatchResponseBody string

type FindResponseBody

FindResponseBody is the type of the "vulnerabilities" service "find" endpoint HTTP response body.

type FindResponseBody struct {
    // Unique ID of the vulnerability
    ID  *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
    // Title of the vulnerability
    Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
    // Description of the vulnerability
    Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
    // If the vulnerability is exploitable
    Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
    // Severity score of the vulnerability
    CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
    // If the vulnerability is patchable
    IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
    // If the vulnerability is upgradeable
    IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}

type ListResponseBody

ListResponseBody is the type of the "vulnerabilities" service "list" endpoint HTTP response body.

type ListResponseBody []*VulnerabilityResponse

type SubmitNoMatchResponseBody

SubmitNoMatchResponseBody is the type of the "vulnerabilities" service "submit" endpoint HTTP response body for the "no_match" error.

type SubmitNoMatchResponseBody string

type SubmitRequestBody

SubmitRequestBody is the type of the "vulnerabilities" service "submit" endpoint HTTP request body.

type SubmitRequestBody struct {
    // Title of the vulnerability
    Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
    // Description of the vulnerability
    Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
    // If the vulnerability is exploitable
    Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
    // Severity score of the vulnerability
    CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
    // If the vulnerability is patchable
    IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
    // If the vulnerability is upgradeable
    IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}
func NewSubmitRequestBody
func NewSubmitRequestBody(p *vulnerabilities.SubmitPayload) *SubmitRequestBody

NewSubmitRequestBody builds the HTTP request body from the payload of the "submit" endpoint of the "vulnerabilities" service.

type VulnerabilityResponse

VulnerabilityResponse is used to define fields on response body types.

type VulnerabilityResponse struct {
    // Unique ID of the vulnerability
    ID  *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
    // Title of the vulnerability
    Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
    // Description of the vulnerability
    Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
    // If the vulnerability is exploitable
    Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
    // Severity score of the vulnerability
    CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
    // If the vulnerability is patchable
    IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
    // If the vulnerability is upgradeable
    IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFindPayload

func BuildFindPayload(vulnerabilitiesFindID string) (*vulnerabilities.FindPayload, error)

BuildFindPayload builds the payload for the vulnerabilities find endpoint from CLI flags.

func BuildListPayload

func BuildListPayload(vulnerabilitiesListLimit string) (*vulnerabilities.LimitPayload, error)

BuildListPayload builds the payload for the vulnerabilities list endpoint from CLI flags.

func BuildSubmitPayload

func BuildSubmitPayload(vulnerabilitiesSubmitBody string) (*vulnerabilities.SubmitPayload, error)

BuildSubmitPayload builds the payload for the vulnerabilities submit endpoint from CLI flags.

func DecodeFindResponse

func DecodeFindResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeFindResponse returns a decoder for responses returned by the vulnerabilities find endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeFindResponse may return the following errors:

  • "no_match" (type vulnerabilities.NoMatch): http.StatusNotFound
  • error: internal error

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeListResponse returns a decoder for responses returned by the vulnerabilities list endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeSubmitResponse

func DecodeSubmitResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeSubmitResponse returns a decoder for responses returned by the vulnerabilities submit endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeSubmitResponse may return the following errors:

  • "no_match" (type vulnerabilities.NoMatch): http.StatusNotFound
  • error: internal error

func EncodeListRequest

func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeListRequest returns an encoder for requests sent to the vulnerabilities list server.

func EncodeSubmitRequest

func EncodeSubmitRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeSubmitRequest returns an encoder for requests sent to the vulnerabilities submit server.

func FindVulnerabilitiesPath

func FindVulnerabilitiesPath(id uint64) string

FindVulnerabilitiesPath returns the URL path to the vulnerabilities service find HTTP endpoint.

func ListVulnerabilitiesPath

func ListVulnerabilitiesPath() string

ListVulnerabilitiesPath returns the URL path to the vulnerabilities service list HTTP endpoint.

func NewFindNoMatch

func NewFindNoMatch(body FindNoMatchResponseBody) vulnerabilities.NoMatch

NewFindNoMatch builds a vulnerabilities service find endpoint no_match error.

func NewFindVulnerabilityOK

func NewFindVulnerabilityOK(body *FindResponseBody) *vulnerabilities.Vulnerability

NewFindVulnerabilityOK builds a "vulnerabilities" service "find" endpoint result from a HTTP "OK" response.

func NewListVulnerabilityOK

func NewListVulnerabilityOK(body []*VulnerabilityResponse) []*vulnerabilities.Vulnerability

NewListVulnerabilityOK builds a "vulnerabilities" service "list" endpoint result from a HTTP "OK" response.

func NewSubmitNoMatch

func NewSubmitNoMatch(body SubmitNoMatchResponseBody) vulnerabilities.NoMatch

NewSubmitNoMatch builds a vulnerabilities service submit endpoint no_match error.

func SubmitVulnerabilitiesPath

func SubmitVulnerabilitiesPath() string

SubmitVulnerabilitiesPath returns the URL path to the vulnerabilities service submit HTTP endpoint.

func ValidateFindResponseBody

func ValidateFindResponseBody(body *FindResponseBody) (err error)

ValidateFindResponseBody runs the validations defined on FindResponseBody

func ValidateVulnerabilityResponse

func ValidateVulnerabilityResponse(body *VulnerabilityResponse) (err error)

ValidateVulnerabilityResponse runs the validations defined on VulnerabilityResponse

Types

type Client

type Client struct {
	// Find Doer is the HTTP client used to make requests to the find endpoint.
	FindDoer goahttp.Doer

	// List Doer is the HTTP client used to make requests to the list endpoint.
	ListDoer goahttp.Doer

	// Submit Doer is the HTTP client used to make requests to the submit endpoint.
	SubmitDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the vulnerabilities service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the vulnerabilities service servers.

func (*Client) BuildFindRequest

func (c *Client) BuildFindRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildFindRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "find" endpoint

func (*Client) BuildListRequest

func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "list" endpoint

func (*Client) BuildSubmitRequest

func (c *Client) BuildSubmitRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildSubmitRequest instantiates a HTTP request object with method and path set to call the "vulnerabilities" service "submit" endpoint

func (*Client) Find

func (c *Client) Find() endpoint.Endpoint

Find returns an endpoint that makes HTTP requests to the vulnerabilities service find server.

func (*Client) List

func (c *Client) List() endpoint.Endpoint

List returns an endpoint that makes HTTP requests to the vulnerabilities service list server.

func (*Client) Submit

func (c *Client) Submit() endpoint.Endpoint

Submit returns an endpoint that makes HTTP requests to the vulnerabilities service submit server.

type FindNoMatchResponseBody

type FindNoMatchResponseBody string

FindNoMatchResponseBody is the type of the "vulnerabilities" service "find" endpoint HTTP response body for the "no_match" error.

type FindResponseBody

type FindResponseBody struct {
	// Unique ID of the vulnerability
	ID *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Title of the vulnerability
	Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
	// Description of the vulnerability
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// If the vulnerability is exploitable
	Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
	// Severity score of the vulnerability
	CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
	// If the vulnerability is patchable
	IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
	// If the vulnerability is upgradeable
	IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}

FindResponseBody is the type of the "vulnerabilities" service "find" endpoint HTTP response body.

type ListResponseBody

type ListResponseBody []*VulnerabilityResponse

ListResponseBody is the type of the "vulnerabilities" service "list" endpoint HTTP response body.

type SubmitNoMatchResponseBody

type SubmitNoMatchResponseBody string

SubmitNoMatchResponseBody is the type of the "vulnerabilities" service "submit" endpoint HTTP response body for the "no_match" error.

type SubmitRequestBody

type SubmitRequestBody struct {
	// Title of the vulnerability
	Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
	// Description of the vulnerability
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// If the vulnerability is exploitable
	Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
	// Severity score of the vulnerability
	CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
	// If the vulnerability is patchable
	IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
	// If the vulnerability is upgradeable
	IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}

SubmitRequestBody is the type of the "vulnerabilities" service "submit" endpoint HTTP request body.

func NewSubmitRequestBody

func NewSubmitRequestBody(p *vulnerabilities.SubmitPayload) *SubmitRequestBody

NewSubmitRequestBody builds the HTTP request body from the payload of the "submit" endpoint of the "vulnerabilities" service.

type VulnerabilityResponse

type VulnerabilityResponse struct {
	// Unique ID of the vulnerability
	ID *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Title of the vulnerability
	Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
	// Description of the vulnerability
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// If the vulnerability is exploitable
	Exploitable *bool `form:"exploitable,omitempty" json:"exploitable,omitempty" xml:"exploitable,omitempty"`
	// Severity score of the vulnerability
	CvssScore *float32 `form:"cvss_score,omitempty" json:"cvss_score,omitempty" xml:"cvss_score,omitempty"`
	// If the vulnerability is patchable
	IsPatchable *bool `form:"is_patchable,omitempty" json:"is_patchable,omitempty" xml:"is_patchable,omitempty"`
	// If the vulnerability is upgradeable
	IsUpgradeable *bool `form:"is_upgradeable,omitempty" json:"is_upgradeable,omitempty" xml:"is_upgradeable,omitempty"`
}

VulnerabilityResponse is used to define fields on response body types.

Jump to

Keyboard shortcuts

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