Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

process.go 799B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package process
  4. import (
  5. "context"
  6. "time"
  7. )
  8. var (
  9. SystemProcessType = "system"
  10. RequestProcessType = "request"
  11. NormalProcessType = "normal"
  12. NoneProcessType = "none"
  13. )
  14. // process represents a working process inheriting from Gitea.
  15. type process struct {
  16. PID IDType // Process ID, not system one.
  17. ParentPID IDType
  18. Description string
  19. Start time.Time
  20. Cancel context.CancelFunc
  21. Type string
  22. }
  23. // ToProcess converts a process to a externally usable Process
  24. func (p *process) toProcess() *Process {
  25. process := &Process{
  26. PID: p.PID,
  27. ParentPID: p.ParentPID,
  28. Description: p.Description,
  29. Start: p.Start,
  30. Type: p.Type,
  31. }
  32. return process
  33. }