diff options
author | Simon Ser <contact@emersion.fr> | 2020-05-13 14:07:44 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-13 14:07:44 +0200 |
commit | b891a95fcf4a3d4b64100911dae49fb28904a7fd (patch) | |
tree | fe07b29d6f2443047b7f740c79d86b3c499cc9e9 /docs/example-go-plugin | |
parent | 4cf5ad68afd80f27512c464843b0d917182ef0c2 (diff) | |
download | alps-b891a95fcf4a3d4b64100911dae49fb28904a7fd.tar.gz alps-b891a95fcf4a3d4b64100911dae49fb28904a7fd.zip |
Rename project to alps
Diffstat (limited to 'docs/example-go-plugin')
-rw-r--r-- | docs/example-go-plugin/plugin.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/example-go-plugin/plugin.go b/docs/example-go-plugin/plugin.go index 791f5a6..7cf2eb9 100644 --- a/docs/example-go-plugin/plugin.go +++ b/docs/example-go-plugin/plugin.go @@ -1,22 +1,22 @@ -// Package exampleplugin is an example Go plugin for koushin. +// Package exampleplugin is an example Go plugin for alps. // -// To enable it, import this package from cmd/koushin/main.go. +// To enable it, import this package from cmd/alps/main.go. package exampleplugin import ( "fmt" "net/http" - "git.sr.ht/~emersion/koushin" - koushinbase "git.sr.ht/~emersion/koushin/plugins/base" + "git.sr.ht/~emersion/alps" + alpsbase "git.sr.ht/~emersion/alps/plugins/base" ) func init() { - p := koushin.GoPlugin{Name: "example"} + p := alps.GoPlugin{Name: "example"} // Setup a function called when the mailbox view is rendered - p.Inject("mailbox.html", func(ctx *koushin.Context, kdata koushin.RenderData) error { - data := kdata.(*koushinbase.MailboxRenderData) + p.Inject("mailbox.html", func(ctx *alps.Context, kdata alps.RenderData) error { + data := kdata.(*alpsbase.MailboxRenderData) fmt.Println("The mailbox view for " + data.Mailbox.Name + " is being rendered") // Set extra data that can be accessed from the mailbox.html template data.Extra["Example"] = "Hi from Go" @@ -24,7 +24,7 @@ func init() { }) // Wire up a new route - p.GET("/example", func(ctx *koushin.Context) error { + p.GET("/example", func(ctx *alps.Context) error { return ctx.String(http.StatusOK, "This is an example page.") }) @@ -35,5 +35,5 @@ func init() { }, }) - koushin.RegisterPluginLoader(p.Loader()) + alps.RegisterPluginLoader(p.Loader()) } |