runtimeapi

package
v0.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SameInvocation added in v0.3.2

func SameInvocation(left, right Invocation) bool

func WithInvocation added in v0.3.2

func WithInvocation(ctx context.Context, invocation Invocation) context.Context

Types

type Access

type Access string
const (
	Public  Access = "public"
	Auth    Access = "auth"
	Private Access = "private"
)

type ByteStat

type ByteStat struct {
	Bytes uint64 `json:"bytes"`
	Human string `json:"human"`
}

type CPUStats

type CPUStats struct {
	NumCPU             int     `json:"num_cpu"`
	GOMAXPROCS         int     `json:"gomaxprocs"`
	NumCgoCall         int64   `json:"num_cgo_call"`
	UserSeconds        float64 `json:"user_seconds"`
	SystemSeconds      float64 `json:"system_seconds"`
	TotalSeconds       float64 `json:"total_seconds"`
	ProcessPercent     float64 `json:"process_percent"`
	SampleWindowSecond float64 `json:"sample_window_seconds"`
}

type DiskStats

type DiskStats struct {
	Path             string   `json:"path"`
	Total            ByteStat `json:"total"`
	Used             ByteStat `json:"used"`
	Free             ByteStat `json:"free"`
	Available        ByteStat `json:"available"`
	UsedPercent      float64  `json:"used_percent"`
	FreePercent      float64  `json:"free_percent"`
	AvailablePercent float64  `json:"available_percent"`
	Error            string   `json:"error,omitempty"`
}

type ExecutionReceipt added in v0.3.2

type ExecutionReceipt struct {
	DurableIdentity  string `json:"durable_identity"`
	ExecutionID      string `json:"execution_id"`
	AcceptedRevision string `json:"accepted_revision"`
	StatusURL        string `json:"status_url,omitempty"`
}

ExecutionReceipt is the transport-neutral result of accepting a durable execution. StatusURL is absent unless the active profile authorizes polling.

type GCStats

type GCStats struct {
	NumGC             uint32   `json:"num_gc"`
	NextGC            ByteStat `json:"next_gc"`
	Pressure          float64  `json:"pressure"`
	PressurePercent   float64  `json:"pressure_percent"`
	GCCPUFraction     float64  `json:"gc_cpu_fraction"`
	LastGCUnixNano    uint64   `json:"last_gc_unix_nano"`
	LastGCAt          string   `json:"last_gc_at,omitempty"`
	PauseTotalNS      uint64   `json:"pause_total_ns"`
	LastPauseNS       uint64   `json:"last_pause_ns"`
	ForcedGCCount     uint32   `json:"forced_gc_count"`
	CompletedCyclePct float64  `json:"completed_cycle_percent"`
}

type GoStats

type GoStats struct {
	Version    string `json:"version"`
	Goroutines int    `json:"goroutines"`
	NumCPU     int    `json:"num_cpu"`
	GOMAXPROCS int    `json:"gomaxprocs"`
	NumCgoCall int64  `json:"num_cgo_call"`
}

type Invocation added in v0.3.2

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

Invocation is an opaque, runtime-created authority token for inherited internal calls. Its state is deliberately private so application code can pass but cannot forge one.

func InvocationFromContext added in v0.3.2

func InvocationFromContext(ctx context.Context) (Invocation, bool)

func NewInvocation added in v0.3.2

func NewInvocation(id, principal, tenantID, traceID string, deadline time.Time) Invocation

func NewInvocationWithMetadata added in v0.3.2

func NewInvocationWithMetadata(metadata InvocationMetadata) Invocation

func (Invocation) CallerBinding added in v0.3.2

func (invocation Invocation) CallerBinding() string

func (Invocation) Deadline added in v0.3.2

func (invocation Invocation) Deadline() (time.Time, bool)

func (Invocation) Deployment added in v0.3.2

func (invocation Invocation) Deployment() string

func (Invocation) ExecutionID added in v0.3.2

func (invocation Invocation) ExecutionID() string

func (Invocation) ID added in v0.3.2

func (invocation Invocation) ID() string

func (Invocation) Locale added in v0.3.2

func (invocation Invocation) Locale() string

func (Invocation) Principal added in v0.3.2

func (invocation Invocation) Principal() string

func (Invocation) TenantID added in v0.3.2

func (invocation Invocation) TenantID() string

func (Invocation) TraceID added in v0.3.2

func (invocation Invocation) TraceID() string

func (Invocation) Valid added in v0.3.2

func (invocation Invocation) Valid() bool

type InvocationMetadata added in v0.3.2

type InvocationMetadata struct {
	ID            string
	Principal     string
	TenantID      string
	TraceID       string
	Deadline      time.Time
	CallerBinding string
	ExecutionID   string
	Deployment    string
	Locale        string
}

InvocationMetadata is runtime-internal construction data. The package's Go internal boundary prevents application modules from importing it and manufacturing an inherited principal token.

type MemoryStats

type MemoryStats struct {
	CurrentHeap  ByteStat `json:"current_heap"`
	TotalAlloc   ByteStat `json:"total_alloc"`
	Sys          ByteStat `json:"sys"`
	HeapSys      ByteStat `json:"heap_sys"`
	HeapInUse    ByteStat `json:"heap_in_use"`
	HeapIdle     ByteStat `json:"heap_idle"`
	HeapReleased ByteStat `json:"heap_released"`
	StackInUse   ByteStat `json:"stack_in_use"`
	StackSys     ByteStat `json:"stack_sys"`
	HeapObjects  uint64   `json:"heap_objects"`
}

type OSProcessStats

type OSProcessStats struct {
	MaxRSS                     ByteStat `json:"max_rss"`
	MinorPageFaults            int64    `json:"minor_page_faults"`
	MajorPageFaults            int64    `json:"major_page_faults"`
	InputBlocks                int64    `json:"input_blocks"`
	OutputBlocks               int64    `json:"output_blocks"`
	VoluntaryContextSwitches   int64    `json:"voluntary_context_switches"`
	InvoluntaryContextSwitches int64    `json:"involuntary_context_switches"`
	Error                      string   `json:"error,omitempty"`
}

type ParamKind

type ParamKind string
const (
	ParamString ParamKind = "string"
	ParamBool   ParamKind = "bool"
	ParamInt    ParamKind = "int"
	ParamInt8   ParamKind = "int8"
	ParamInt16  ParamKind = "int16"
	ParamInt32  ParamKind = "int32"
	ParamInt64  ParamKind = "int64"
	ParamUint   ParamKind = "uint"
	ParamUint8  ParamKind = "uint8"
	ParamUint16 ParamKind = "uint16"
	ParamUint32 ParamKind = "uint32"
	ParamUint64 ParamKind = "uint64"
)

type ParamSpec

type ParamSpec struct {
	Name string
	Kind ParamKind
}

type PlatformStatsResponse

type PlatformStatsResponse struct {
	Timestamp           time.Time      `json:"timestamp"`
	AppID               string         `json:"app_id"`
	APIBaseURL          string         `json:"api_base_url"`
	RegisteredEndpoints int            `json:"registered_endpoints"`
	RegisteredCronJobs  int            `json:"registered_cron_jobs"`
	Process             ProcessStats   `json:"process"`
	Go                  GoStats        `json:"go"`
	CPU                 CPUStats       `json:"cpu"`
	Memory              MemoryStats    `json:"memory"`
	GC                  GCStats        `json:"gc"`
	Disk                DiskStats      `json:"disk"`
	OS                  OSProcessStats `json:"os"`
	Profiles            ProfileLinks   `json:"profiles"`
}

type ProcessStats

type ProcessStats struct {
	PID           int       `json:"pid"`
	PPID          int       `json:"ppid"`
	Executable    string    `json:"executable"`
	WorkingDir    string    `json:"working_dir"`
	StartedAt     time.Time `json:"started_at"`
	UptimeSeconds float64   `json:"uptime_seconds"`
}
type ProfileLinks struct {
	Index        string `json:"index"`
	Cmdline      string `json:"cmdline"`
	CPU          string `json:"cpu"`
	Trace        string `json:"trace"`
	Symbol       string `json:"symbol"`
	Heap         string `json:"heap"`
	Goroutine    string `json:"goroutine"`
	Allocs       string `json:"allocs"`
	Block        string `json:"block"`
	Mutex        string `json:"mutex"`
	ThreadCreate string `json:"threadcreate"`
}

type Registry added in v0.3.2

type Registry interface {
	Register(address string, implementation any) error
}

Registry is kept in the cycle-free runtime ABI package and re-exported as scenery.Registry for generated application adapters.

Jump to

Keyboard shortcuts

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