2022-08-12 10:48:16 +00:00
|
|
|
package plugintypes
|
|
|
|
|
|
|
|
import (
|
2023-01-22 20:26:21 +00:00
|
|
|
"io"
|
2022-08-12 10:48:16 +00:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2023-01-22 20:26:21 +00:00
|
|
|
// SetApp is used to allow GoBlog set its app instance to be accessible by the plugin.
|
2022-08-12 10:48:16 +00:00
|
|
|
type SetApp interface {
|
2023-01-22 20:26:21 +00:00
|
|
|
SetApp(app App)
|
2022-08-12 10:48:16 +00:00
|
|
|
}
|
|
|
|
|
2023-01-22 20:26:21 +00:00
|
|
|
// SetConfig is used in all plugin types to allow GoBlog set the plugin configuration.
|
2022-08-12 10:48:16 +00:00
|
|
|
type SetConfig interface {
|
2023-01-22 20:26:21 +00:00
|
|
|
SetConfig(config map[string]any)
|
2022-08-12 10:48:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Exec interface {
|
|
|
|
Exec()
|
|
|
|
}
|
|
|
|
|
|
|
|
type Middleware interface {
|
2023-01-22 20:26:21 +00:00
|
|
|
Handler(next http.Handler) http.Handler
|
2022-08-12 10:48:16 +00:00
|
|
|
Prio() int
|
|
|
|
}
|
|
|
|
|
|
|
|
type UI interface {
|
2023-01-22 20:26:21 +00:00
|
|
|
Render(renderContext RenderContext, rendered io.Reader, modified io.Writer)
|
2022-08-12 10:48:16 +00:00
|
|
|
}
|