model

package
v0.0.0-...-4fa2157 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorExitCode

type ErrorExitCode uint8

type ErrorReason

type ErrorReason string

type ErrorSource

type ErrorSource string
const (
	ErrorSourceClient   ErrorSource = "Client"
	ErrorSourceServer   ErrorSource = "Server"
	ErrorSourceFunction ErrorSource = "Customer"
	ErrorSourceHook     ErrorSource = "Hook"
)

type Event

type Event struct {
	Time  int64     `json:"timestamp_millis"`
	Event EventData `json:"event"`
}

func (Event) String

func (e Event) String() string

type EventData

type EventData struct {
	EvType     EventType               `json:"type"`
	Name       string                  `json:"name"`
	Cause      ProcessTerminationCause `json:"cause"`
	Signo      *int32                  `json:"signo"`
	ExitStatus *int32                  `json:"exit_status"`
	Size       *uint64                 `json:"size"`
}

func (EventData) ProcessTerminated

func (d EventData) ProcessTerminated() *ProcessTermination

func (EventData) String

func (d EventData) String() string

type EventType

type EventType string
const (
	ProcessTerminationType EventType = "process_termination"
	EventLossType          EventType = "event_loss"
)

type ExecRequest

type ExecRequest struct {
	Name string `json:"name"`

	Path string   `json:"path"`
	Args []string `json:"args,omitempty"`

	Cwd          *string      `json:"cwd,omitempty"`
	Env          *model.KVMap `json:"env,omitempty"`
	Logging      Logging      `json:"log_config"`
	StdoutWriter io.Writer    `json:"-"`
	StderrWriter io.Writer    `json:"-"`
}

type KillRequest

type KillRequest struct {
	Name     string    `json:"name"`
	Deadline time.Time `json:"deadline"`
}

type LockHardError

type LockHardError interface {
	Source() string

	Reason() string

	Cause() string

	HookName() string
}

type Logging

type Logging struct {
	Managed ManagedLogging `json:"managed"`
}

type ManagedLogging

type ManagedLogging struct {
	Topic   ManagedLoggingTopic    `json:"topic"`
	Formats []ManagedLoggingFormat `json:"formats"`
}

type ManagedLoggingFormat

type ManagedLoggingFormat string
const (
	LineBasedManagedLogging    ManagedLoggingFormat = "line"
	MessageBasedManagedLogging ManagedLoggingFormat = "message"
)

type ManagedLoggingTopic

type ManagedLoggingTopic string
const (
	RuntimeManagedLoggingTopic     ManagedLoggingTopic = "runtime"
	RtExtensionManagedLoggingTopic ManagedLoggingTopic = "runtime_extension"
)

type MockLockHardError

type MockLockHardError struct {
	mock.Mock
}

func NewMockLockHardError

func NewMockLockHardError(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockLockHardError

func (*MockLockHardError) Cause

func (_m *MockLockHardError) Cause() string

func (*MockLockHardError) HookName

func (_m *MockLockHardError) HookName() string

func (*MockLockHardError) Reason

func (_m *MockLockHardError) Reason() string

func (*MockLockHardError) Source

func (_m *MockLockHardError) Source() string

type MockProcessSupervisor

type MockProcessSupervisor struct {
	mock.Mock
}

func NewMockProcessSupervisor

func NewMockProcessSupervisor(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockProcessSupervisor

func (*MockProcessSupervisor) Events

func (_m *MockProcessSupervisor) Events(_a0 context.Context) (<-chan Event, error)

func (*MockProcessSupervisor) Exec

func (*MockProcessSupervisor) Kill

func (*MockProcessSupervisor) Terminate

func (_m *MockProcessSupervisor) Terminate(_a0 context.Context, _a1 *TerminateRequest) error

type MockProcessSupervisorClient

type MockProcessSupervisorClient struct {
	mock.Mock
}

func NewMockProcessSupervisorClient

func NewMockProcessSupervisorClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockProcessSupervisorClient

func (*MockProcessSupervisorClient) Events

func (_m *MockProcessSupervisorClient) Events(_a0 context.Context) (<-chan Event, error)

func (*MockProcessSupervisorClient) Exec

func (*MockProcessSupervisorClient) Kill

func (*MockProcessSupervisorClient) Terminate

type ProcessSupervisor

type ProcessSupervisor interface {
	Exec(context.Context, *ExecRequest) error
	Terminate(context.Context, *TerminateRequest) error
	Kill(context.Context, *KillRequest) error
	Events(context.Context) (<-chan Event, error)
}

type ProcessSupervisorClient

type ProcessSupervisorClient interface {
	ProcessSupervisor
}

type ProcessTermination

type ProcessTermination struct {
	Name       string
	Cause      ProcessTerminationCause
	Signo      *int32
	ExitStatus *int32
}

func (ProcessTermination) Exited

func (t ProcessTermination) Exited() *int32

func (ProcessTermination) ExitedWithZeroExitCode

func (t ProcessTermination) ExitedWithZeroExitCode() bool

func (ProcessTermination) OomKilled

func (t ProcessTermination) OomKilled() bool

func (ProcessTermination) Signaled

func (t ProcessTermination) Signaled() *int32

func (ProcessTermination) String

func (t ProcessTermination) String() string

type ProcessTerminationCause

type ProcessTerminationCause string
const (
	Signaled  ProcessTerminationCause = "signaled"
	Exited    ProcessTerminationCause = "exited"
	OomKilled ProcessTerminationCause = "oom_killed"
)

type SupervisorError

type SupervisorError struct {
	SourceErr   ErrorSource   `json:"source"`
	HookNameErr string        `json:"hook_name"`
	ExitCodeErr ErrorExitCode `json:"exit_code"`
	ReasonErr   string        `json:"reason"`
	CauseErr    string        `json:"cause"`
}

func (*SupervisorError) Cause

func (l *SupervisorError) Cause() string

func (*SupervisorError) Error

func (l *SupervisorError) Error() string

func (*SupervisorError) ExitCode

func (l *SupervisorError) ExitCode() ErrorExitCode

func (*SupervisorError) HookName

func (l *SupervisorError) HookName() string

func (*SupervisorError) Reason

func (l *SupervisorError) Reason() string

func (*SupervisorError) Source

func (l *SupervisorError) Source() ErrorSource

type TerminateRequest

type TerminateRequest struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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