Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvFeature ¶ added in v1.0.0
type Environment ¶
type EnvironmentCreated ¶ added in v1.0.0
type EnvironmentCreated struct {
Name string `json:"name"`
}
func (*EnvironmentCreated) Notify ¶ added in v1.0.0
func (*EnvironmentCreated) Notify(*State, notifier.Notifier)
func (*EnvironmentCreated) PrePersist ¶ added in v1.0.0
func (e *EnvironmentCreated) PrePersist(*State) (Event, error)
type EnvironmentsOrdered ¶ added in v1.0.0
type EnvironmentsOrdered struct {
Order []string `json:"order"`
}
func (*EnvironmentsOrdered) Notify ¶ added in v1.0.0
func (*EnvironmentsOrdered) Notify(*State, notifier.Notifier)
func (*EnvironmentsOrdered) PrePersist ¶ added in v1.0.0
func (e *EnvironmentsOrdered) PrePersist(*State) (Event, error)
type Event ¶ added in v1.0.0
type Event interface {
// Validate validates the event data against given (immutable) state.
Validate(*State) (error, error)
// PrePersist can return a modified event just before persisting.
PrePersist(*State) (Event, error)
// Update returns the new state with the event's effect applied.
Update(*State, time.Time) *State
// Notify can call a notifier about the event.
Notify(*State, notifier.Notifier)
}
func EventForType ¶ added in v1.0.0
type FeatureCreated ¶ added in v1.0.0
type FeatureCreated struct {
Name string `json:"name"`
}
func (*FeatureCreated) Notify ¶ added in v1.0.0
func (*FeatureCreated) Notify(*State, notifier.Notifier)
func (*FeatureCreated) PrePersist ¶ added in v1.0.0
func (e *FeatureCreated) PrePersist(*State) (Event, error)
type FeatureDeleted ¶ added in v1.0.0
type FeatureDeleted struct {
Name string `json:"name"`
}
func (*FeatureDeleted) Notify ¶ added in v1.0.0
func (*FeatureDeleted) Notify(*State, notifier.Notifier)
func (*FeatureDeleted) PrePersist ¶ added in v1.0.0
func (e *FeatureDeleted) PrePersist(*State) (Event, error)
type FeatureToggled ¶ added in v1.0.0
type FeatureToggled struct {
Feature string `json:"feature"`
Environment string `json:"environment"`
Status bool `json:"status"`
}
func (*FeatureToggled) Notify ¶ added in v1.0.0
func (e *FeatureToggled) Notify(s *State, n notifier.Notifier)
func (*FeatureToggled) PrePersist ¶ added in v1.0.0
func (e *FeatureToggled) PrePersist(*State) (Event, error)
type State ¶ added in v1.0.0
type State struct {
Users []User
Environments []Environment
Features []Feature
Enabled map[EnvFeature]bool
}
type UserCreated ¶ added in v1.0.0
type UserCreated struct {
Username string `json:"username"`
Password *string `json:"password,omitempty"`
PasswordHash string `json:"password_hash"`
}
func (*UserCreated) Notify ¶ added in v1.0.0
func (e *UserCreated) Notify(*State, notifier.Notifier)
func (*UserCreated) PrePersist ¶ added in v1.0.0
func (e *UserCreated) PrePersist(s *State) (Event, error)
Click to show internal directories.
Click to hide internal directories.