Skip to content

Commit

Permalink
Hook.ShouldExecute shouldn't be exposed
Browse files Browse the repository at this point in the history
  • Loading branch information
UnAfraid committed Sep 5, 2023
1 parent 8ae5cdb commit 19d8c54
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion peer/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Hook struct {
RunOnDelete bool
}

func (h *Hook) ShouldExecute(action HookAction) bool {
func (h *Hook) shouldExecute(action HookAction) bool {
switch action {
case HookActionCreate:
return h.RunOnCreate
Expand Down
2 changes: 1 addition & 1 deletion peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (p *Peer) update(options *UpdateOptions, fieldMask *UpdateFieldMask) {
func (p *Peer) runHooks(action HookAction) error {
var errs []error
for i, hook := range p.Hooks {
if !hook.ShouldExecute(action) {
if !hook.shouldExecute(action) {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion server/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Hook struct {
RunOnStop bool
}

func (h *Hook) ShouldExecute(action HookAction) bool {
func (h *Hook) shouldExecute(action HookAction) bool {
switch action {
case HookActionCreate:
return h.RunOnCreate
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (s *Server) update(options *UpdateOptions, fieldMask *UpdateFieldMask) {
func (s *Server) runHooks(action HookAction) error {
var errs []error
for i, hook := range s.Hooks {
if !hook.ShouldExecute(action) {
if !hook.shouldExecute(action) {
continue
}

Expand Down

0 comments on commit 19d8c54

Please sign in to comment.