Awesome Go

go-events

CategoryUtilities
SubcategoryUtilities
Stars0

A go event and event'subscribe package, like wordpress hook functions

About go-events

go-events

Desc

  • go-events is a go event and event'subscribe pkg, like wordpress hook functions.

中文 | English

Download

go get -u github.com/deatil/go-events

Get Starting

package main

import (
    "fmt"
    "github.com/deatil/go-events/events"
)

func main() {
    // use action
    events.AddAction("test1", func() {
        fmt.Println("test1")
    }, events.DefaultSort)

    events.DoAction("test1")

    // use Filter
    events.AddFilter("test1", func(val string) string {
        return "run test1 => " + val
    }, events.DefaultSort)

    data1 := "init1"
    test := events.ApplyFilters("test1", data1)

    fmt.Println(test)
    // output: run test1 => init1
}

LICENSE

  • The library LICENSE is Apache2, using the library need keep the LICENSE.

Copyright

Frequently Asked Questions

What is go-events?

go-events is a Utilities library for the Go programming language. A go event and event'subscribe package, like wordpress hook functions

How do I install go-events?

Install go-events with the Go module system using `go get deatil/go-events`. Check the repository for the current installation instructions.

What category does go-events belong to?

go-events is listed under Utilities, specifically Utilities.

← Back to Utilities