sdk

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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