devkit

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger added in v0.2.0

func NewLogger(handler func(level LogLevel, log string, args ...interface{})) domain.Logger

Types

type LogLevel added in v0.2.0

type LogLevel string
const (
	LogLevelDPanic LogLevel = "dpanic"
	LogLevelPanic  LogLevel = "panic"
	LogLevelDebug  LogLevel = "debug"
	LogLevelInfo   LogLevel = "info"
	LogLevelWarn   LogLevel = "warn"
	LogLevelError  LogLevel = "error"
	LogLevelFatal  LogLevel = "fatal"
)

type Plugin

type Plugin struct {
	LogHandler    app.HandleLog
	RouterHandler app.SetupRouter
	LoggerHandler app.AppendLogger
	Hooks         PluginHooks
	// contains filtered or unexported fields
}

func NewLogPlugin

func NewLogPlugin(
	name string,
	logHandler app.HandleLog,
	hooks PluginHooks,
) *Plugin

func NewLoggerPlugin

func NewLoggerPlugin(
	name string,
	appendLogger app.AppendLogger,
	hooks PluginHooks,
) *Plugin

func NewPlugin

func NewPlugin(
	name string,
	handlers PluginHandlers,
	hooks PluginHooks,
) *Plugin

func NewRouterPlugin

func NewRouterPlugin(
	name string,
	routerHandler app.SetupRouter,
	hooks PluginHooks,
) *Plugin

func (Plugin) AppendLogger

func (p Plugin) AppendLogger(context *app.Context) domain.Logger

func (Plugin) HandleLog

func (p Plugin) HandleLog(log domain.Log)

func (Plugin) Name

func (p Plugin) Name() string

func (Plugin) OnAfterClose added in v0.2.1

func (p Plugin) OnAfterClose(context *app.Context)

func (Plugin) OnAfterServe added in v0.2.1

func (p Plugin) OnAfterServe(context *app.Context)

func (Plugin) OnDeInit added in v0.2.1

func (p Plugin) OnDeInit(context *app.Context)

func (Plugin) OnInit added in v0.2.1

func (p Plugin) OnInit(context *app.Context)

func (Plugin) SetupRouter

func (p Plugin) SetupRouter(router fiber.Router, context *app.Context)

type PluginHandlers added in v0.2.1

type PluginHandlers struct {
	LogHandler    app.HandleLog
	RouterHandler app.SetupRouter
	LoggerHandler app.AppendLogger
}

type PluginHooks added in v0.2.1

type PluginHooks struct {
	OnInit       func(context *app.Context)
	OnAfterServe func(context *app.Context)
	OnAfterClose func(context *app.Context)
	OnDeInit     func(context *app.Context)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL