api

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

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

Code generated by unknown module path version unknown version DO NOT EDIT.

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

Code generated by unknown module path version unknown version DO NOT EDIT.

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

Code generated by unknown module path version unknown version DO NOT EDIT.

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

Code generated by unknown module path version unknown version DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, p Problem)

Error creates an detailed error response.

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 Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewGetBeaconBlobRequest

func NewGetBeaconBlobRequest(server string, segmentId SegmentID) (*http.Request, error)

NewGetBeaconBlobRequest generates requests for GetBeaconBlob

func NewGetBeaconRequest

func NewGetBeaconRequest(server string, segmentId SegmentID) (*http.Request, error)

NewGetBeaconRequest generates requests for GetBeacon

func NewGetBeaconsRequest

func NewGetBeaconsRequest(server string, params *GetBeaconsParams) (*http.Request, error)

NewGetBeaconsRequest generates requests for GetBeacons

func NewGetCaRequest

func NewGetCaRequest(server string) (*http.Request, error)

NewGetCaRequest generates requests for GetCa

func NewGetCertificateBlobRequest

func NewGetCertificateBlobRequest(server string, chainId ChainID) (*http.Request, error)

NewGetCertificateBlobRequest generates requests for GetCertificateBlob

func NewGetCertificateRequest

func NewGetCertificateRequest(server string, chainId ChainID) (*http.Request, error)

NewGetCertificateRequest generates requests for GetCertificate

func NewGetCertificatesRequest

func NewGetCertificatesRequest(server string, params *GetCertificatesParams) (*http.Request, error)

NewGetCertificatesRequest generates requests for GetCertificates

func NewGetConfigRequest

func NewGetConfigRequest(server string) (*http.Request, error)

NewGetConfigRequest generates requests for GetConfig

func NewGetHealthRequest

func NewGetHealthRequest(server string) (*http.Request, error)

NewGetHealthRequest generates requests for GetHealth

func NewGetInfoRequest

func NewGetInfoRequest(server string) (*http.Request, error)

NewGetInfoRequest generates requests for GetInfo

func NewGetLogLevelRequest

func NewGetLogLevelRequest(server string) (*http.Request, error)

NewGetLogLevelRequest generates requests for GetLogLevel

func NewGetSegmentBlobRequest

func NewGetSegmentBlobRequest(server string, segmentId SegmentID) (*http.Request, error)

NewGetSegmentBlobRequest generates requests for GetSegmentBlob

func NewGetSegmentRequest

func NewGetSegmentRequest(server string, segmentId SegmentID) (*http.Request, error)

NewGetSegmentRequest generates requests for GetSegment

func NewGetSegmentsRequest

func NewGetSegmentsRequest(server string, params *GetSegmentsParams) (*http.Request, error)

NewGetSegmentsRequest generates requests for GetSegments

func NewGetSignerChainRequest

func NewGetSignerChainRequest(server string) (*http.Request, error)

NewGetSignerChainRequest generates requests for GetSignerChain

func NewGetSignerRequest

func NewGetSignerRequest(server string) (*http.Request, error)

NewGetSignerRequest generates requests for GetSigner

func NewGetTopologyRequest

func NewGetTopologyRequest(server string) (*http.Request, error)

NewGetTopologyRequest generates requests for GetTopology

func NewGetTrcBlobRequest

func NewGetTrcBlobRequest(server string, isd int, base int, serial int) (*http.Request, error)

NewGetTrcBlobRequest generates requests for GetTrcBlob

func NewGetTrcRequest

func NewGetTrcRequest(server string, isd int, base int, serial int) (*http.Request, error)

NewGetTrcRequest generates requests for GetTrc

func NewGetTrcsRequest

func NewGetTrcsRequest(server string, params *GetTrcsParams) (*http.Request, error)

NewGetTrcsRequest generates requests for GetTrcs

func NewSetLogLevelRequest

func NewSetLogLevelRequest(server string, body SetLogLevelJSONRequestBody) (*http.Request, error)

NewSetLogLevelRequest calls the generic SetLogLevel builder with application/json body

func NewSetLogLevelRequestWithBody

func NewSetLogLevelRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewSetLogLevelRequestWithBody generates requests for SetLogLevel with any type of body

func PathToRawSpec

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

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

func ServeSpecInteractive

func ServeSpecInteractive(w http.ResponseWriter, r *http.Request)

ServeSpecInteractive serves the interactive redocly OpenAPI3 spec.

func ServeSpecJSON

func ServeSpecJSON(w http.ResponseWriter, r *http.Request)

ServeSpecJSON serves the json encoded OpenAPI3 spec.

func UnpackBeaconUsages

func UnpackBeaconUsages(u beacon.Usage) []string

UnpackBeaconUsages extracts the Usage's bits as snake case string constants for the API.

Types

type BadRequest

type BadRequest StandardError

BadRequest defines model for BadRequest.

type Beacon

type Beacon struct {
	// Embedded struct due to allOf(#/components/schemas/Segment)
	Segment `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	// Ingress interface of the beacon.
	IngressInterface int          `json:"ingress_interface"`
	Usages           BeaconUsages `json:"usages"`
}

Beacon defines model for Beacon.

type BeaconGetResponseJson

type BeaconGetResponseJson struct {
	Beacon Beacon `json:"beacon"`
}

BeaconGetResponseJson defines model for BeaconGetResponseJson.

type BeaconStore

type BeaconStore interface {
	GetBeacons(context.Context, *beaconstorage.QueryParams) ([]beaconstorage.Beacon, error)
}

type BeaconUsage

type BeaconUsage string

BeaconUsage defines model for BeaconUsage.

const (
	BeaconUsageCoreRegistration BeaconUsage = "core_registration"

	BeaconUsageDownRegistration BeaconUsage = "down_registration"

	BeaconUsagePropagation BeaconUsage = "propagation"

	BeaconUsageUpRegistration BeaconUsage = "up_registration"
)

Defines values for BeaconUsage.

type BeaconUsages

type BeaconUsages []BeaconUsage

BeaconUsages defines model for BeaconUsages.

type CA

type CA struct {
	CertValidity Validity     `json:"cert_validity"`
	Policy       Policy       `json:"policy"`
	Subject      Subject      `json:"subject"`
	SubjectKeyId SubjectKeyID `json:"subject_key_id"`
}

CA defines model for CA.

type Certificate

type Certificate struct {
	DistinguishedName string       `json:"distinguished_name"`
	IsdAs             IsdAs        `json:"isd_as"`
	SubjectKeyAlgo    string       `json:"subject_key_algo"`
	SubjectKeyId      SubjectKeyID `json:"subject_key_id"`
	Validity          Validity     `json:"validity"`
}

Certificate defines model for Certificate.

type Chain

type Chain struct {
	Issuer  Certificate `json:"issuer"`
	Subject Certificate `json:"subject"`
}

Chain defines model for Chain.

type ChainBrief

type ChainBrief struct {
	Id       ChainID  `json:"id"`
	Issuer   IsdAs    `json:"issuer"`
	Subject  IsdAs    `json:"subject"`
	Validity Validity `json:"validity"`
}

ChainBrief defines model for ChainBrief.

type ChainID

type ChainID string

ChainID defines model for ChainID.

type Check

type Check struct {
	Data CheckData `json:"data"`

	// Additional information.
	Detail *string `json:"detail,omitempty"`

	// Name of health check.
	Name string `json:"name"`

	// Reason for check failure.
	Reason *string `json:"reason,omitempty"`
	Status Status  `json:"status"`
}

Check defines model for Check.

type CheckData

type CheckData struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

CheckData defines model for CheckData.

func (CheckData) Get

func (a CheckData) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for CheckData. Returns the specified element and whether it was found

func (CheckData) MarshalJSON

func (a CheckData) MarshalJSON() ([]byte, error)

Override default JSON handling for CheckData to handle AdditionalProperties

func (*CheckData) Set

func (a *CheckData) Set(fieldName string, value interface{})

Setter for additional properties for CheckData

func (*CheckData) UnmarshalJSON

func (a *CheckData) UnmarshalJSON(b []byte) error

Override default JSON handling for CheckData to handle AdditionalProperties

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetBeacon

func (c *Client) GetBeacon(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetBeaconBlob

func (c *Client) GetBeaconBlob(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetBeacons

func (c *Client) GetBeacons(ctx context.Context, params *GetBeaconsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCa

func (c *Client) GetCa(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCertificate

func (c *Client) GetCertificate(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCertificateBlob

func (c *Client) GetCertificateBlob(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCertificates

func (c *Client) GetCertificates(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetConfig

func (c *Client) GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetHealth

func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetInfo

func (c *Client) GetInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLogLevel

func (c *Client) GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSegment

func (c *Client) GetSegment(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSegmentBlob

func (c *Client) GetSegmentBlob(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSegments

func (c *Client) GetSegments(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSigner

func (c *Client) GetSigner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSignerChain

func (c *Client) GetSignerChain(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetTopology

func (c *Client) GetTopology(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetTrc

func (c *Client) GetTrc(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetTrcBlob

func (c *Client) GetTrcBlob(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetTrcs

func (c *Client) GetTrcs(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SetLogLevel

func (c *Client) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SetLogLevelWithBody

func (c *Client) SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetBeacons request
	GetBeacons(ctx context.Context, params *GetBeaconsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetBeacon request
	GetBeacon(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetBeaconBlob request
	GetBeaconBlob(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCa request
	GetCa(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCertificates request
	GetCertificates(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCertificate request
	GetCertificate(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCertificateBlob request
	GetCertificateBlob(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetConfig request
	GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetHealth request
	GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetInfo request
	GetInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLogLevel request
	GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SetLogLevel request with any body
	SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSegments request
	GetSegments(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSegment request
	GetSegment(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSegmentBlob request
	GetSegmentBlob(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSigner request
	GetSigner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSignerChain request
	GetSignerChain(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTopology request
	GetTopology(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTrcs request
	GetTrcs(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTrc request
	GetTrc(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTrcBlob request
	GetTrcBlob(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetBeaconBlobWithResponse

func (c *ClientWithResponses) GetBeaconBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconBlobResponse, error)

GetBeaconBlobWithResponse request returning *GetBeaconBlobResponse

func (*ClientWithResponses) GetBeaconWithResponse

func (c *ClientWithResponses) GetBeaconWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconResponse, error)

GetBeaconWithResponse request returning *GetBeaconResponse

func (*ClientWithResponses) GetBeaconsWithResponse

func (c *ClientWithResponses) GetBeaconsWithResponse(ctx context.Context, params *GetBeaconsParams, reqEditors ...RequestEditorFn) (*GetBeaconsResponse, error)

GetBeaconsWithResponse request returning *GetBeaconsResponse

func (*ClientWithResponses) GetCaWithResponse

func (c *ClientWithResponses) GetCaWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCaResponse, error)

GetCaWithResponse request returning *GetCaResponse

func (*ClientWithResponses) GetCertificateBlobWithResponse

func (c *ClientWithResponses) GetCertificateBlobWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateBlobResponse, error)

GetCertificateBlobWithResponse request returning *GetCertificateBlobResponse

func (*ClientWithResponses) GetCertificateWithResponse

func (c *ClientWithResponses) GetCertificateWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateResponse, error)

GetCertificateWithResponse request returning *GetCertificateResponse

func (*ClientWithResponses) GetCertificatesWithResponse

func (c *ClientWithResponses) GetCertificatesWithResponse(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*GetCertificatesResponse, error)

GetCertificatesWithResponse request returning *GetCertificatesResponse

func (*ClientWithResponses) GetConfigWithResponse

func (c *ClientWithResponses) GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error)

GetConfigWithResponse request returning *GetConfigResponse

func (*ClientWithResponses) GetHealthWithResponse

func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

GetHealthWithResponse request returning *GetHealthResponse

func (*ClientWithResponses) GetInfoWithResponse

func (c *ClientWithResponses) GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error)

GetInfoWithResponse request returning *GetInfoResponse

func (*ClientWithResponses) GetLogLevelWithResponse

func (c *ClientWithResponses) GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error)

GetLogLevelWithResponse request returning *GetLogLevelResponse

func (*ClientWithResponses) GetSegmentBlobWithResponse

func (c *ClientWithResponses) GetSegmentBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentBlobResponse, error)

GetSegmentBlobWithResponse request returning *GetSegmentBlobResponse

func (*ClientWithResponses) GetSegmentWithResponse

func (c *ClientWithResponses) GetSegmentWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentResponse, error)

GetSegmentWithResponse request returning *GetSegmentResponse

func (*ClientWithResponses) GetSegmentsWithResponse

func (c *ClientWithResponses) GetSegmentsWithResponse(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*GetSegmentsResponse, error)

GetSegmentsWithResponse request returning *GetSegmentsResponse

func (*ClientWithResponses) GetSignerChainWithResponse

func (c *ClientWithResponses) GetSignerChainWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerChainResponse, error)

GetSignerChainWithResponse request returning *GetSignerChainResponse

func (*ClientWithResponses) GetSignerWithResponse

func (c *ClientWithResponses) GetSignerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerResponse, error)

GetSignerWithResponse request returning *GetSignerResponse

func (*ClientWithResponses) GetTopologyWithResponse

func (c *ClientWithResponses) GetTopologyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTopologyResponse, error)

GetTopologyWithResponse request returning *GetTopologyResponse

func (*ClientWithResponses) GetTrcBlobWithResponse

func (c *ClientWithResponses) GetTrcBlobWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcBlobResponse, error)

GetTrcBlobWithResponse request returning *GetTrcBlobResponse

func (*ClientWithResponses) GetTrcWithResponse

func (c *ClientWithResponses) GetTrcWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcResponse, error)

GetTrcWithResponse request returning *GetTrcResponse

func (*ClientWithResponses) GetTrcsWithResponse

func (c *ClientWithResponses) GetTrcsWithResponse(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*GetTrcsResponse, error)

GetTrcsWithResponse request returning *GetTrcsResponse

func (*ClientWithResponses) SetLogLevelWithBodyWithResponse

func (c *ClientWithResponses) SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error)

SetLogLevelWithBodyWithResponse request with arbitrary body returning *SetLogLevelResponse

func (*ClientWithResponses) SetLogLevelWithResponse

func (c *ClientWithResponses) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetBeacons request
	GetBeaconsWithResponse(ctx context.Context, params *GetBeaconsParams, reqEditors ...RequestEditorFn) (*GetBeaconsResponse, error)

	// GetBeacon request
	GetBeaconWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconResponse, error)

	// GetBeaconBlob request
	GetBeaconBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconBlobResponse, error)

	// GetCa request
	GetCaWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCaResponse, error)

	// GetCertificates request
	GetCertificatesWithResponse(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*GetCertificatesResponse, error)

	// GetCertificate request
	GetCertificateWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateResponse, error)

	// GetCertificateBlob request
	GetCertificateBlobWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateBlobResponse, error)

	// GetConfig request
	GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error)

	// GetHealth request
	GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

	// GetInfo request
	GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error)

	// GetLogLevel request
	GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error)

	// SetLogLevel request with any body
	SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error)

	SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error)

	// GetSegments request
	GetSegmentsWithResponse(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*GetSegmentsResponse, error)

	// GetSegment request
	GetSegmentWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentResponse, error)

	// GetSegmentBlob request
	GetSegmentBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentBlobResponse, error)

	// GetSigner request
	GetSignerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerResponse, error)

	// GetSignerChain request
	GetSignerChainWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerChainResponse, error)

	// GetTopology request
	GetTopologyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTopologyResponse, error)

	// GetTrcs request
	GetTrcsWithResponse(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*GetTrcsResponse, error)

	// GetTrc request
	GetTrcWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcResponse, error)

	// GetTrcBlob request
	GetTrcBlobWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcBlobResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type GetBeaconBlobResponse

type GetBeaconBlobResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *StandardError
}

func ParseGetBeaconBlobResponse

func ParseGetBeaconBlobResponse(rsp *http.Response) (*GetBeaconBlobResponse, error)

ParseGetBeaconBlobResponse parses an HTTP response from a GetBeaconBlobWithResponse call

func (GetBeaconBlobResponse) Status

func (r GetBeaconBlobResponse) Status() string

Status returns HTTPResponse.Status

func (GetBeaconBlobResponse) StatusCode

func (r GetBeaconBlobResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetBeaconResponse

type GetBeaconResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BeaconGetResponseJson
	JSON400      *StandardError
}

func ParseGetBeaconResponse

func ParseGetBeaconResponse(rsp *http.Response) (*GetBeaconResponse, error)

ParseGetBeaconResponse parses an HTTP response from a GetBeaconWithResponse call

func (GetBeaconResponse) Status

func (r GetBeaconResponse) Status() string

Status returns HTTPResponse.Status

func (GetBeaconResponse) StatusCode

func (r GetBeaconResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetBeaconsParams

type GetBeaconsParams struct {
	// Start ISD-AS of beacons. The address can include wildcards (0) both for the ISD and AS identifier.
	StartIsdAs *IsdAs `json:"start_isd_as,omitempty"`

	// Minimum allowed usages of the returned beacons. Only beacons that are allowed in all the usages in the list will be returned.
	Usages *BeaconUsages `json:"usages,omitempty"`

	// Ingress interface id.
	IngressInterface *int `json:"ingress_interface,omitempty"`

	// Timestamp at which returned beacons are valid. If unset then the current datetime is used. This only has an effect if `all=false`.
	ValidAt *time.Time `json:"valid_at,omitempty"`

	// Include beacons regardless of expiration and creation time.
	All *bool `json:"all,omitempty"`

	// Whether to reverse the sort order (ascending by default).
	Desc *bool `json:"desc,omitempty"`

	// Attribute by which results are sorted. The value `start_isd_as` refers to the ISD-AS identifier of the first hop.
	Sort *GetBeaconsParamsSort `json:"sort,omitempty"`
}

GetBeaconsParams defines parameters for GetBeacons.

type GetBeaconsParamsSort

type GetBeaconsParamsSort string

GetBeaconsParamsSort defines parameters for GetBeacons.

type GetBeaconsResponse

type GetBeaconsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Beacons *[]Beacon `json:"beacons,omitempty"`
	}
	JSON400 *StandardError
}

func ParseGetBeaconsResponse

func ParseGetBeaconsResponse(rsp *http.Response) (*GetBeaconsResponse, error)

ParseGetBeaconsResponse parses an HTTP response from a GetBeaconsWithResponse call

func (GetBeaconsResponse) Status

func (r GetBeaconsResponse) Status() string

Status returns HTTPResponse.Status

func (GetBeaconsResponse) StatusCode

func (r GetBeaconsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCaResponse

type GetCaResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CA
	JSON400      *StandardError
}

func ParseGetCaResponse

func ParseGetCaResponse(rsp *http.Response) (*GetCaResponse, error)

ParseGetCaResponse parses an HTTP response from a GetCaWithResponse call

func (GetCaResponse) Status

func (r GetCaResponse) Status() string

Status returns HTTPResponse.Status

func (GetCaResponse) StatusCode

func (r GetCaResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCertificateBlobResponse

type GetCertificateBlobResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseGetCertificateBlobResponse

func ParseGetCertificateBlobResponse(rsp *http.Response) (*GetCertificateBlobResponse, error)

ParseGetCertificateBlobResponse parses an HTTP response from a GetCertificateBlobWithResponse call

func (GetCertificateBlobResponse) Status

Status returns HTTPResponse.Status

func (GetCertificateBlobResponse) StatusCode

func (r GetCertificateBlobResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCertificateResponse

type GetCertificateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Chain
}

func ParseGetCertificateResponse

func ParseGetCertificateResponse(rsp *http.Response) (*GetCertificateResponse, error)

ParseGetCertificateResponse parses an HTTP response from a GetCertificateWithResponse call

func (GetCertificateResponse) Status

func (r GetCertificateResponse) Status() string

Status returns HTTPResponse.Status

func (GetCertificateResponse) StatusCode

func (r GetCertificateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCertificatesParams

type GetCertificatesParams struct {
	IsdAs   *IsdAs     `json:"isd_as,omitempty"`
	ValidAt *time.Time `json:"valid_at,omitempty"`
	All     *bool      `json:"all,omitempty"`
}

GetCertificatesParams defines parameters for GetCertificates.

type GetCertificatesResponse

type GetCertificatesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]ChainBrief
}

func ParseGetCertificatesResponse

func ParseGetCertificatesResponse(rsp *http.Response) (*GetCertificatesResponse, error)

ParseGetCertificatesResponse parses an HTTP response from a GetCertificatesWithResponse call

func (GetCertificatesResponse) Status

func (r GetCertificatesResponse) Status() string

Status returns HTTPResponse.Status

func (GetCertificatesResponse) StatusCode

func (r GetCertificatesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetConfigResponse

type GetConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *StandardError
}

func ParseGetConfigResponse

func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error)

ParseGetConfigResponse parses an HTTP response from a GetConfigWithResponse call

func (GetConfigResponse) Status

func (r GetConfigResponse) Status() string

Status returns HTTPResponse.Status

func (GetConfigResponse) StatusCode

func (r GetConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetHealthResponse

type GetHealthResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *HealthResponse
	JSON400      *StandardError
}

func ParseGetHealthResponse

func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error)

ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call

func (GetHealthResponse) Status

func (r GetHealthResponse) Status() string

Status returns HTTPResponse.Status

func (GetHealthResponse) StatusCode

func (r GetHealthResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInfoResponse

type GetInfoResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *StandardError
}

func ParseGetInfoResponse

func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error)

ParseGetInfoResponse parses an HTTP response from a GetInfoWithResponse call

func (GetInfoResponse) Status

func (r GetInfoResponse) Status() string

Status returns HTTPResponse.Status

func (GetInfoResponse) StatusCode

func (r GetInfoResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLogLevelResponse

type GetLogLevelResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *LogLevel
	JSON400      *StandardError
}

func ParseGetLogLevelResponse

func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error)

ParseGetLogLevelResponse parses an HTTP response from a GetLogLevelWithResponse call

func (GetLogLevelResponse) Status

func (r GetLogLevelResponse) Status() string

Status returns HTTPResponse.Status

func (GetLogLevelResponse) StatusCode

func (r GetLogLevelResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSegmentBlobResponse

type GetSegmentBlobResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseGetSegmentBlobResponse

func ParseGetSegmentBlobResponse(rsp *http.Response) (*GetSegmentBlobResponse, error)

ParseGetSegmentBlobResponse parses an HTTP response from a GetSegmentBlobWithResponse call

func (GetSegmentBlobResponse) Status

func (r GetSegmentBlobResponse) Status() string

Status returns HTTPResponse.Status

func (GetSegmentBlobResponse) StatusCode

func (r GetSegmentBlobResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSegmentResponse

type GetSegmentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Segment
}

func ParseGetSegmentResponse

func ParseGetSegmentResponse(rsp *http.Response) (*GetSegmentResponse, error)

ParseGetSegmentResponse parses an HTTP response from a GetSegmentWithResponse call

func (GetSegmentResponse) Status

func (r GetSegmentResponse) Status() string

Status returns HTTPResponse.Status

func (GetSegmentResponse) StatusCode

func (r GetSegmentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSegmentsParams

type GetSegmentsParams struct {
	// Start ISD-AS of segment.
	StartIsdAs *IsdAs `json:"start_isd_as,omitempty"`

	// Terminal AS of segment.
	EndIsdAs *IsdAs `json:"end_isd_as,omitempty"`
}

GetSegmentsParams defines parameters for GetSegments.

type GetSegmentsResponse

type GetSegmentsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]SegmentBrief
}

func ParseGetSegmentsResponse

func ParseGetSegmentsResponse(rsp *http.Response) (*GetSegmentsResponse, error)

ParseGetSegmentsResponse parses an HTTP response from a GetSegmentsWithResponse call

func (GetSegmentsResponse) Status

func (r GetSegmentsResponse) Status() string

Status returns HTTPResponse.Status

func (GetSegmentsResponse) StatusCode

func (r GetSegmentsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSignerChainResponse

type GetSignerChainResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *StandardError
}

func ParseGetSignerChainResponse

func ParseGetSignerChainResponse(rsp *http.Response) (*GetSignerChainResponse, error)

ParseGetSignerChainResponse parses an HTTP response from a GetSignerChainWithResponse call

func (GetSignerChainResponse) Status

func (r GetSignerChainResponse) Status() string

Status returns HTTPResponse.Status

func (GetSignerChainResponse) StatusCode

func (r GetSignerChainResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSignerResponse

type GetSignerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Signer
	JSON400      *StandardError
}

func ParseGetSignerResponse

func ParseGetSignerResponse(rsp *http.Response) (*GetSignerResponse, error)

ParseGetSignerResponse parses an HTTP response from a GetSignerWithResponse call

func (GetSignerResponse) Status

func (r GetSignerResponse) Status() string

Status returns HTTPResponse.Status

func (GetSignerResponse) StatusCode

func (r GetSignerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTopologyResponse

type GetTopologyResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Topology
	JSON400      *StandardError
}

func ParseGetTopologyResponse

func ParseGetTopologyResponse(rsp *http.Response) (*GetTopologyResponse, error)

ParseGetTopologyResponse parses an HTTP response from a GetTopologyWithResponse call

func (GetTopologyResponse) Status

func (r GetTopologyResponse) Status() string

Status returns HTTPResponse.Status

func (GetTopologyResponse) StatusCode

func (r GetTopologyResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTrcBlobResponse

type GetTrcBlobResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *StandardError
}

func ParseGetTrcBlobResponse

func ParseGetTrcBlobResponse(rsp *http.Response) (*GetTrcBlobResponse, error)

ParseGetTrcBlobResponse parses an HTTP response from a GetTrcBlobWithResponse call

func (GetTrcBlobResponse) Status

func (r GetTrcBlobResponse) Status() string

Status returns HTTPResponse.Status

func (GetTrcBlobResponse) StatusCode

func (r GetTrcBlobResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTrcResponse

type GetTrcResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TRC
	JSON400      *StandardError
}

func ParseGetTrcResponse

func ParseGetTrcResponse(rsp *http.Response) (*GetTrcResponse, error)

ParseGetTrcResponse parses an HTTP response from a GetTrcWithResponse call

func (GetTrcResponse) Status

func (r GetTrcResponse) Status() string

Status returns HTTPResponse.Status

func (GetTrcResponse) StatusCode

func (r GetTrcResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTrcsParams

type GetTrcsParams struct {
	Isd *[]int `json:"isd,omitempty"`
	All *bool  `json:"all,omitempty"`
}

GetTrcsParams defines parameters for GetTrcs.

type GetTrcsResponse

type GetTrcsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]TRCBrief
	JSON400      *StandardError
}

func ParseGetTrcsResponse

func ParseGetTrcsResponse(rsp *http.Response) (*GetTrcsResponse, error)

ParseGetTrcsResponse parses an HTTP response from a GetTrcsWithResponse call

func (GetTrcsResponse) Status

func (r GetTrcsResponse) Status() string

Status returns HTTPResponse.Status

func (GetTrcsResponse) StatusCode

func (r GetTrcsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Health

type Health struct {
	// List of health checks.
	Checks []Check `json:"checks"`
	Status Status  `json:"status"`
}

Health defines model for Health.

type HealthResponse

type HealthResponse struct {
	Health Health `json:"health"`
}

HealthResponse defines model for HealthResponse.

type Healther

type Healther interface {
	GetSignerHealth(context.Context) SignerHealthData
	GetTRCHealth(context.Context) TRCHealthData
}

type Hop

type Hop struct {
	Interface int   `json:"interface"`
	IsdAs     IsdAs `json:"isd_as"`
}

Hop defines model for Hop.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type IsdAs

type IsdAs string

IsdAs defines model for IsdAs.

type LogLevel

type LogLevel struct {
	// Logging level
	Level LogLevelLevel `json:"level"`
}

LogLevel defines model for LogLevel.

type LogLevelLevel

type LogLevelLevel string

Logging level

const (
	LogLevelLevelDebug LogLevelLevel = "debug"

	LogLevelLevelError LogLevelLevel = "error"

	LogLevelLevelInfo LogLevelLevel = "info"
)

Defines values for LogLevelLevel.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type Policy

type Policy struct {
	ChainLifetime string `json:"chain_lifetime"`
}

Policy defines model for Policy.

type Problem

type Problem struct {
	// A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Detail *string `json:"detail,omitempty"`

	// A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
	Instance *string `json:"instance,omitempty"`

	// The HTTP status code generated by the origin server for this occurrence of the problem.
	Status int `json:"status"`

	// A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Title string `json:"title"`

	// A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type.
	Type *string `json:"type,omitempty"`
}

Problem defines model for Problem.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type Segment

type Segment struct {
	Expiration  time.Time `json:"expiration"`
	Hops        []Hop     `json:"hops"`
	Id          SegmentID `json:"id"`
	LastUpdated time.Time `json:"last_updated"`
	Timestamp   time.Time `json:"timestamp"`
}

Segment defines model for Segment.

type SegmentBrief

type SegmentBrief struct {
	EndIsdAs IsdAs     `json:"end_isd_as"`
	Id       SegmentID `json:"id"`

	// Length of the segment.
	Length     int   `json:"length"`
	StartIsdAs IsdAs `json:"start_isd_as"`
}

SegmentBrief defines model for SegmentBrief.

type SegmentID

type SegmentID string

SegmentID defines model for SegmentID.

type Server

type Server struct {
	SegmentsServer segapi.Server
	CPPKIServer    cppkiapi.Server
	Beacons        BeaconStore
	CA             renewal.ChainBuilder
	Config         http.HandlerFunc
	Info           http.HandlerFunc
	LogLevel       http.HandlerFunc
	Signer         cstrust.RenewingSigner
	Topology       http.HandlerFunc
	TrustDB        storage.TrustDB
	Healther       Healther
}

Server implements the Control Service API.

func (*Server) GetBeacon

func (s *Server) GetBeacon(w http.ResponseWriter, r *http.Request, segmentId SegmentID)

func (*Server) GetBeaconBlob

func (s *Server) GetBeaconBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID)

func (*Server) GetBeacons

func (s *Server) GetBeacons(w http.ResponseWriter, r *http.Request, params GetBeaconsParams)

GetBeacons gets the stored in the BeaconDB.

func (*Server) GetCa

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

GetCa gets the CA info.

func (*Server) GetCertificate

func (s *Server) GetCertificate(w http.ResponseWriter, r *http.Request, chainID ChainID)

GetCertificate lists the certificate chain for a given ChainID.

func (*Server) GetCertificateBlob

func (s *Server) GetCertificateBlob(w http.ResponseWriter, r *http.Request, chainID ChainID)

GetCertificateBlob gnerates a certificate chain blob response encoded as PEM for a given chainId.

func (*Server) GetCertificates

func (s *Server) GetCertificates(w http.ResponseWriter,
	r *http.Request, params GetCertificatesParams)

GetCertificates lists the certificate chains.

func (*Server) GetConfig

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

GetConfig is an indirection to the http handler.

func (*Server) GetHealth

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

func (*Server) GetInfo

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

GetInfo is an indirection to the http handler.

func (*Server) GetLogLevel

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

GetLogLevel is an indirection to the http handler.

func (*Server) GetSegment

func (s *Server) GetSegment(w http.ResponseWriter, r *http.Request, id SegmentID)

func (*Server) GetSegmentBlob

func (s *Server) GetSegmentBlob(w http.ResponseWriter, r *http.Request, id SegmentID)

func (*Server) GetSegments

func (s *Server) GetSegments(w http.ResponseWriter,
	r *http.Request, params GetSegmentsParams)

GetSegments gets the stored in the PathDB.

func (*Server) GetSigner

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

GetSigner generates the singer response content.

func (*Server) GetSignerChain

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

GetSignerChain generates a certificate chain blob response encoded as PEM.

func (*Server) GetTopology

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

GetTopology is an indirection to the http handler.

func (*Server) GetTrc

func (s *Server) GetTrc(w http.ResponseWriter, r *http.Request, isd int, base int, serial int)

GetTrc gets the trc specified by it's isd base and serial.

func (*Server) GetTrcBlob

func (s *Server) GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int)

GetTrcBlob gets the trc encoded pem blob.

func (*Server) GetTrcs

func (s *Server) GetTrcs(w http.ResponseWriter, r *http.Request, params GetTrcsParams)

GetTrcs gets the trcs specified by it's params.

func (*Server) SetLogLevel

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

SetLogLevel is an indirection to the http handler.

type ServerInterface

type ServerInterface interface {
	// List the SCION beacons
	// (GET /beacons)
	GetBeacons(w http.ResponseWriter, r *http.Request, params GetBeaconsParams)
	// Get the SCION beacon description
	// (GET /beacons/{segment-id})
	GetBeacon(w http.ResponseWriter, r *http.Request, segmentId SegmentID)
	// Get the SCION beacon blob
	// (GET /beacons/{segment-id}/blob)
	GetBeaconBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID)
	// Information about the CA.
	// (GET /ca)
	GetCa(w http.ResponseWriter, r *http.Request)
	// List the certificate chains
	// (GET /certificates)
	GetCertificates(w http.ResponseWriter, r *http.Request, params GetCertificatesParams)
	// Get the certificate chain
	// (GET /certificates/{chain-id})
	GetCertificate(w http.ResponseWriter, r *http.Request, chainId ChainID)
	// Get the certificate chain blob
	// (GET /certificates/{chain-id}/blob)
	GetCertificateBlob(w http.ResponseWriter, r *http.Request, chainId ChainID)
	// Prints the TOML configuration file.
	// (GET /config)
	GetConfig(w http.ResponseWriter, r *http.Request)
	// Indicate the service health.
	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)
	// Basic information page about the control service process.
	// (GET /info)
	GetInfo(w http.ResponseWriter, r *http.Request)
	// Get logging level
	// (GET /log/level)
	GetLogLevel(w http.ResponseWriter, r *http.Request)
	// Set logging level
	// (PUT /log/level)
	SetLogLevel(w http.ResponseWriter, r *http.Request)
	// List the SCION path segments
	// (GET /segments)
	GetSegments(w http.ResponseWriter, r *http.Request, params GetSegmentsParams)
	// Get the SCION path segment description
	// (GET /segments/{segment-id})
	GetSegment(w http.ResponseWriter, r *http.Request, segmentId SegmentID)
	// Get the SCION path segment blob
	// (GET /segments/{segment-id}/blob)
	GetSegmentBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID)
	// Prints information about the AS Certificate used to sign the control-plane message.
	// (GET /signer)
	GetSigner(w http.ResponseWriter, r *http.Request)
	// Get the certificate chain blob
	// (GET /signer/blob)
	GetSignerChain(w http.ResponseWriter, r *http.Request)
	// Prints the contents of the AS topology file.
	// (GET /topology)
	GetTopology(w http.ResponseWriter, r *http.Request)
	// List the TRCs
	// (GET /trcs)
	GetTrcs(w http.ResponseWriter, r *http.Request, params GetTrcsParams)
	// Get the TRC
	// (GET /trcs/isd{isd}-b{base}-s{serial})
	GetTrc(w http.ResponseWriter, r *http.Request, isd int, base int, serial int)
	// Get the TRC blob
	// (GET /trcs/isd{isd}-b{base}-s{serial}/blob)
	GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetBeacon

func (siw *ServerInterfaceWrapper) GetBeacon(w http.ResponseWriter, r *http.Request)

GetBeacon operation middleware

func (*ServerInterfaceWrapper) GetBeaconBlob

func (siw *ServerInterfaceWrapper) GetBeaconBlob(w http.ResponseWriter, r *http.Request)

GetBeaconBlob operation middleware

func (*ServerInterfaceWrapper) GetBeacons

func (siw *ServerInterfaceWrapper) GetBeacons(w http.ResponseWriter, r *http.Request)

GetBeacons operation middleware

func (*ServerInterfaceWrapper) GetCa

GetCa operation middleware

func (*ServerInterfaceWrapper) GetCertificate

func (siw *ServerInterfaceWrapper) GetCertificate(w http.ResponseWriter, r *http.Request)

GetCertificate operation middleware

func (*ServerInterfaceWrapper) GetCertificateBlob

func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r *http.Request)

GetCertificateBlob operation middleware

func (*ServerInterfaceWrapper) GetCertificates

func (siw *ServerInterfaceWrapper) GetCertificates(w http.ResponseWriter, r *http.Request)

GetCertificates operation middleware

func (*ServerInterfaceWrapper) GetConfig

func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig operation middleware

func (*ServerInterfaceWrapper) GetHealth

func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetInfo

GetInfo operation middleware

func (*ServerInterfaceWrapper) GetLogLevel

func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request)

GetLogLevel operation middleware

func (*ServerInterfaceWrapper) GetSegment

func (siw *ServerInterfaceWrapper) GetSegment(w http.ResponseWriter, r *http.Request)

GetSegment operation middleware

func (*ServerInterfaceWrapper) GetSegmentBlob

func (siw *ServerInterfaceWrapper) GetSegmentBlob(w http.ResponseWriter, r *http.Request)

GetSegmentBlob operation middleware

func (*ServerInterfaceWrapper) GetSegments

func (siw *ServerInterfaceWrapper) GetSegments(w http.ResponseWriter, r *http.Request)

GetSegments operation middleware

func (*ServerInterfaceWrapper) GetSigner

func (siw *ServerInterfaceWrapper) GetSigner(w http.ResponseWriter, r *http.Request)

GetSigner operation middleware

func (*ServerInterfaceWrapper) GetSignerChain

func (siw *ServerInterfaceWrapper) GetSignerChain(w http.ResponseWriter, r *http.Request)

GetSignerChain operation middleware

func (*ServerInterfaceWrapper) GetTopology

func (siw *ServerInterfaceWrapper) GetTopology(w http.ResponseWriter, r *http.Request)

GetTopology operation middleware

func (*ServerInterfaceWrapper) GetTrc

GetTrc operation middleware

func (*ServerInterfaceWrapper) GetTrcBlob

func (siw *ServerInterfaceWrapper) GetTrcBlob(w http.ResponseWriter, r *http.Request)

GetTrcBlob operation middleware

func (*ServerInterfaceWrapper) GetTrcs

GetTrcs operation middleware

func (*ServerInterfaceWrapper) SetLogLevel

func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request)

SetLogLevel operation middleware

type SetLogLevelJSONBody

type SetLogLevelJSONBody LogLevel

SetLogLevelJSONBody defines parameters for SetLogLevel.

type SetLogLevelJSONRequestBody

type SetLogLevelJSONRequestBody SetLogLevelJSONBody

SetLogLevelJSONRequestBody defines body for SetLogLevel for application/json ContentType.

type SetLogLevelResponse

type SetLogLevelResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *LogLevel
	JSON400      *StandardError
}

func ParseSetLogLevelResponse

func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error)

ParseSetLogLevelResponse parses an HTTP response from a SetLogLevelWithResponse call

func (SetLogLevelResponse) Status

func (r SetLogLevelResponse) Status() string

Status returns HTTPResponse.Status

func (SetLogLevelResponse) StatusCode

func (r SetLogLevelResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Signer

type Signer struct {
	AsCertificate Certificate `json:"as_certificate"`

	// Signer expiration imposed by chain and TRC validity.
	Expiration time.Time `json:"expiration"`
	TrcId      TRCID     `json:"trc_id"`

	// TRC used as trust root is in grace period, and the latest TRC cannot
	// be used as trust root.
	TrcInGracePeriod bool `json:"trc_in_grace_period"`
}

Signer defines model for Signer.

type SignerHealthData

type SignerHealthData struct {
	SignerMissing       bool
	SignerMissingDetail string
	Expiration          time.Time
	InGrace             bool
}

SignerHealthData is used to extract the relevant signer data for the signer health check.

type StandardError

type StandardError struct {
	// Error message
	Error string `json:"error"`
}

StandardError defines model for StandardError.

type Status

type Status string

Status defines model for Status.

const (
	StatusDegraded Status = "degraded"

	StatusFailing Status = "failing"

	StatusPassing Status = "passing"
)

Defines values for Status.

type Subject

type Subject struct {
	IsdAs IsdAs `json:"isd_as"`
}

Subject defines model for Subject.

type SubjectKeyID

type SubjectKeyID string

SubjectKeyID defines model for SubjectKeyID.

type TRC

type TRC struct {
	AuthoritativeAses []IsdAs  `json:"authoritative_ases"`
	CoreAses          []IsdAs  `json:"core_ases"`
	Description       string   `json:"description"`
	Id                TRCID    `json:"id"`
	Validity          Validity `json:"validity"`
}

TRC defines model for TRC.

type TRCBrief

type TRCBrief struct {
	Id TRCID `json:"id"`
}

TRCBrief defines model for TRCBrief.

type TRCHealthData

type TRCHealthData struct {
	TRCNotFound       bool
	TRCNotFoundDetail string
	TRCID             cppki.TRCID
}

TRCHealthData is used to extract the relevant TRC data for the TRC health check.

type TRCID

type TRCID struct {
	BaseNumber   int `json:"base_number"`
	Isd          int `json:"isd"`
	SerialNumber int `json:"serial_number"`
}

TRCID defines model for TRCID.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Topology

type Topology struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

Topology defines model for Topology.

func (Topology) Get

func (a Topology) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Topology. Returns the specified element and whether it was found

func (Topology) MarshalJSON

func (a Topology) MarshalJSON() ([]byte, error)

Override default JSON handling for Topology to handle AdditionalProperties

func (*Topology) Set

func (a *Topology) Set(fieldName string, value interface{})

Setter for additional properties for Topology

func (*Topology) UnmarshalJSON

func (a *Topology) UnmarshalJSON(b []byte) error

Override default JSON handling for Topology to handle AdditionalProperties

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type Validity

type Validity struct {
	NotAfter  time.Time `json:"not_after"`
	NotBefore time.Time `json:"not_before"`
}

Validity defines model for Validity.

Directories

Path Synopsis
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.

Jump to

Keyboard shortcuts

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