Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks holds a list of parameter-less functions to call whenever the set is triggered with Fire().
Example ¶
package main import ( "fmt" "github.com/donutloop/toolkit/event" ) func main() { hooks := new(event.Hooks) hooks.Add(func() { fmt.Println("kernel request") }) errs := hooks.Fire() if len(errs) > 0 { for _, err := range errs { fmt.Printf("error: %v \n", err) } } }
Output: kernel request
type RecoverError ¶
type RecoverError struct { Err interface{} Stack []byte }
func (*RecoverError) Error ¶
func (e *RecoverError) Error() string
Click to show internal directories.
Click to hide internal directories.