package
module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Sep 12, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package pluginlogger is a demo logger plugin.
New プラグイン本体を作成する関数
CreateConfig() と同じく、Yaegiから直接呼び出されるので必須
また、関数シグネチャは`New(context.Context, http.Handler, *Config, string) (http.Handler, error)` である必要がある
type Config struct {
Prefix string `json:"prefix,omitempty"`
LogLevel string `json:"loglevel,omitempty"`
}
Config プラグインの設定が入った構造体
yaegiから設定情報が注入されるので、全フィールドをPublicにする
CreateConfig 設定を作成する関数
yaegiから呼び出されるため、必須
Logger プラグインの本体。必要な依存性を内部に保持する
http.Handler を実装する
Source Files
¶
Click to show internal directories.
Click to hide internal directories.