Skip to content

Commit

Permalink
add branch service in core
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown unknown committed Nov 6, 2023
1 parent fb9dadc commit db8b7be
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/branch/branch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Package branch contains the core branch service interface and implementation.
package branch

import "context"

// Service is the branch service interface.
type Service interface {
// Execute executes the given function in an isolated context.
// If the function returns an error, the execution is considered failed,
// and every ste change made during the execution is rolled back.
// If the function returns nil, the execution is considered successful, and
// committed.
// The context.Context passed to the `f` function is a child of the context
// passed to the Execute function, and is what should be used with other
// core services in order to ensure the execution remains isolated.
Execute(ctx context.Context, f func(ctx context.Context) error) error
}

0 comments on commit db8b7be

Please sign in to comment.