workload

package
v0.0.0-...-b022d11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

EventHandler define event handler

func NewEventHandler

func NewEventHandler() *EventHandler

NewEventHandler new a event handler

func (*EventHandler) Handle

func (e *EventHandler) Handle(action string, h func(context.Context, *types.WorkloadEventMessage))

Handle hand a event

func (*EventHandler) Watch

func (e *EventHandler) Watch(ctx context.Context, c <-chan *types.WorkloadEventMessage)

Watch watch change

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager .

func NewManager

func NewManager(ctx context.Context, config *types.Config) (*Manager, error)

NewManager returns a workload manager

func (*Manager) PullLog

func (m *Manager) PullLog(ctx context.Context, app string, buf *bufio.ReadWriter)

PullLog pull logs for specific app

func (*Manager) Run

func (m *Manager) Run(ctx context.Context) error

Run will start agent blocks by ctx.Done() either call this in a separated goroutine, or used in main to block main goroutine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL