sdk

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closer

type Closer interface {
	Close() error
}

type Context

type Context interface {
	Request() *http.Request
	Response() *http.Response
	SetRequest(req *http.Request)
	SetResponse(resp *http.Response)
}

Context is the gateway's per-request context passed to plugins. It provides access to the current request and the aggregated response.

type Middleware

type Middleware interface {
	Name() string
	Init(cfg map[string]interface{}) error
	Handler(next http.Handler) http.Handler
}

Middleware wraps an HTTP handler and executes within the request lifecycle. Middlewares are applied per-flow in the order they are defined.

type Plugin

type Plugin interface {
	Info() PluginInfo
	Init(cfg map[string]interface{}) error
	Type() PluginType
	Execute(ctx Context) error
}

Plugin is the interface that all Aastro plugins must implement. Plugins are loaded as Go shared objects (.so) and must be compiled with the exact same Go version as the gateway binary.

type PluginInfo

type PluginInfo struct {
	Name        string
	Description string
	Version     string
	Author      string
}

PluginInfo contains metadata about a plugin.

type PluginType

type PluginType int

PluginType defines when a plugin executes in the request lifecycle.

const (
	// PluginTypeRequest runs before upstream dispatch. Can modify request context.
	PluginTypeRequest PluginType = iota
	// PluginTypeResponse runs after aggregation. Can modify response headers and body.
	PluginTypeResponse PluginType = iota
)

func (PluginType) String

func (pt PluginType) String() string

Jump to

Keyboard shortcuts

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