disstate

module
v3.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2021 License: MIT

README

disstate

PkgGoDev

Disstate is an alternative state, with a more advanced event system. The API is the same as the one of arikawa's State, only adding handlers works differently.

Event System

There are four major changes to the event system of arikawa:

  1. Handlers take a *state.State as first argument.
  2. There is support for middlewares both on a global, and a per-handler level
  3. All events have new types, that contain a Base which is a key-value store, that allows you to pass information from your middleware to the handler.
  4. Integrated error and panic handling. Handlers and middlewares can optionally have an error return type. If a handler or middleware returns an error, it will be given to the event system's error handler. If a middleware returns an error, all other middlewares and the handler won't be called. Similarly, if a middleware or handler panics, the panic will be recovered and handled by the panic handler.

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL