Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
reujab edited this page Jul 20, 2017 · 1 revision

plugin

This module allows writing custom modules in Go using shared objects.

Writing a plugin

Assuming you already know Go, writing a plugin is not difficult.

UNIX timestamp example

Source code

package main

import (
	"strconv"
	"time"

	. "github.com/reujab/bronze/types"
)

func Main(segment *Segment, args []string) {
	segment.Value = strconv.FormatInt(time.Now().Unix(), 10)
}

Compiling

go build -buildmode plugin

Using the plugin

BRONZE+=(plugin:black:white:plugin.so)
Clone this wiki locally