Documentation
¶
Overview ¶
Package eventbridge is doze-aws's local EventBridge: event buses, rules with the full content-based pattern language (internal/eventpattern), and synchronous delivery to SQS and Lambda targets with Input / InputPath / InputTransformer shaping.
rate(...) scheduled rules are driven by a local ticker; cron(...) and destinations, partner event sources, and the schemas registry are cloud infrastructure and answer honestly.
See docs/api-support/eventbridge.md for the operation table.
Index ¶
- Constants
- type Bus
- type InputTransformer
- type Options
- type Rule
- type Server
- type Store
- func (s *Store) CreateBus(name string, tags map[string]string) error
- func (s *Store) DeleteBus(name string) error
- func (s *Store) DeleteRule(bus, name string) error
- func (s *Store) GetRule(bus, name string) (*Rule, error)
- func (s *Store) ListBuses() ([]Bus, error)
- func (s *Store) PutRule(r Rule) error
- func (s *Store) Rules(bus, prefix string) ([]Rule, error)
- func (s *Store) UpdateRule(bus, name string, fn func(*Rule) error) error
- type Target
Constants ¶
const DefaultBus = "default"
DefaultBus is the implicit bus every account has.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputTransformer ¶
type InputTransformer struct {
PathsMap map[string]string `json:"paths_map,omitempty"`
Template string `json:"template"`
}
InputTransformer maps event paths into a template.
type Options ¶
type Options struct {
// DataDir holds the bbolt store (eventbridge.bolt). Required.
DataDir string
// Peers resolves SQS/Lambda targets. Nil disables delivery (logged).
Peers peers.Directory
// Logf receives log lines; nil discards.
Logf func(format string, args ...any)
// Clock overrides time.Now in tests.
Clock func() time.Time
}
Options configures the service.
type Rule ¶
type Rule struct {
Bus string `json:"bus"`
Name string `json:"name"`
Pattern string `json:"pattern,omitempty"` // event pattern JSON
Schedule string `json:"schedule,omitempty"` // stored; ticker in Phase 8
State string `json:"state"` // ENABLED | DISABLED
Desc string `json:"desc,omitempty"`
Targets []Target `json:"targets,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
Rule is one rule on a bus.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the EventBridge service: an http.Handler speaking AWS JSON 1.1, and an io.Closer.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the bbolt-backed EventBridge state.
func (*Store) DeleteRule ¶
DeleteRule removes a rule (Force semantics: targets go with it).
type Target ¶
type Target struct {
ID string `json:"id"`
ARN string `json:"arn"`
Input string `json:"input,omitempty"` // literal input override
InputPath string `json:"input_path,omitempty"` // $.path extraction
InputTransformer *InputTransformer `json:"input_transformer,omitempty"`
}
Target is one rule target.