Skip to content

Commit

Permalink
v3: update plugin to v3
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Oct 9, 2022
1 parent 40b8f3d commit 0f21e6f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
- name: Run linter
uses: golangci/[email protected] # Action page: <https://github.com/golangci/golangci-lint-action>
with:
version: v1.49 # without patch version
version: v1.50 # without patch version
only-new-issues: false # show only new issues if it's a pull request
args: --timeout=10m --build-tags=race
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
- noctx # finds sending http request without context.Context
- nolintlint # Reports ill-formed or insufficient nolint directives
- prealloc # Finds slice declarations that could potentially be preallocated
- rowserrcheck # Checks whether Err of rows is checked successfully
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- stylecheck # Stylecheck is a replacement for golint
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module github.com/roadrunner-server/resetter/v2
module github.com/roadrunner-server/resetter/v3

go 1.19

require (
github.com/roadrunner-server/api/v2 v2.23.0
github.com/roadrunner-server/endure v1.4.5
github.com/roadrunner-server/errors v1.2.0
)
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/roadrunner-server/api/v2 v2.23.0 h1:FCpVZWl7fZZqBdD/Z4HCVgQ+vKbqARneji20mp3iqDM=
github.com/roadrunner-server/api/v2 v2.23.0/go.mod h1:UrOUfDFw0927h/PWv7f8PPcwfdHkwf8txWbmqszL7UA=
github.com/roadrunner-server/endure v1.4.5 h1:kInGwZc9Xd55gXsdAQonajz5I202MDyJdV+biJ6+asI=
github.com/roadrunner-server/endure v1.4.5/go.mod h1:FLqkppN/DAXhdMpuoVAlMt1L2odLCvCDRQr83gTHOl4=
github.com/roadrunner-server/errors v1.2.0 h1:qBmNXt8Iex9QnYTjCkbJKsBZu2EtYkQCM06GUDcQBbI=
Expand Down
13 changes: 9 additions & 4 deletions plugin.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package resetter

import (
"github.com/roadrunner-server/api/v2/plugins/resetter"
endure "github.com/roadrunner-server/endure/pkg/container"
"github.com/roadrunner-server/errors"
)

const PluginName = "resetter"

// Resetter interface
type Resetter interface {
// Reset reload plugin
Reset() error
}

type Plugin struct {
registry map[string]resetter.Resetter
registry map[string]Resetter
}

func (p *Plugin) Init() error {
p.registry = make(map[string]resetter.Resetter)
p.registry = make(map[string]Resetter)
return nil
}

Expand All @@ -29,7 +34,7 @@ func (p *Plugin) Reset(name string) error {
}

// RegisterTarget resettable service.
func (p *Plugin) RegisterTarget(name endure.Named, r resetter.Resetter) error {
func (p *Plugin) RegisterTarget(name endure.Named, r Resetter) error {
p.registry[name.Name()] = r
return nil
}
Expand Down

0 comments on commit 0f21e6f

Please sign in to comment.