gochan

Constants

Modules

The following are modules that can be loaded via require("modulename"). See ./examples/plugins/ for usage examples.

External modules

events

gclog

gcsql

gctemplates

geoip

Key Type Explanation
init func(options map[string]any) error The function to initialize the GeoIP handler with options. If it needs no initialization, the function can return null
get_country func(request http.Request, board string, errEv zerolog.Event) geoip.Country, error The function to get the requesting IP’s country, returning it and any errors that occured
close func() error The function to close any network or file handles, if any were opened, returning an error if any occured

manage

Key Type Explanation
board string|int|nil The board directory or ID that the IP will be banned from. If this is nil or omitted, it will be a global ban
post int The post ID
is_thread_ban bool If true, the user will be able to post but unable to create threads
appeal_after string User can appeal after this duration. If unset, the user can appeal immediately.
appealable bool Sets whether or not the user can appeal the ban. If unset, the user is able to appeal.
staff_note string A private note attached to the ban that only staff can see

serverutil

uploads

url

Events

This is a list of events that gochan may trigger at some point and can be used in the plugin system.