Documentation
¶
Index ¶
- Variables
- func EventSchemaSyntaxCheck(spec []byte) error
- func RulePatternSyntaxCheck(ctx context.Context, spec []byte) error
- func RuleTargetSyntaxCheck(ctx context.Context, t *rule.Target) error
- type Bus
- type BusRepo
- type BusUseCase
- func (uc *BusUseCase) CreateBus(ctx context.Context, bus string, mode v1.BusWorkMode, source MQTopic, ...) (uint64, error)
- func (uc *BusUseCase) DeleteBus(ctx context.Context, bus string) error
- func (uc *BusUseCase) ListBus(ctx context.Context, prefix *string, limit int32, nextToken uint64) ([]*Bus, uint64, error)
- type DispatcherSchema
- type EventInfo
- type EventRepo
- type EventUseCase
- func (uc *EventUseCase) CreateSchema(ctx context.Context, source string, sType string, busName string, spec []byte) error
- func (uc *EventUseCase) DeleteSchema(ctx context.Context, source string, sType *string) error
- func (uc *EventUseCase) ListSchema(ctx context.Context, source *string, sType *string, busName *string, ...) ([]*Schema, error)
- func (uc *EventUseCase) PostEvent(ctx context.Context, eventExt *rule.EventExt, pubTime *timestamppb.Timestamp) (*EventInfo, error)
- func (uc *EventUseCase) UpdateSchema(ctx context.Context, source string, sType string, busName *string, spec []byte) error
- type MQTopic
- type RuleRepo
- type RuleUseCase
- func (uc *RuleUseCase) CreateRule(ctx context.Context, bus string, name string, status v1.RuleStatus, ...) (uint64, error)
- func (uc *RuleUseCase) CreateTargets(ctx context.Context, bus string, ruleName string, targets []*rule.Target) error
- func (uc *RuleUseCase) DeleteRule(ctx context.Context, bus string, name string) error
- func (uc *RuleUseCase) DeleteTargets(ctx context.Context, bus string, ruleName string, targetIDs []uint64) error
- func (uc *RuleUseCase) ListDispatcherSchema(ctx context.Context, types []string) ([]*DispatcherSchema, error)
- func (uc *RuleUseCase) ListRule(ctx context.Context, bus string, prefix *string, status v1.RuleStatus, ...) ([]*rule.Rule, uint64, error)
- func (uc *RuleUseCase) UpdateRule(ctx context.Context, bus string, name string, status v1.RuleStatus, ...) error
- type Schema
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewBusUseCase, NewEventUseCase, NewRuleUseCase, )
ProviderSet is service providers.
Functions ¶
func EventSchemaSyntaxCheck ¶
Types ¶
type Bus ¶
type Bus struct {
Name string
Mode v1.BusWorkMode
Source MQTopic
SourceDelay MQTopic
TargetExpDecay MQTopic
TargetBackoff MQTopic
}
Bus should be able to compare values and cannot contain pointers
type BusRepo ¶
type BusRepo interface {
ListBus(ctx context.Context, prefix *string, limit int32, nextToken uint64) ([]*Bus, uint64, error)
CreateBus(
ctx context.Context, bus string, mode v1.BusWorkMode, source MQTopic,
sourceDelay MQTopic, targetExpDecay MQTopic, targetBackoff MQTopic,
) (uint64, error)
DeleteBus(ctx context.Context, bus string) error
}
type BusUseCase ¶
type BusUseCase struct {
// contains filtered or unexported fields
}
func NewBusUseCase ¶
func NewBusUseCase(repo BusRepo, logger log.Logger) *BusUseCase
type DispatcherSchema ¶
type EventRepo ¶
type EventRepo interface {
PostEvent(ctx context.Context, eventExt *rule.EventExt, pubTime *timestamppb.Timestamp) (*EventInfo, error)
ListSchema(
ctx context.Context, source *string, sType *string, busName *string, time *timestamppb.Timestamp,
) ([]*Schema, error)
CreateSchema(ctx context.Context, source string, sType string, busName string, spec []byte) error
UpdateSchema(ctx context.Context, source string, sType string, busName *string, spec []byte) error
DeleteSchema(ctx context.Context, source string, sType *string) error
}
type EventUseCase ¶
type EventUseCase struct {
// contains filtered or unexported fields
}
func NewEventUseCase ¶
func NewEventUseCase(repo EventRepo, logger log.Logger) *EventUseCase
func (*EventUseCase) CreateSchema ¶
func (*EventUseCase) DeleteSchema ¶
func (*EventUseCase) ListSchema ¶
func (uc *EventUseCase) ListSchema( ctx context.Context, source *string, sType *string, busName *string, time *timestamppb.Timestamp, ) ([]*Schema, error)
func (*EventUseCase) PostEvent ¶
func (uc *EventUseCase) PostEvent( ctx context.Context, eventExt *rule.EventExt, pubTime *timestamppb.Timestamp, ) (*EventInfo, error)
func (*EventUseCase) UpdateSchema ¶
type MQTopic ¶
type MQTopic struct {
Type v1.MQType `json:"type"`
Endpoints string `json:"endpoints"` // "endpoint1;endpoint2"
Topic string `json:"topic"`
}
MQTopic should be able to compare values and cannot contain pointers
type RuleRepo ¶
type RuleRepo interface {
ListRule(
ctx context.Context, bus string, prefix *string, status v1.RuleStatus, limit int32, nextToken uint64,
) ([]*rule.Rule, uint64, error)
CreateRule(
ctx context.Context, bus string, name string, status v1.RuleStatus, pattern []byte, targets []*rule.Target,
) (uint64, error)
UpdateRule(ctx context.Context, bus string, name string, status v1.RuleStatus, pattern []byte) error
DeleteRule(ctx context.Context, bus string, name string) error
CreateTargets(ctx context.Context, bus string, ruleName string, targets []*rule.Target) error
DeleteTargets(ctx context.Context, bus string, ruleName string, targetIDs []uint64) error
ListDispatcherSchema(ctx context.Context, types []string) ([]*DispatcherSchema, error)
}
type RuleUseCase ¶
type RuleUseCase struct {
// contains filtered or unexported fields
}
func NewRuleUseCase ¶
func NewRuleUseCase(repo RuleRepo, logger log.Logger) *RuleUseCase
func (*RuleUseCase) CreateRule ¶
func (*RuleUseCase) CreateTargets ¶
func (*RuleUseCase) DeleteRule ¶
func (*RuleUseCase) DeleteTargets ¶
func (*RuleUseCase) ListDispatcherSchema ¶
func (uc *RuleUseCase) ListDispatcherSchema(ctx context.Context, types []string) ([]*DispatcherSchema, error)
func (*RuleUseCase) UpdateRule ¶
func (uc *RuleUseCase) UpdateRule( ctx context.Context, bus string, name string, status v1.RuleStatus, pattern []byte, ) error
type Schema ¶
type Schema struct {
Source string
Type string
BusName string
Spec string
Time *timestamppb.Timestamp
// contains filtered or unexported fields
}
func (*Schema) GetValidator ¶
func (s *Schema) GetValidator() *gojsonschema.Schema
Click to show internal directories.
Click to hide internal directories.