event
v1.1.1
djinn-ci.com/event
Documentation
pkg.go.dev ↗Variables
Types (3 declarations)
var (
Types = []Type{
BuildSubmitted,
BuildStarted,
BuildFinished,
BuildTagged,
InviteSent,
InviteAccepted,
Namespaces,
Cron,
Images,
Objects,
Variables,
SSHKeys,
}
ErrUnknown = errors.New("unknown event")
ErrNilDispatcher = errors.New("nil dispatcher")
)
Types
Dispatcher
type Dispatcher interface {
Dispatch(ev *Event) error
}
MultiDispatcher
func MultiDispatcher(dispatchers ...Dispatcher) Dispatcher
Event
type Event struct {
ID uuid.UUID
NamespaceID sql.NullInt64
Type Type
Data map[string]interface{}
CreatedAt time.Time
}
New
func New(namespaceId sql.NullInt64, typ Type, data map[string]interface{}) *Event
Type
type Type uint
BuildSubmitted (13 declarations)
const ( BuildSubmitted Type = 1 << iota // build.submitted BuildStarted // build.started BuildFinished // build.finished BuildTagged // build.tagged InviteSent // invite.sent InviteAccepted // invite.accepted InviteRejected // invite.rejected Namespaces // namespaces Cron // cron Images // images Objects // objects Variables // variables SSHKeys // ssh_keys )
Lookup
func Lookup(name string) (Type, bool)
UnmarshalType
func UnmarshalType(names ...string) (Type, error)
Type.Has
func (t Type) Has(mask Type) bool
Type.Scan
func (t *Type) Scan(v interface{}) error
Type.String
func (i Type) String() string
Type.Value
func (t Type) Value() (driver.Value, error)