client

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 14 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortScansPath

func AbortScansPath(id uuid.UUID) string

AbortScansPath computes a request path to the abort action of Scans.

func ChecksScansPath

func ChecksScansPath(id uuid.UUID) string

ChecksScansPath computes a request path to the checks action of Scans.

func CreateScansPath

func CreateScansPath() string

CreateScansPath computes a request path to the create action of Scans.

func IndexAssettypesPath

func IndexAssettypesPath() string

IndexAssettypesPath computes a request path to the index action of Assettypes.

func IndexChecktypesPath

func IndexChecktypesPath() string

IndexChecktypesPath computes a request path to the index action of Checktypes.

func IndexScansPath

func IndexScansPath() string

IndexScansPath computes a request path to the index action of Scans.

func ShowChecksPath

func ShowChecksPath(id uuid.UUID) string

ShowChecksPath computes a request path to the show action of Checks.

func ShowChecktypesPath

func ShowChecktypesPath(id uuid.UUID) string

ShowChecktypesPath computes a request path to the show action of Checktypes.

func ShowHealthcheckPath

func ShowHealthcheckPath() string

ShowHealthcheckPath computes a request path to the show action of healthcheck.

func ShowScansPath

func ShowScansPath(id uuid.UUID) string

ShowScansPath computes a request path to the show action of Scans.

func StatsScansPath

func StatsScansPath(id uuid.UUID) string

StatsScansPath computes a request path to the stats action of Scans.

Types

type Assettype

type Assettype struct {
	Assettype *string  `form:"assettype,omitempty" json:"assettype,omitempty" yaml:"assettype,omitempty" xml:"assettype,omitempty"`
	Name      []string `form:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"`
}

Assettype media type (default view)

Identifier: application/vnd.assettype+json; view=default

type AssettypeCollection

type AssettypeCollection []*Assettype

AssettypeCollection is the media type for an array of Assettype (default view)

Identifier: application/vnd.assettype+json; type=collection; view=default

type AssettypeType

type AssettypeType struct {
	Assettype *string  `form:"assettype,omitempty" json:"assettype,omitempty" yaml:"assettype,omitempty" xml:"assettype,omitempty"`
	Name      []string `form:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"`
}

AssettypeType user type.

type Checkdata

type Checkdata struct {
	Assettype     *string   `form:"assettype,omitempty" json:"assettype,omitempty" yaml:"assettype,omitempty" xml:"assettype,omitempty"`
	ChecktypeName string    `form:"checktype_name" json:"checktype_name" yaml:"checktype_name" xml:"checktype_name"`
	ID            uuid.UUID `form:"id" json:"id" yaml:"id" xml:"id"`
	Image         *string   `form:"image,omitempty" json:"image,omitempty" yaml:"image,omitempty" xml:"image,omitempty"`
	Options       *string   `form:"options,omitempty" json:"options,omitempty" yaml:"options,omitempty" xml:"options,omitempty"`
	Raw           *string   `form:"raw,omitempty" json:"raw,omitempty" yaml:"raw,omitempty" xml:"raw,omitempty"`
	Report        *string   `form:"report,omitempty" json:"report,omitempty" yaml:"report,omitempty" xml:"report,omitempty"`
	Status        string    `form:"status" json:"status" yaml:"status" xml:"status"`
	Tag           *string   `form:"tag,omitempty" json:"tag,omitempty" yaml:"tag,omitempty" xml:"tag,omitempty"`
	Target        string    `form:"target" json:"target" yaml:"target" xml:"target"`
}

Checkdata media type (default view)

Identifier: application/vnd.checkdata+json; view=default

func (*Checkdata) Validate

func (mt *Checkdata) Validate() (err error)

Validate validates the Checkdata media type instance.

type Checks

type Checks struct {
	Checks []*Checkdata `form:"checks" json:"checks" yaml:"checks" xml:"checks"`
}

Checks media type (default view)

Identifier: application/vnd.checks+json; view=default

func (*Checks) Validate

func (mt *Checks) Validate() (err error)

Validate validates the Checks media type instance.

type Checktype

type Checktype struct {
	Checktype *ChecktypeType `form:"checktype" json:"checktype" yaml:"checktype" xml:"checktype"`
}

Checktype media type (default view)

Identifier: application/vnd.checktype+json; view=default

func (*Checktype) Validate

func (mt *Checktype) Validate() (err error)

Validate validates the Checktype media type instance.

type ChecktypeType

type ChecktypeType struct {
	// List of the asset types that this checktype allows to be used against to
	Assets      []string  `form:"assets,omitempty" json:"assets,omitempty" yaml:"assets,omitempty" xml:"assets,omitempty"`
	Description *string   `form:"description,omitempty" json:"description,omitempty" yaml:"description,omitempty" xml:"description,omitempty"`
	Enabled     *bool     `form:"enabled,omitempty" json:"enabled,omitempty" yaml:"enabled,omitempty" xml:"enabled,omitempty"`
	ID          uuid.UUID `form:"id" json:"id" yaml:"id" xml:"id"`
	// Image that needs to be pulled to run the Check of this type
	Image string `form:"image" json:"image" yaml:"image" xml:"image"`
	Name  string `form:"name" json:"name" yaml:"name" xml:"name"`
	// Default configuration options for the Checktype. It should be in JSON format
	Options *string `form:"options,omitempty" json:"options,omitempty" yaml:"options,omitempty" xml:"options,omitempty"`
	// The queue name to be used by a check of this type
	QueueName *string `form:"queue_name,omitempty" json:"queue_name,omitempty" yaml:"queue_name,omitempty" xml:"queue_name,omitempty"`
	// List of required vars that the agent must inject to a check using this checktype
	RequiredVars []string `form:"required_vars,omitempty" json:"required_vars,omitempty" yaml:"required_vars,omitempty" xml:"required_vars,omitempty"`
	// Specifies the maximum amount of time that the check should be running before it's killed
	Timeout *int `form:"timeout,omitempty" json:"timeout,omitempty" yaml:"timeout,omitempty" xml:"timeout,omitempty"`
}

ChecktypeType user type.

func (*ChecktypeType) Validate

func (ut *ChecktypeType) Validate() (err error)

Validate validates the ChecktypeType type instance.

type Checktypes

type Checktypes struct {
	Checktypes []*ChecktypeType `form:"checktypes" json:"checktypes" yaml:"checktypes" xml:"checktypes"`
}

Checktypes media type (default view)

Identifier: application/vnd.checktypes+json; view=default

func (*Checktypes) Validate

func (mt *Checktypes) Validate() (err error)

Validate validates the Checktypes media type instance.

type ChecktypesGroup

type ChecktypesGroup struct {
	Checktypes []*ScanChecktype `form:"checktypes,omitempty" json:"checktypes,omitempty" yaml:"checktypes,omitempty" xml:"checktypes,omitempty"`
	Name       *string          `form:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"`
}

ChecktypesGroup user type.

type Client

type Client struct {
	*goaclient.Client
	Encoder *goa.HTTPEncoder
	Decoder *goa.HTTPDecoder
}

Client is the vulcan-core service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) AbortScans

func (c *Client) AbortScans(ctx context.Context, path string) (*http.Response, error)

Abort a scan

func (*Client) ChecksScans

func (c *Client) ChecksScans(ctx context.Context, path string) (*http.Response, error)

Get checks of the Scan

func (*Client) CreateScans

func (c *Client) CreateScans(ctx context.Context, path string, payload *ScanPayload) (*http.Response, error)

Create a new Scan

func (*Client) DecodeAssettype

func (c *Client) DecodeAssettype(resp *http.Response) (*Assettype, error)

DecodeAssettype decodes the Assettype instance encoded in resp body.

func (*Client) DecodeAssettypeCollection

func (c *Client) DecodeAssettypeCollection(resp *http.Response) (AssettypeCollection, error)

DecodeAssettypeCollection decodes the AssettypeCollection instance encoded in resp body.

func (*Client) DecodeCheckdata

func (c *Client) DecodeCheckdata(resp *http.Response) (*Checkdata, error)

DecodeCheckdata decodes the Checkdata instance encoded in resp body.

func (*Client) DecodeChecks

func (c *Client) DecodeChecks(resp *http.Response) (*Checks, error)

DecodeChecks decodes the Checks instance encoded in resp body.

func (*Client) DecodeChecktype

func (c *Client) DecodeChecktype(resp *http.Response) (*Checktype, error)

DecodeChecktype decodes the Checktype instance encoded in resp body.

func (*Client) DecodeChecktypes

func (c *Client) DecodeChecktypes(resp *http.Response) (*Checktypes, error)

DecodeChecktypes decodes the Checktypes instance encoded in resp body.

func (*Client) DecodeCreatescandata

func (c *Client) DecodeCreatescandata(resp *http.Response) (*Createscandata, error)

DecodeCreatescandata decodes the Createscandata instance encoded in resp body.

func (*Client) DecodeErrorResponse

func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)

DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.

func (*Client) DecodeScandata

func (c *Client) DecodeScandata(resp *http.Response) (*Scandata, error)

DecodeScandata decodes the Scandata instance encoded in resp body.

func (*Client) DecodeScans

func (c *Client) DecodeScans(resp *http.Response) (*Scans, error)

DecodeScans decodes the Scans instance encoded in resp body.

func (*Client) DecodeStat

func (c *Client) DecodeStat(resp *http.Response) (*Stat, error)

DecodeStat decodes the Stat instance encoded in resp body.

func (*Client) DecodeStats

func (c *Client) DecodeStats(resp *http.Response) (*Stats, error)

DecodeStats decodes the Stats instance encoded in resp body.

func (*Client) DownloadSwaggerJSON

func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)

DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) IndexAssettypes

func (c *Client) IndexAssettypes(ctx context.Context, path string) (*http.Response, error)

Get all assettypes and per each one the checktypes that are accepting that concrete assettype

func (*Client) IndexChecktypes

func (c *Client) IndexChecktypes(ctx context.Context, path string, enabled *string, name *string) (*http.Response, error)

Get all checktypes

func (*Client) IndexScans

func (c *Client) IndexScans(ctx context.Context, path string, externalID *string, limit *int, offset *int) (*http.Response, error)

Get all scans

func (*Client) NewAbortScansRequest

func (c *Client) NewAbortScansRequest(ctx context.Context, path string) (*http.Request, error)

NewAbortScansRequest create the request corresponding to the abort action endpoint of the Scans resource.

func (*Client) NewChecksScansRequest

func (c *Client) NewChecksScansRequest(ctx context.Context, path string) (*http.Request, error)

NewChecksScansRequest create the request corresponding to the checks action endpoint of the Scans resource.

func (*Client) NewCreateScansRequest

func (c *Client) NewCreateScansRequest(ctx context.Context, path string, payload *ScanPayload) (*http.Request, error)

NewCreateScansRequest create the request corresponding to the create action endpoint of the Scans resource.

func (*Client) NewIndexAssettypesRequest

func (c *Client) NewIndexAssettypesRequest(ctx context.Context, path string) (*http.Request, error)

NewIndexAssettypesRequest create the request corresponding to the index action endpoint of the Assettypes resource.

func (*Client) NewIndexChecktypesRequest

func (c *Client) NewIndexChecktypesRequest(ctx context.Context, path string, enabled *string, name *string) (*http.Request, error)

NewIndexChecktypesRequest create the request corresponding to the index action endpoint of the Checktypes resource.

func (*Client) NewIndexScansRequest

func (c *Client) NewIndexScansRequest(ctx context.Context, path string, externalID *string, limit *int, offset *int) (*http.Request, error)

NewIndexScansRequest create the request corresponding to the index action endpoint of the Scans resource.

func (*Client) NewShowChecksRequest

func (c *Client) NewShowChecksRequest(ctx context.Context, path string) (*http.Request, error)

NewShowChecksRequest create the request corresponding to the show action endpoint of the Checks resource.

func (*Client) NewShowChecktypesRequest

func (c *Client) NewShowChecktypesRequest(ctx context.Context, path string) (*http.Request, error)

NewShowChecktypesRequest create the request corresponding to the show action endpoint of the Checktypes resource.

func (*Client) NewShowHealthcheckRequest

func (c *Client) NewShowHealthcheckRequest(ctx context.Context, path string) (*http.Request, error)

NewShowHealthcheckRequest create the request corresponding to the show action endpoint of the healthcheck resource.

func (*Client) NewShowScansRequest

func (c *Client) NewShowScansRequest(ctx context.Context, path string) (*http.Request, error)

NewShowScansRequest create the request corresponding to the show action endpoint of the Scans resource.

func (*Client) NewStatsScansRequest

func (c *Client) NewStatsScansRequest(ctx context.Context, path string) (*http.Request, error)

NewStatsScansRequest create the request corresponding to the stats action endpoint of the Scans resource.

func (*Client) ShowChecks

func (c *Client) ShowChecks(ctx context.Context, path string) (*http.Response, error)

Get a Check by its ID

func (*Client) ShowChecktypes

func (c *Client) ShowChecktypes(ctx context.Context, path string) (*http.Response, error)

Get a Checktype by its ID

func (*Client) ShowHealthcheck

func (c *Client) ShowHealthcheck(ctx context.Context, path string) (*http.Response, error)

Get the health status for the application

func (*Client) ShowScans

func (c *Client) ShowScans(ctx context.Context, path string) (*http.Response, error)

Get a Scan by its ID

func (*Client) StatsScans

func (c *Client) StatsScans(ctx context.Context, path string) (*http.Response, error)

Get stats of the Scan

type Createscandata

type Createscandata struct {
	ScanID *uuid.UUID `form:"scan_id,omitempty" json:"scan_id,omitempty" yaml:"scan_id,omitempty" xml:"scan_id,omitempty"`
}

Createscandata media type (default view)

Identifier: application/vnd.createscandata+json; view=default

type ScanChecktype

type ScanChecktype struct {
	Name    *string `form:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"`
	Options *string `form:"options,omitempty" json:"options,omitempty" yaml:"options,omitempty" xml:"options,omitempty"`
}

ScanChecktype user type.

type ScanPayload

type ScanPayload struct {
	ExternalID    *uuid.UUID          `form:"external_id,omitempty" json:"external_id,omitempty" yaml:"external_id,omitempty" xml:"external_id,omitempty"`
	ScheduledTime *time.Time          `` /* 126-byte string literal not displayed */
	Tag           *string             `form:"tag,omitempty" json:"tag,omitempty" yaml:"tag,omitempty" xml:"tag,omitempty"`
	TargetGroups  []*ScanTargetsGroup `form:"target_groups,omitempty" json:"target_groups,omitempty" yaml:"target_groups,omitempty" xml:"target_groups,omitempty"`
	Trigger       *string             `form:"trigger,omitempty" json:"trigger,omitempty" yaml:"trigger,omitempty" xml:"trigger,omitempty"`
}

ScanPayload user type.

type ScanTargetsGroup

type ScanTargetsGroup struct {
	ChecktypesGroup *ChecktypesGroup `` /* 134-byte string literal not displayed */
	TargetGroup     *TargetGroup     `form:"target_group,omitempty" json:"target_group,omitempty" yaml:"target_group,omitempty" xml:"target_group,omitempty"`
}

ScanTargetsGroup user type.

type Scandata

type Scandata struct {
	CheckCount *int      `form:"check_count,omitempty" json:"check_count,omitempty" yaml:"check_count,omitempty" xml:"check_count,omitempty"`
	ID         uuid.UUID `form:"id" json:"id" yaml:"id" xml:"id"`
	Status     string    `form:"status" json:"status" yaml:"status" xml:"status"`
}

Scandata media type (default view)

Identifier: application/vnd.scandata+json; view=default

func (*Scandata) Validate

func (mt *Scandata) Validate() (err error)

Validate validates the Scandata media type instance.

type Scans

type Scans struct {
	Scans []*Scandata `form:"scans" json:"scans" yaml:"scans" xml:"scans"`
}

Scans media type (default view)

Identifier: application/vnd.scans+json; view=default

func (*Scans) Validate

func (mt *Scans) Validate() (err error)

Validate validates the Scans media type instance.

type Stat

type Stat struct {
	Status string `form:"status" json:"status" yaml:"status" xml:"status"`
	Total  int    `form:"total" json:"total" yaml:"total" xml:"total"`
}

Stat media type (default view)

Identifier: application/vnd.stat+json; view=default

func (*Stat) Validate

func (mt *Stat) Validate() (err error)

Validate validates the Stat media type instance.

type Stats

type Stats struct {
	Checks []*Stat `form:"checks" json:"checks" yaml:"checks" xml:"checks"`
}

Stats media type (default view)

Identifier: application/vnd.stats+json; view=default

func (*Stats) Validate

func (mt *Stats) Validate() (err error)

Validate validates the Stats media type instance.

type Target

type Target struct {
	Identifier *string `form:"identifier,omitempty" json:"identifier,omitempty" yaml:"identifier,omitempty" xml:"identifier,omitempty"`
	Options    *string `form:"options,omitempty" json:"options,omitempty" yaml:"options,omitempty" xml:"options,omitempty"`
	Type       *string `form:"type,omitempty" json:"type,omitempty" yaml:"type,omitempty" xml:"type,omitempty"`
}

Target user type.

type TargetGroup

type TargetGroup struct {
	Name    *string   `form:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"`
	Options *string   `form:"options,omitempty" json:"options,omitempty" yaml:"options,omitempty" xml:"options,omitempty"`
	Targets []*Target `form:"targets,omitempty" json:"targets,omitempty" yaml:"targets,omitempty" xml:"targets,omitempty"`
}

TargetGroup user type.

Jump to

Keyboard shortcuts

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