Documentation
¶
Index ¶
- Variables
- func AddEntToContext[T any](f func(context.Context, T) context.Context, db T) echo.MiddlewareFunc
- func New(opts ...Option) (*echo.Echo, error)
- type Auth
- type Option
- func Assets(path string, fs fs.FS, browse bool) Option
- func GraphQL(path string, websockets bool, input *handler.Server, ...) Option
- func Path(method string, path string, handler echo.HandlerFunc, ...) Option
- func Playground(path, graph string, middleware ...echo.MiddlewareFunc) Option
- func Quiet() Option
- func Renderer(r echo.Renderer) Option
- func SPA(path string, files fs.FS) Option
- func SetLogger(logger *slog.Logger) Option
- func SetSecrets(secrets ...string) Option
- func ShowBanner() Option
- func SinglePageApplication(path string, fs fs.FS) Option
- func Timeout(duration time.Duration) Option
- func WithMiddleware(middleware ...echo.MiddlewareFunc) Option
- func WithRateLimit(limit rate.Limit) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyPath = errors.New("empty path") ErrEmptyRenderer = errors.New("renderer is empty") ErrInvalidDuration = errors.New("invalid duration") ErrInvalidHTTPMethod = errors.New("invalid http method") ErrInvalidLogger = errors.New("invalid logger") ErrMissingRoutes = errors.New("missing route") )
Errors
Functions ¶
func AddEntToContext ¶
AddEntToContext is used to add an ent.Client to an echo.Context. You would use this middlware with reverb.GraphQL. Usage: reverb.AddEntToContext(ent.NewContext, client)
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is a functional optional pattern
func GraphQL ¶
func GraphQL(path string, websockets bool, input *handler.Server, middleware ...echo.MiddlewareFunc) Option
GraphQL
func Path ¶
func Path(method string, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) Option
Path
func Playground ¶
Playground adds the GraphQL Playground. This is usually for debugging.
func SinglePageApplication ¶
SinglePageApplication is used to server a Single Page Application from an embed.FS
func WithMiddleware ¶
func WithMiddleware(middleware ...echo.MiddlewareFunc) Option
WithMiddleware adds a middleware to the base
func WithRateLimit ¶
WithRateLimit adds a rate limit middleware to the base
Click to show internal directories.
Click to hide internal directories.