services

package
v0.1.156 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearAgents

func ClearAgents()

ClearAgents shuts down all active agent processes gracefully.

The previous version sent SIGTERM and then immediately called conn.Close(), which sent SIGKILL — racing past the agent's own SIGTERM handler before it could reap its child processes (user binaries, Docker containers). conn.Close() is now graceful itself (SIGTERM → wait → SIGKILL fallback), so the explicit pre-signal here was both redundant and harmful.

func ForCreate added in v0.1.113

func ForCreate(opt *BuilderLoadOptions)

func ForSync added in v0.1.113

func ForSync(opt *BuilderLoadOptions)

func LoadAgent

func LoadAgent(ctx context.Context, agent *resources.Agent) (*coreservices.ServiceAgent, error)

LoadAgent spawns the agent binary (or reuses a cached connection) and returns a ServiceAgent client. The underlying connection is cached internally and used by LoadBuilder/LoadRuntime to create additional gRPC clients on the same process.

func LoadBuilder

func LoadBuilder(ctx context.Context, service *resources.Service) (*coreservices.BuilderAgent, error)

LoadBuilder creates a BuilderAgent from the cached agent connection.

func LoadCode added in v0.1.155

func LoadCode(ctx context.Context, service *resources.Service) (*coreservices.CodeAgent, error)

LoadCode creates a CodeAgent from the cached agent connection.

func LoadRuntime

func LoadRuntime(ctx context.Context, service *resources.Service) (*coreservices.RuntimeAgent, error)

LoadRuntime creates a RuntimeAgent from the cached agent connection.

func NetworkMappingForRestRouteGroup

func NetworkMappingForRestRouteGroup(ctx context.Context, group *resources.RestRouteGroup, mappings []*basev0.NetworkMapping) (*basev0.NetworkMapping, error)

NetworkMappingForRestRouteGroup finds the proper network mapping for a given route group

Types

type AddOutput added in v0.1.114

type AddOutput struct {
	ReadMe string
}

func Add

type AgentUpdate

type AgentUpdate struct {
	Name string
	From string
	To   string
}

type BuilderInstance

type BuilderInstance struct {
	*Instance

	Builder *services.BuilderAgent
}

func (*BuilderInstance) Audit added in v0.1.155

func (*BuilderInstance) Build added in v0.1.155

func (*BuilderInstance) Create

func (*BuilderInstance) Deploy added in v0.1.155

func (*BuilderInstance) Init added in v0.1.155

func (*BuilderInstance) Load

func (instance *BuilderInstance) Load(ctx context.Context, opts ...BuilderLoadOption) (*builderv0.LoadResponse, error)

func (*BuilderInstance) Sync

func (*BuilderInstance) Update added in v0.1.155

func (*BuilderInstance) Upgrade added in v0.1.155

type BuilderLoadOption added in v0.1.113

type BuilderLoadOption func(opt *BuilderLoadOptions)

type BuilderLoadOptions added in v0.1.113

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

type Instance

type Instance struct {
	Workspace *resources.Workspace
	Module    *resources.Module
	Service   *resources.Service

	Identity *resources.ServiceIdentity

	Agent *services.ServiceAgent
	Info  *agentv0.AgentInformation

	Builder *BuilderInstance
	Runtime *RuntimeInstance

	ProcessInfo
	Capabilities []*agentv0.Capability
}

func Load

func Load(ctx context.Context, workspace *resources.Workspace, module *resources.Module, service *resources.Service) (*Instance, error)

Load spawns a single agent process (or reuses a cached one) and creates all gRPC clients from the shared connection.

func (*Instance) CheckCapabilities

func (instance *Instance) CheckCapabilities(capability agentv0.Capability_Type) error

func (*Instance) LoadBuilder

func (instance *Instance) LoadBuilder(ctx context.Context) error

LoadBuilder creates a BuilderAgent from the shared connection.

func (*Instance) LoadRuntime

func (instance *Instance) LoadRuntime(ctx context.Context, withRuntimeCheck bool) error

LoadRuntime creates a RuntimeAgent from the shared connection.

func (*Instance) Unique added in v0.1.127

func (instance *Instance) Unique() string

func (*Instance) WithWorkspace

func (instance *Instance) WithWorkspace(workspace *resources.Workspace)

type ProcessInfo

type ProcessInfo struct {
	AgentPID int
}

type RuntimeInstance

type RuntimeInstance struct {
	*Instance

	Runtime *services.RuntimeAgent

	IsHotReloading bool
}

func (*RuntimeInstance) Destroy added in v0.1.155

func (*RuntimeInstance) Information added in v0.1.155

func (*RuntimeInstance) Init added in v0.1.155

func (*RuntimeInstance) Load

func (*RuntimeInstance) Start added in v0.1.155

func (*RuntimeInstance) Stop added in v0.1.155

func (*RuntimeInstance) Test added in v0.1.155

type UpdateInformation

type UpdateInformation struct {
	*AgentUpdate
}

func UpdateAgent

func UpdateAgent(ctx context.Context, service *resources.Service) (*UpdateInformation, error)

Jump to

Keyboard shortcuts

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