weakspot_kit_api

package module
v0.0.0-...-ab2b92a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 10 Imported by: 0

README

WeakspotKit Go API

This module exposes Go types that you will find helpful when implementing an WeakspotKit extension.

The types are generated automatically from the WeakspotKit OpenAPI specification.

Installation

Add the following to your go.mod file:

go get github.com/steadybit/weakspot-kit/go/weakspot_kit_api@v0.1.0

Usage

import (
	"github.com/steadybit/weakspot-kit/go/weakspot_kit_api"
)

WeakspotList := weakspot_kit_api.WeakspotList{
    Weakspots: []weakspot_kit_api.DescribingEndpointReference{
        {
            "GET",
            "/weakspots/my-fancy-weakspot",
        },
    },
}

Documentation

Overview

Package weakspot_kit_api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func Ptr

func Ptr[T any](val T) *T

Types

type DescribingEndpointReference

type DescribingEndpointReference struct {
	// Method HTTP method to use when calling the HTTP endpoint.
	Method DescribingEndpointReferenceMethod `json:"method"`

	// Path Absolute path of the HTTP endpoint.
	Path string `json:"path"`
}

DescribingEndpointReference HTTP endpoint which the Steadybit platform/agent could communicate with.

type DescribingEndpointReferenceMethod

type DescribingEndpointReferenceMethod string

DescribingEndpointReferenceMethod HTTP method to use when calling the HTTP endpoint.

const (
	GET DescribingEndpointReferenceMethod = "GET"
)

Defines values for DescribingEndpointReferenceMethod.

type Experiment

type Experiment = interface{}

Experiment Provides a template about a weakspot experiment

type WeakspotDescription

type WeakspotDescription struct {
	// AssesmentBaseQuery A Assessment Target Base Query that is used identifies targets that could have this weakspot.
	AssesmentBaseQuery string `json:"assesmentBaseQuery"`

	// AssesmentQueryAddon A Assessment Target Query Addon that is used to identify targets with this weakspot in the target list of the assesmentBaseQuery
	AssesmentQueryAddon string `json:"assesmentQueryAddon"`

	// Experiments A list of experiments that are available for this weakspot.
	Experiments *[]Experiment `json:"experiments,omitempty"`

	// Finding A description of the finding that is reported when the weakspot is found in mark down format.
	Finding *string `json:"finding,omitempty"`

	// Guidance A guidance why this weakspot is important in mark down format..
	Guidance *string `json:"guidance,omitempty"`

	// Icon A svg of an icon that represents the weakspot.
	Icon string `json:"icon"`

	// Id A technical ID that is used to uniquely identify this type of weakspot. You will typically want to use something like `org.example.extension.my-fancy-weakspot`.
	Id string `json:"id"`

	// Instructions A description of the instructions how to fix this weakspot in mark down format.
	Instructions *string `json:"instructions,omitempty"`

	// Label A human-readable label for the weakspot.
	Label string `json:"label"`

	// LooksGood A description of the finding that is reported when the weakspot is not found in mark down format.
	LooksGood *string `json:"looksGood,omitempty"`

	// Tags A list of tags that describe the weakspot.
	Tags *[]string `json:"tags,omitempty"`

	// Version The version of the weakspot. This is used to identify the version of the weakspot and is used for compatibility checks.
	Version string `json:"version"`
}

WeakspotDescription Provides details about a weakspot

type WeakspotDescriptionResponse

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

WeakspotDescriptionResponse defines model for WeakspotDescriptionResponse.

func (WeakspotDescriptionResponse) AsWeakspotDescription

func (t WeakspotDescriptionResponse) AsWeakspotDescription() (WeakspotDescription, error)

AsWeakspotDescription returns the union data inside the WeakspotDescriptionResponse as a WeakspotDescription

func (WeakspotDescriptionResponse) AsWeakspotKitError

func (t WeakspotDescriptionResponse) AsWeakspotKitError() (WeakspotKitError, error)

AsWeakspotKitError returns the union data inside the WeakspotDescriptionResponse as a WeakspotKitError

func (*WeakspotDescriptionResponse) FromWeakspotDescription

func (t *WeakspotDescriptionResponse) FromWeakspotDescription(v WeakspotDescription) error

FromWeakspotDescription overwrites any union data inside the WeakspotDescriptionResponse as the provided WeakspotDescription

func (*WeakspotDescriptionResponse) FromWeakspotKitError

func (t *WeakspotDescriptionResponse) FromWeakspotKitError(v WeakspotKitError) error

FromWeakspotKitError overwrites any union data inside the WeakspotDescriptionResponse as the provided WeakspotKitError

func (WeakspotDescriptionResponse) MarshalJSON

func (t WeakspotDescriptionResponse) MarshalJSON() ([]byte, error)

func (*WeakspotDescriptionResponse) MergeWeakspotDescription

func (t *WeakspotDescriptionResponse) MergeWeakspotDescription(v WeakspotDescription) error

MergeWeakspotDescription performs a merge with any union data inside the WeakspotDescriptionResponse, using the provided WeakspotDescription

func (*WeakspotDescriptionResponse) MergeWeakspotKitError

func (t *WeakspotDescriptionResponse) MergeWeakspotKitError(v WeakspotKitError) error

MergeWeakspotKitError performs a merge with any union data inside the WeakspotDescriptionResponse, using the provided WeakspotKitError

func (*WeakspotDescriptionResponse) UnmarshalJSON

func (t *WeakspotDescriptionResponse) UnmarshalJSON(b []byte) error

type WeakspotKitError

type WeakspotKitError struct {
	// Detail A human-readable explanation specific to this occurrence of the problem.
	Detail *string `json:"detail,omitempty"`

	// Instance A URI reference that identifies the specific occurrence of the problem.
	Instance *string `json:"instance,omitempty"`

	// Title A short, human-readable summary of the problem type.
	Title string `json:"title"`

	// Type A URI reference that identifies the problem type.
	Type *string `json:"type,omitempty"`
}

WeakspotKitError RFC 7807 Problem Details for HTTP APIs compliant response body for error scenarios

type WeakspotList

type WeakspotList struct {
	Weakspots []DescribingEndpointReference `json:"weakspots"`
}

WeakspotList Lists all weakspots that the platform/agent could consume.

type WeakspotListResponse

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

WeakspotListResponse defines model for WeakspotListResponse.

func (WeakspotListResponse) AsWeakspotKitError

func (t WeakspotListResponse) AsWeakspotKitError() (WeakspotKitError, error)

AsWeakspotKitError returns the union data inside the WeakspotListResponse as a WeakspotKitError

func (WeakspotListResponse) AsWeakspotList

func (t WeakspotListResponse) AsWeakspotList() (WeakspotList, error)

AsWeakspotList returns the union data inside the WeakspotListResponse as a WeakspotList

func (*WeakspotListResponse) FromWeakspotKitError

func (t *WeakspotListResponse) FromWeakspotKitError(v WeakspotKitError) error

FromWeakspotKitError overwrites any union data inside the WeakspotListResponse as the provided WeakspotKitError

func (*WeakspotListResponse) FromWeakspotList

func (t *WeakspotListResponse) FromWeakspotList(v WeakspotList) error

FromWeakspotList overwrites any union data inside the WeakspotListResponse as the provided WeakspotList

func (WeakspotListResponse) MarshalJSON

func (t WeakspotListResponse) MarshalJSON() ([]byte, error)

func (*WeakspotListResponse) MergeWeakspotKitError

func (t *WeakspotListResponse) MergeWeakspotKitError(v WeakspotKitError) error

MergeWeakspotKitError performs a merge with any union data inside the WeakspotListResponse, using the provided WeakspotKitError

func (*WeakspotListResponse) MergeWeakspotList

func (t *WeakspotListResponse) MergeWeakspotList(v WeakspotList) error

MergeWeakspotList performs a merge with any union data inside the WeakspotListResponse, using the provided WeakspotList

func (*WeakspotListResponse) UnmarshalJSON

func (t *WeakspotListResponse) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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