Documentation ¶
Index ¶
- type ChangeBroadcaster
- type LocalStorage
- type Storage
- func (s *Storage) Filepath(jobID, taskID string) string
- func (s *Storage) RotateFile(logger zerolog.Logger, jobID, taskID string)
- func (s *Storage) Tail(jobID, taskID string) (string, error)
- func (s *Storage) TaskLogSize(jobID, taskID string) (int64, error)
- func (s *Storage) Write(logger zerolog.Logger, jobID, taskID string, logText string) error
- func (s *Storage) WriteTimestamped(logger zerolog.Logger, jobID, taskID string, logText string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeBroadcaster ¶
type ChangeBroadcaster interface { // BroadcastTaskLogUpdate sends the task log update to SocketIO clients. BroadcastTaskLogUpdate(taskLogUpdate api.EventTaskLogUpdate) }
type LocalStorage ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage can write data to task logs, rotate logs, etc.
func NewStorage ¶
func NewStorage( localStorage LocalStorage, clock clock.Clock, broadcaster ChangeBroadcaster, ) *Storage
NewStorage creates a new log storage rooted at `basePath`.
func (*Storage) Filepath ¶
Filepath returns the file path suitable to write a log file. Note that this intentionally shares the behaviour of `pathForJob()` in `internal/manager/local_storage/local_storage.go`; it is intended that the file handling code in this source file is migrated to use the `local_storage` package at some point.
func (*Storage) RotateFile ¶
RotateFile rotates the task's log file, ignoring (but logging) any errors that occur.
func (*Storage) TaskLogSize ¶
TaskLogSize returns the size of the task log, in bytes.
Click to show internal directories.
Click to hide internal directories.