Documentation
¶
Index ¶
- type CommandFactory
- type ExecutionContext
- type PrepareFunc
- type Session
- func Start(ctx context.Context, command, workdir string, env []string, ...) (*Session, map[string]any, error)
- func StartCommandWithTTY(ctx context.Context, build CommandFactory, timeout time.Duration, tty bool, ...) (*Session, map[string]any, error)
- func StartWithTTY(ctx context.Context, command, workdir string, env []string, ...) (*Session, map[string]any, error)
- func (s *Session) CloseStdin() error
- func (s *Session) Completed() bool
- func (s *Session) CompletedBefore(cutoff time.Time) bool
- func (s *Session) Kill() (bool, error)
- func (s *Session) Peek(status string, maxBytes int) map[string]any
- func (s *Session) SetExecutionContext(execution ExecutionContext)
- func (s *Session) Snapshot(status string, maxBytes int) map[string]any
- func (s *Session) Summary() Summary
- func (s *Session) WaitError() error
- func (s *Session) Write(text string) error
- type Store
- func (s *Store) Add(session *Session)
- func (s *Store) AddReserved(session *Session)
- func (s *Store) BeginClose()
- func (s *Store) Closing() bool
- func (s *Store) Delete(id string)
- func (s *Store) FinishStart()
- func (s *Store) Get(id string) (*Session, bool)
- func (s *Store) List() []*Session
- func (s *Store) PruneCompletedBefore(cutoff time.Time) int
- func (s *Store) PruneCompletedToLimit(limit int) int
- func (s *Store) ReleaseReservation()
- func (s *Store) ReservationCount() int
- func (s *Store) StartingCount() int
- func (s *Store) TryReserve(maxRunning int) bool
- func (s *Store) WaitForReservations(ctx context.Context) bool
- func (s *Store) WaitForStarts(ctx context.Context) bool
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionContext ¶
type Session ¶
type Session struct {
ID string
Command *exec.Cmd
Cancel context.CancelFunc
Stdin io.WriteCloser
StartedAt time.Time
FinishedAt time.Time
Done chan struct{}
TimedOut bool
Terminal string
// contains filtered or unexported fields
}
func StartCommandWithTTY ¶
func StartWithTTY ¶
func (*Session) CloseStdin ¶
func (*Session) Peek ¶
Peek returns the current unread output without advancing the observation cursors. Mutation tools use it so a following status call still receives the output.
func (*Session) SetExecutionContext ¶
func (s *Session) SetExecutionContext(execution ExecutionContext)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddReserved ¶
func (*Store) BeginClose ¶ added in v0.8.1
func (s *Store) BeginClose()
func (*Store) FinishStart ¶ added in v0.8.1
func (s *Store) FinishStart()
FinishStart 标记命令已经离开不可安全抢占的启动窗口。 调用方必须在 runner、进程控制器和取消监听都建立完成后调用。
func (*Store) PruneCompletedToLimit ¶
func (*Store) ReleaseReservation ¶
func (s *Store) ReleaseReservation()
func (*Store) ReservationCount ¶
func (*Store) StartingCount ¶ added in v0.8.1
func (*Store) TryReserve ¶
func (*Store) WaitForReservations ¶ added in v0.8.1
Click to show internal directories.
Click to hide internal directories.