> For the complete documentation index, see [llms.txt](https://irine-sistiana.gitbook.io/mosdns-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://irine-sistiana.gitbook.io/mosdns-wiki/mosdns-v4/ru-he-bian-xie-xin-cha-jian.md).

# 如何编写新插件

1\. 实现插件

* 可执行插件: 实现 `coremain/ExecutablePlugin` 接口。
* 匹配器插件: 实现 `coremain/MatcherPlugin` 接口。

2\. 注册插件

可参考实现了 `ExecutablePlugin` 接口的 `sleep` 插件。在 `plugin/executable/sleep/sleep.go`。内有详细注释。

3\. 启用插件

在 `plugin/enabled_plugin.go` 启用插件。
