1. Set up your Go environment

Go extensions are run using https://github.com/traefik/yaegi, a Go interpreter. There is a limited number of packages you can import—third-party or from the standard library.

<aside> ⚠️ Std lib packages related to file I/O, networking, etc. are disabled for security reasons. You should avoid using Generics, these are not supported by the interpreter.

</aside>

a. Install the SDK

Make sure to get the right version of the SDK or else your extension won’t be compatible with the latest version of Seanime.

<aside> ➡️ Seanime v2.1+ → Hibike v0.5.1

</aside>

go get github.com/5rahim/[email protected]

b. Install zerolog

ZeroLog is the logging package used by Seanime. A pointer to the global logger will be passed to your constructor method.

Generally, you should limit the use of logging to only errors and important information. Avoid using fmt or log for logging to stdout as they will not be consistent with the rest of the logs in Seanime. Start your log messages with the name of the extension to make it easier to identify where the log came from. (e.g. my ext: blablabla...)

go get github.com/rs/[email protected]

c. Choose from these packages

The following packages are available for you to install, depending on your use case.