Skip to content

Commit

Permalink
remove WithService config option
Browse files Browse the repository at this point in the history
  • Loading branch information
fogfish committed Sep 28, 2024
1 parent 1810991 commit 61ae239
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ type Codec interface {
}

type Config struct {
// Instance of AWS Service, used to overwrite default client
Service any

// Source is a direct performer of the event.
// A software service that emits action to the stream.
Source string
Expand All @@ -48,7 +45,7 @@ type Config struct {

// Queue capacity (enhance with individual capacities)
CapOut int
CapDLQ int
CapDlq int
CapRcv int
CapAck int

Expand Down Expand Up @@ -76,7 +73,7 @@ func NewConfig() Config {
Source: "github.com/fogfish/swarm",
Policy: PolicyAtLeastOnce,
CapOut: 0,
CapDLQ: 0,
CapDlq: 0,
CapRcv: 0,
CapAck: 0,
Backoff: backoff.Exp(10*time.Millisecond, 10, 0.5),
Expand All @@ -89,13 +86,6 @@ func NewConfig() Config {
// Configuration option for queueing broker
type Option func(conf *Config)

// Configure AWS Service for broker instance
func WithService(service any) Option {
return func(conf *Config) {
conf.Service = service
}
}

// Source is a direct performer of the event.
// A software service that emits action to the stream.
func WithSource(agent string) Option {
Expand Down Expand Up @@ -217,7 +207,7 @@ func WithPolicyAtMostOnce(n int) Option {
return func(conf *Config) {
conf.Policy = PolicyAtMostOnce
conf.CapOut = n
conf.CapDLQ = n
conf.CapDlq = n
conf.CapRcv = n
conf.CapAck = n
}
Expand All @@ -230,7 +220,7 @@ func WithPolicyAtLeastOnce(n int) Option {
return func(conf *Config) {
conf.Policy = PolicyAtLeastOnce
conf.CapOut = 0
conf.CapDLQ = 0
conf.CapDlq = 0
conf.CapRcv = n
conf.CapAck = n
}
Expand Down

0 comments on commit 61ae239

Please sign in to comment.