vulnerabilities

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: 2 Imported by: 0

README

vulnerabilities

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

Index

Constants

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

const ServiceName = "vulnerabilities"

Variables

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

var MethodNames = [3]string{"find", "list", "submit"}

func NewFindEndpoint

func NewFindEndpoint(s Service) endpoint.Endpoint

NewFindEndpoint returns an endpoint function that calls the method "find" of service "vulnerabilities".

func NewListEndpoint

func NewListEndpoint(s Service) endpoint.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "vulnerabilities".

func NewSubmitEndpoint

func NewSubmitEndpoint(s Service) endpoint.Endpoint

NewSubmitEndpoint returns an endpoint function that calls the method "submit" of service "vulnerabilities".

type Client

Client is the "vulnerabilities" service client.

type Client struct {
    FindEndpoint   endpoint.Endpoint
    ListEndpoint   endpoint.Endpoint
    SubmitEndpoint endpoint.Endpoint
}
func NewClient
func NewClient(find, list, submit endpoint.Endpoint) *Client

NewClient initializes a "vulnerabilities" service client given the endpoints.

func (*Client) Find
func (c *Client) Find(ctx context.Context, p *FindPayload) (res *Vulnerability, err error)

Find calls the "find" endpoint of the "vulnerabilities" service. Find may return the following errors: - "no_match" (type NoMatch) - error: internal error

func (*Client) List
func (c *Client) List(ctx context.Context, p *LimitPayload) (res []*Vulnerability, err error)

List calls the "list" endpoint of the "vulnerabilities" service.

func (*Client) Submit
func (c *Client) Submit(ctx context.Context, p *SubmitPayload) (err error)

Submit calls the "submit" endpoint of the "vulnerabilities" service. Submit may return the following errors: - "no_match" (type NoMatch) - error: internal error

type Endpoints

Endpoints wraps the "vulnerabilities" service endpoints.

type Endpoints struct {
    Find   endpoint.Endpoint
    List   endpoint.Endpoint
    Submit endpoint.Endpoint
}
func NewEndpoints
func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "vulnerabilities" service with endpoints.

func (*Endpoints) Use
func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint)

Use applies the given middleware to all the "vulnerabilities" service endpoints.

type FindPayload

FindPayload is the payload type of the vulnerabilities service find method.

type FindPayload struct {
    // Unique ID of the vulnerability
    ID uint64
}

type LimitPayload

LimitPayload is the payload type of the vulnerabilities service list method.

type LimitPayload struct {
    // Limit the number of results
    Limit *int32
}

type NoMatch

No vulnerability matched given criteria

type NoMatch string
func (NoMatch) Error
func (e NoMatch) Error() string

Error returns an error description.

func (NoMatch) ErrorName
func (e NoMatch) ErrorName() string

ErrorName returns "no_match".

type Service

The vulnerability service handles the creation and querying of security vulnerabilities.

type Service interface {
    // Find implements find.
    Find(context.Context, *FindPayload) (res *Vulnerability, err error)
    // List all of the vulnerabilities
    List(context.Context, *LimitPayload) (res []*Vulnerability, err error)
    // Submit implements submit.
    Submit(context.Context, *SubmitPayload) (err error)
}

type SubmitPayload

SubmitPayload is the payload type of the vulnerabilities service submit method.

type SubmitPayload struct {
    // Title of the vulnerability
    Title *string
    // Description of the vulnerability
    Description *string
    // If the vulnerability is exploitable
    Exploitable *bool
    // Severity score of the vulnerability
    CvssScore *float32
    // If the vulnerability is patchable
    IsPatchable *bool
    // If the vulnerability is upgradeable
    IsUpgradeable *bool
}

type Vulnerability

Vulnerability is the result type of the vulnerabilities service find method.

type Vulnerability struct {
    // Unique ID of the vulnerability
    ID  uint64
    // Title of the vulnerability
    Title *string
    // Description of the vulnerability
    Description *string
    // If the vulnerability is exploitable
    Exploitable *bool
    // Severity score of the vulnerability
    CvssScore *float32
    // If the vulnerability is patchable
    IsPatchable *bool
    // If the vulnerability is upgradeable
    IsUpgradeable *bool
}

Generated by gomarkdoc

Documentation

Index

Constants

View Source
const ServiceName = "vulnerabilities"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [3]string{"find", "list", "submit"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewFindEndpoint

func NewFindEndpoint(s Service) endpoint.Endpoint

NewFindEndpoint returns an endpoint function that calls the method "find" of service "vulnerabilities".

func NewListEndpoint

func NewListEndpoint(s Service) endpoint.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "vulnerabilities".

func NewSubmitEndpoint

func NewSubmitEndpoint(s Service) endpoint.Endpoint

NewSubmitEndpoint returns an endpoint function that calls the method "submit" of service "vulnerabilities".

Types

type Client

type Client struct {
	FindEndpoint   endpoint.Endpoint
	ListEndpoint   endpoint.Endpoint
	SubmitEndpoint endpoint.Endpoint
}

Client is the "vulnerabilities" service client.

func NewClient

func NewClient(find, list, submit endpoint.Endpoint) *Client

NewClient initializes a "vulnerabilities" service client given the endpoints.

func (*Client) Find

func (c *Client) Find(ctx context.Context, p *FindPayload) (res *Vulnerability, err error)

Find calls the "find" endpoint of the "vulnerabilities" service. Find may return the following errors:

  • "no_match" (type NoMatch)
  • error: internal error

func (*Client) List

func (c *Client) List(ctx context.Context, p *LimitPayload) (res []*Vulnerability, err error)

List calls the "list" endpoint of the "vulnerabilities" service.

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, p *SubmitPayload) (err error)

Submit calls the "submit" endpoint of the "vulnerabilities" service. Submit may return the following errors:

  • "no_match" (type NoMatch)
  • error: internal error

type Endpoints

type Endpoints struct {
	Find   endpoint.Endpoint
	List   endpoint.Endpoint
	Submit endpoint.Endpoint
}

Endpoints wraps the "vulnerabilities" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "vulnerabilities" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint)

Use applies the given middleware to all the "vulnerabilities" service endpoints.

type FindPayload

type FindPayload struct {
	// Unique ID of the vulnerability
	ID uint64
}

FindPayload is the payload type of the vulnerabilities service find method.

type LimitPayload

type LimitPayload struct {
	// Limit the number of results
	Limit *int32
}

LimitPayload is the payload type of the vulnerabilities service list method.

type NoMatch

type NoMatch string

No vulnerability matched given criteria

func (NoMatch) Error

func (e NoMatch) Error() string

Error returns an error description.

func (NoMatch) ErrorName

func (e NoMatch) ErrorName() string

ErrorName returns "no_match".

type Service

type Service interface {
	// Find implements find.
	Find(context.Context, *FindPayload) (res *Vulnerability, err error)
	// List all of the vulnerabilities
	List(context.Context, *LimitPayload) (res []*Vulnerability, err error)
	// Submit implements submit.
	Submit(context.Context, *SubmitPayload) (err error)
}

The vulnerability service handles the creation and querying of security vulnerabilities.

type SubmitPayload

type SubmitPayload struct {
	// Title of the vulnerability
	Title *string
	// Description of the vulnerability
	Description *string
	// If the vulnerability is exploitable
	Exploitable *bool
	// Severity score of the vulnerability
	CvssScore *float32
	// If the vulnerability is patchable
	IsPatchable *bool
	// If the vulnerability is upgradeable
	IsUpgradeable *bool
}

SubmitPayload is the payload type of the vulnerabilities service submit method.

type Vulnerability

type Vulnerability struct {
	// Unique ID of the vulnerability
	ID uint64
	// Title of the vulnerability
	Title *string
	// Description of the vulnerability
	Description *string
	// If the vulnerability is exploitable
	Exploitable *bool
	// Severity score of the vulnerability
	CvssScore *float32
	// If the vulnerability is patchable
	IsPatchable *bool
	// If the vulnerability is upgradeable
	IsUpgradeable *bool
}

Vulnerability is the result type of the vulnerabilities service find method.

Jump to

Keyboard shortcuts

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