25 lines
435 B
Go
25 lines
435 B
Go
package service
|
|
|
|
import "context"
|
|
|
|
type (
|
|
IPackageLifecycle interface {
|
|
Sync(ctx context.Context)
|
|
}
|
|
)
|
|
|
|
var (
|
|
localPackageLifecycle IPackageLifecycle
|
|
)
|
|
|
|
func PackageLifecycle() IPackageLifecycle {
|
|
if localPackageLifecycle == nil {
|
|
panic("implement not found for interface IPackageLifecycle, forgot register?")
|
|
}
|
|
return localPackageLifecycle
|
|
}
|
|
|
|
func RegisterPackageLifecycle(i IPackageLifecycle) {
|
|
localPackageLifecycle = i
|
|
}
|