Moved server packages to a separate folder
This commit is contained in:
24
server/middleware/OpenGraph.go
Normal file
24
server/middleware/OpenGraph.go
Normal file
@ -0,0 +1,24 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
)
|
||||
|
||||
// OpenGraphContext is a context with open graph data.
|
||||
type OpenGraphContext struct {
|
||||
aero.Context
|
||||
*arn.OpenGraph
|
||||
}
|
||||
|
||||
// OpenGraph middleware modifies the context to be an OpenGraphContext.
|
||||
func OpenGraph(next aero.Handler) aero.Handler {
|
||||
return func(ctx aero.Context) error {
|
||||
openGraphCtx := &OpenGraphContext{
|
||||
Context: ctx,
|
||||
OpenGraph: nil,
|
||||
}
|
||||
|
||||
return next(openGraphCtx)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user