subsvc_ctx.go 518 B

1234567891011121314151617181920212223242526
  1. package core
  2. import "context"
  3. var _ IModuleLogger = (*SubServiceContext)(nil)
  4. type SubServiceContext struct {
  5. fw IAppFramework
  6. IModuleLogger
  7. }
  8. func NewSubServiceContext(name string, fw IAppFramework) *SubServiceContext {
  9. c := &SubServiceContext{
  10. fw: fw,
  11. IModuleLogger: fw.GetModuleLogger(name),
  12. }
  13. return c
  14. }
  15. func (c *SubServiceContext) GetParentContext() context.Context {
  16. return c.fw.GetContext()
  17. }
  18. func (c *SubServiceContext) GetGlobalDebugMode() bool {
  19. return c.fw.IsGlobalDebugMode()
  20. }