Skip to content

Commit

Permalink
Remove get from registry getter methods (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexthack authored and ruflin committed Aug 24, 2017
1 parent 5eb647f commit f94477e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion beater/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type successCallback func([]beat.Event)
func newServer(config Config, publish successCallback) *http.Server {
mux := http.NewServeMux()

for path, p := range processor.Registry.GetProcessors() {
for path, p := range processor.Registry.Processors() {

handler := createHandler(p, config, publish)

Expand Down
2 changes: 1 addition & 1 deletion processor/error/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ func TestImplementProcessorInterface(t *testing.T) {
}

func TestAddProcessorToRegistryOnInit(t *testing.T) {
p := pr.Registry.GetProcessor("/v1/errors")
p := pr.Registry.Processor("/v1/errors")
assert.NotNil(t, p)
}
4 changes: 2 additions & 2 deletions processor/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func (r *Register) AddProcessor(path string, p Processor) {
}

// GetProcessors returns a list of all currently registered processors
func (r *Register) GetProcessors() map[string]Processor {
func (r *Register) Processors() map[string]Processor {
return r.processors
}

func (r *Register) GetProcessor(name string) Processor {
func (r *Register) Processor(name string) Processor {
return r.processors[name]
}
2 changes: 1 addition & 1 deletion processor/transaction/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ func TestImplementProcessorInterface(t *testing.T) {
}

func TestAddProcessorToRegistryOnInit(t *testing.T) {
p := pr.Registry.GetProcessor(Endpoint)
p := pr.Registry.Processor(Endpoint)
assert.NotNil(t, p)
}
2 changes: 1 addition & 1 deletion script/output_data/output_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func generate() error {
basepath := "tests/data/valid"
outputPath := "docs/data/elasticsearch/"

processors := processor.Registry.GetProcessors()
processors := processor.Registry.Processors()

var checked = map[string]struct{}{}

Expand Down

0 comments on commit f94477e

Please sign in to comment.