runtime

package
v0.3.28 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeKey

type AttributeKey string
const (
	// HTTP request attributes.
	RequestMethodAttr    AttributeKey = "request.method"
	RequestPathAttr      AttributeKey = "request.path"
	RequestHostAttr      AttributeKey = "request.host"
	RequestSchemeAttr    AttributeKey = "request.scheme"
	RequestProtocolAttr  AttributeKey = "request.protocol"
	RequestSizeAttr      AttributeKey = "request.size"
	RequestTotalSizeAttr AttributeKey = "request.total_size"

	// HTTP response attributes.
	ResponseCodeAttr        AttributeKey = "response.code"
	ResponseCodeDetailsAttr AttributeKey = "response.code_details"
	ResponseSizeAttr        AttributeKey = "response.size"
	ResponseTotalSizeAttr   AttributeKey = "response.total_size"

	// Downstream connection attributes.
	SourceAddressAttr             AttributeKey = "source.address"
	SourcePortAttr                AttributeKey = "source.port"
	DestinationAddressAttr        AttributeKey = "destination.address"
	DestinationPortAttr           AttributeKey = "destination.port"
	ConnectionIDAttr              AttributeKey = "connection.id"
	ConnectionMTLSAttr            AttributeKey = "connection.mtls"
	ConnectionServerNameAttr      AttributeKey = "connection.requested_server_name"
	ConnectionTLSVersionAttr      AttributeKey = "connection.tls_version"
	ConnectionSubjLocalCertAttr   AttributeKey = "connection.subject_local_certificate"
	ConnectionSubjPeerCertAttr    AttributeKey = "connection.subject_peer_certificate"
	ConnectionDNSSanLocalCertAttr AttributeKey = "connection.dns_san_local_certificate"
	ConnectionDNSSanPeerCertAttr  AttributeKey = "connection.dns_san_peer_certificate"

	// Upstream connection attributes.
	UpstreamAddressAttr         AttributeKey = "upstream.address"
	UpstreamPortAttr            AttributeKey = "upstream.port"
	UpstreamTLSVersionAttr      AttributeKey = "upstream.tls_version"
	UpstreamSubjLocalCertAttr   AttributeKey = "upstream.subject_local_certificate"
	UpstreamSubjPeerCertAttr    AttributeKey = "upstream.subject_peer_certificate"
	UpstreamDNSSanLocalCertAttr AttributeKey = "upstream.dns_san_local_certificate"
	UpstreamDNSSanPeerCertAttr  AttributeKey = "upstream.dns_san_peer_certificate"
	UpstreamLocalAddressAttr    AttributeKey = "upstream.local_address"

	// Metadata keys.
	ApoxyMetadataNamespace    = "apoxy.io"
	ApoxyMetadataFunction     = "func"
	ApoxyMetadataFunctionName = "name"
	ApoxyMetadataFunctionPath = "path"
)

func (AttributeKey) String

func (k AttributeKey) String() string

type ExecState

type ExecState interface {
	// Next advances the state machine to the next state.
	// If the state machine has reached the end state, Next returns nil.
	Next(context.Context, svcext_procv3.ExternalProcessor_ProcessServer) (next ExecState, err error)
}

ExecState defines the interface for a single state in the plugin execution.

func StartExec

func StartExec(
	ctx context.Context,
	m extism.Manifest,
) (ExecState, error)

StartExec creates a new runtime and returns the initial ExecState.

type PsuedoHeaderKey

type PsuedoHeaderKey string
const (
	RequestPath   PsuedoHeaderKey = ":path"
	RequestHost   PsuedoHeaderKey = ":authority"
	RequestScheme PsuedoHeaderKey = ":scheme"
	RequestMethod PsuedoHeaderKey = ":method"

	ResponseStatus PsuedoHeaderKey = ":status"
)

type RequestBodyState

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

RequestBodyState processes the request body.

func (*RequestBodyState) Next

Next implements the ExecState interface.

type RequestSendState

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

RequestSendState processes request send operation.

func (*RequestSendState) Next

Next will send the result of the Send operation to the plugin and wait for the next action.

type ResponseBodyState

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

ResponseBodyState requests the response body from the Proxy, passes it the plugin, and awaits one of the following: - a response to be sent upstream - an immediate response to be sent downstream (with no further processing) - runtime exit

func (*ResponseBodyState) Next

Next implements the ExecState interface.

type ResponseSendState

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

ResponseSendState sends the response to the Proxy (either a header or body response depending on the phase) and concludes the execution.

func (*ResponseSendState) Next

Next implements the ExecState interface.

type SendDownstreamState

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

SendDownstreamState processes the end of the request.

func (*SendDownstreamState) Next

type StartState

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

StartState is the initial state of the runtime.

func (*StartState) Next

Next starts the plugin and awaits either Send or request for the body callbacks. Returns RequestSendState for former and RequestBodyState for latter as the next state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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