Skip to content
This repository was archived by the owner on Jul 14, 2019. It is now read-only.

google/go-circuits

An Event driven Component framework for Golang based on Circuits
(http://github.com/circuits/circuits).

DISCLAIMER: This is not an official Google product.

Basic Usage

import (
    "fmt"
    "go-circuits"
)

type MyComponent struct {
    go-circuits.Component
}

func (mc *MyComponent) HelloWorldEventHandler(_ go-circuits.Event) {
    fmt.Println("Hello World!")
}

func NewMyComponent() *MyComponent {
    mc := MyComponent{}
    mc.RegisterEventHandler(go-circuits.NewEventHandler(
            "hello_world",
            mc.HelloWorldEventHandler
    ))
    return &mc
}

func main() {
    mc := NewMyComponent()
    mc.Fire(go-circuits.BaseEvent{"hello_world"})
    mc.Run()
}

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages