1
mirror of https://github.com/jlelse/GoBlog synced 2024-07-08 05:22:58 +00:00
GoBlog/pkgs/plugintypes/goblog.go

34 lines
765 B
Go
Raw Normal View History

package plugintypes
import (
"context"
"database/sql"
)
// App is used to access GoBlog's app instance.
type App interface {
GetDatabase() Database
2023-01-22 20:26:21 +00:00
GetPost(path string) (Post, error)
}
// Database is used to provide access to GoBlog's database.
type Database interface {
Exec(string, ...any) (sql.Result, error)
ExecContext(context.Context, string, ...any) (sql.Result, error)
Query(string, ...any) (*sql.Rows, error)
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
QueryRow(string, ...any) (*sql.Row, error)
QueryRowContext(context.Context, string, ...any) (*sql.Row, error)
}
// Post
type Post interface {
GetParameters() map[string][]string
}
2023-01-22 20:26:21 +00:00
// RenderContext
type RenderContext interface {
GetPath() string
2022-10-31 09:52:35 +00:00
GetBlog() string
}