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 }