Documentation ¶
Index ¶
- Variables
- func Configure(config Config)
- func EchoMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func GinMiddleware(c *gin.Context)
- func Middleware(next http.Handler) http.Handler
- func MiddlewareController(r *http.Request) *controller
- func New(config Config) *speakeasy
- func NewCaptureWriter(origResW http.ResponseWriter, maxBuffer int) *captureWriter
- type Config
Constants ¶
This section is empty.
Variables ¶
var ErrAPIKeyMissing = errors.New("API key is required")
ErrAPIKeyMissing is returned when the API Key is not provided at configuration time.
Functions ¶
func Configure ¶
func Configure(config Config)
Configure allows you to configure the default instance of the Speakeasy SDK. Use this if you will use the same API Key for all connected APIs.
func EchoMiddleware ¶ added in v0.0.3
func EchoMiddleware(next echo.HandlerFunc) echo.HandlerFunc
EchoMiddleware setups up the default SDK instance to start capturing requests from the echo http framework.
func GinMiddleware ¶ added in v0.0.3
GinMiddleware setups up the default SDK instance to start capturing requests from the gin http framework.
func Middleware ¶ added in v0.0.1
Middleware setups up the default SDK instance to start capturing requests from routers that support http.Handlers. Currently only gorilla/mux, go-chi/chi routers and the http.DefaultServerMux are supported for automatically capturing path hints. Otherwise path hints can be supplied by a handler through the speakeasy MiddlewareController.
func MiddlewareController ¶ added in v0.0.3
MiddlewareController will return the speakeasy middleware controller from the current request, if the current request is monitored by the speakeasy middleware.
func New ¶ added in v0.0.1
func New(config Config) *speakeasy
New creates a new instance of the Speakeasy SDK. This allows you to create multiple instances of the SDK for specifying different API Keys for different APIs.
func NewCaptureWriter ¶ added in v0.0.3
func NewCaptureWriter(origResW http.ResponseWriter, maxBuffer int) *captureWriter