mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fixes to recent extension changes. (#568)
* Fixes to recent extension changes. * Fixes issue where gin will continue calling the handler even if next() isn't called. * Updated docs.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
# Docs for Contributors
|
||||
|
||||
* [Writing Extensions](extending.md)
|
||||
@@ -20,17 +20,19 @@ to be called during setup:
|
||||
```go
|
||||
func init() {
|
||||
server.RegisterExtension(&fnext.Extension{
|
||||
Name: "logspam",
|
||||
Name: "github.com/treeder/fn-ext-example/logspam", // Should be the import name
|
||||
Setup: setup, // Fn will call this during startup
|
||||
})
|
||||
}
|
||||
|
||||
func setup(s *fnext.ExtServer) error {
|
||||
// Add all the hooks you extension needs here
|
||||
// Add all the hooks your extension needs here
|
||||
s.AddCallListener(&LogSpam{})
|
||||
}
|
||||
```
|
||||
|
||||
See https://github.com/treeder/fn-ext-example for full example.
|
||||
|
||||
## Listeners
|
||||
|
||||
Listeners are the main way to extend Fn.
|
||||
|
||||
Reference in New Issue
Block a user