Documentation
¶
Index ¶
- type Job
- type Store
- func (s *Store) Create(id string)
- func (s *Store) Get(id string) (*Job, bool)
- func (s *Store) Subscribe(id string) (<-chan *Job, func())
- func (s *Store) Update(id, status, msg string, data map[string]string)
- func (s *Store) UpdateProgress(id string, p int)
- func (s *Store) UpdateWithOperation(id, status, msg string, data map[string]string, operation string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
Status string `json:"status"`
Message string `json:"message"` // i18n key
Data map[string]string `json:"data,omitempty"`
Progress int `json:"progress"`
Operation string `json:"operation"` // e.g., "downloading", "compressing", "uploading"
}
Job represents the state of a single PDF process
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds all jobs in memory
func (*Store) Subscribe ¶ added in v1.1.2
Subscribe returns a channel that receives job updates for the given id. The returned function should be called to unsubscribe when done.
func (*Store) UpdateProgress ¶ added in v1.1.1
UpdateProgress sets the progress (0-100) for a job.
Click to show internal directories.
Click to hide internal directories.