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:
Travis Reeder
2017-12-06 10:12:55 -08:00
committed by GitHub
parent 3096900d52
commit 6b8627d1c5
6 changed files with 52 additions and 22 deletions

View File

@@ -5,7 +5,8 @@
If you are a developer using Fn through the API, this section is for you.
### Getting Started
* [Quickstart](https://github.com/fnproject/fn)
* [Quickstart](https://github.com/fnproject/fn#quickstart)
* [API Reference](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/fnproject/fn/master/docs/swagger.yml)
* [FAQ](faq.md)
* [Object Model](developers/model.md)
@@ -17,17 +18,25 @@ If you are a developer using Fn through the API, this section is for you.
* [Writing functions](writing.md)
### Advanced
* [Open Function Format](function-format.md)
* [Packaging functions](packaging.md)
* [CLI Source](https://github.com/fnproject/cli/)
* [Async functions](async.md)
* [Organizing functions into an application](developers/apps.md)
### Learn More
* [Examples](../examples)
* [Getting Started Series](../examples/tutorial)
* [Tutorials](https://github.com/fnproject/tutorials)
## For Operators
If you are operating Fn, this section is for you.
### Getting Started
* [Running in Production](operating/production.md)
* [Logging](operating/logging.md)
* [Message Queues](operating/mqs/README.md)
@@ -37,18 +46,15 @@ If you are operating Fn, this section is for you.
* [User Interface](operating/ui.md)
### Advanced
* [Extending Fn](operating/extending.md)
* [Running Fn on Kubernetes](operating/kubernetes/README.md)
* [Setting up development environment with Docker compose](./operating/compose.md)
* [OpenStack Triggers](operating/triggers.md)
* [Docker Configuration](operating/docker.md)
## For Contributors
If you are working on the Fn Project, want to work on it or are creating extensions, this section is for you.
## Learn More
* [Examples](../examples)
* [Getting Started Series](../examples/tutorial)
* [Tutorials](https://github.com/fnproject/tutorials)
* [Writing Extensions](contributors/extensions.md)

View File

@@ -1,3 +0,0 @@
# Docs for Contributors
* [Writing Extensions](extending.md)

View File

@@ -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.