Documentation
¶
Index ¶
- func ClearAgents()
- func ForCreate(opt *BuilderLoadOptions)
- func ForSync(opt *BuilderLoadOptions)
- func LoadAgent(ctx context.Context, agent *resources.Agent) (*coreservices.ServiceAgent, error)
- func LoadBuilder(ctx context.Context, service *resources.Service) (*coreservices.BuilderAgent, error)
- func LoadCode(ctx context.Context, service *resources.Service) (*coreservices.CodeAgent, error)
- func LoadRuntime(ctx context.Context, service *resources.Service) (*coreservices.RuntimeAgent, error)
- func NetworkMappingForRestRouteGroup(ctx context.Context, group *resources.RestRouteGroup, ...) (*basev0.NetworkMapping, error)
- type AddOutput
- type AgentUpdate
- type BuilderInstance
- func (instance *BuilderInstance) Audit(ctx context.Context, req *builderv0.AuditRequest) (*builderv0.AuditResponse, error)
- func (instance *BuilderInstance) Build(ctx context.Context, req *builderv0.BuildRequest) (*builderv0.BuildResponse, error)
- func (instance *BuilderInstance) Create(ctx context.Context, req *builderv0.CreateRequest, ...) (*builderv0.CreateResponse, error)
- func (instance *BuilderInstance) Deploy(ctx context.Context, req *builderv0.DeploymentRequest) (*builderv0.DeploymentResponse, error)
- func (instance *BuilderInstance) Init(ctx context.Context, req *builderv0.InitRequest) (*builderv0.InitResponse, error)
- func (instance *BuilderInstance) Load(ctx context.Context, opts ...BuilderLoadOption) (*builderv0.LoadResponse, error)
- func (instance *BuilderInstance) Sync(ctx context.Context, req *builderv0.SyncRequest, ...) (*builderv0.SyncResponse, error)
- func (instance *BuilderInstance) Update(ctx context.Context, req *builderv0.UpdateRequest) (*builderv0.UpdateResponse, error)
- func (instance *BuilderInstance) Upgrade(ctx context.Context, req *builderv0.UpgradeRequest) (*builderv0.UpgradeResponse, error)
- type BuilderLoadOption
- type BuilderLoadOptions
- type Instance
- func (instance *Instance) CheckCapabilities(capability agentv0.Capability_Type) error
- func (instance *Instance) LoadBuilder(ctx context.Context) error
- func (instance *Instance) LoadRuntime(ctx context.Context, withRuntimeCheck bool) error
- func (instance *Instance) Unique() string
- func (instance *Instance) WithWorkspace(workspace *resources.Workspace)
- type ProcessInfo
- type RuntimeInstance
- func (instance *RuntimeInstance) Destroy(ctx context.Context, req *runtimev0.DestroyRequest) (*runtimev0.DestroyResponse, error)
- func (instance *RuntimeInstance) Information(ctx context.Context, req *runtimev0.InformationRequest) (*runtimev0.InformationResponse, error)
- func (instance *RuntimeInstance) Init(ctx context.Context, req *runtimev0.InitRequest) (*runtimev0.InitResponse, error)
- func (instance *RuntimeInstance) Load(ctx context.Context, env *basev0.Environment) (*runtimev0.LoadResponse, error)
- func (instance *RuntimeInstance) Start(ctx context.Context, req *runtimev0.StartRequest) (*runtimev0.StartResponse, error)
- func (instance *RuntimeInstance) Stop(ctx context.Context, req *runtimev0.StopRequest) (*runtimev0.StopResponse, error)
- func (instance *RuntimeInstance) Test(ctx context.Context, req *runtimev0.TestRequest) (*runtimev0.TestResponse, error)
- type UpdateInformation
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 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 ¶
func Add(ctx context.Context, workspace *resources.Workspace, module *resources.Module, input *actionservice.AddService, handler communicate.AnswerProvider) (*AddOutput, error)
type AgentUpdate ¶
type BuilderInstance ¶
type BuilderInstance struct {
*Instance
Builder *services.BuilderAgent
}
func (*BuilderInstance) Audit ¶ added in v0.1.155
func (instance *BuilderInstance) Audit(ctx context.Context, req *builderv0.AuditRequest) (*builderv0.AuditResponse, error)
func (*BuilderInstance) Build ¶ added in v0.1.155
func (instance *BuilderInstance) Build(ctx context.Context, req *builderv0.BuildRequest) (*builderv0.BuildResponse, error)
func (*BuilderInstance) Create ¶
func (instance *BuilderInstance) Create(ctx context.Context, req *builderv0.CreateRequest, handler communicate.AnswerProvider) (*builderv0.CreateResponse, error)
func (*BuilderInstance) Deploy ¶ added in v0.1.155
func (instance *BuilderInstance) Deploy(ctx context.Context, req *builderv0.DeploymentRequest) (*builderv0.DeploymentResponse, error)
func (*BuilderInstance) Init ¶ added in v0.1.155
func (instance *BuilderInstance) Init(ctx context.Context, req *builderv0.InitRequest) (*builderv0.InitResponse, error)
func (*BuilderInstance) Load ¶
func (instance *BuilderInstance) Load(ctx context.Context, opts ...BuilderLoadOption) (*builderv0.LoadResponse, error)
func (*BuilderInstance) Sync ¶
func (instance *BuilderInstance) Sync(ctx context.Context, req *builderv0.SyncRequest, handler communicate.AnswerProvider) (*builderv0.SyncResponse, error)
func (*BuilderInstance) Update ¶ added in v0.1.155
func (instance *BuilderInstance) Update(ctx context.Context, req *builderv0.UpdateRequest) (*builderv0.UpdateResponse, error)
func (*BuilderInstance) Upgrade ¶ added in v0.1.155
func (instance *BuilderInstance) Upgrade(ctx context.Context, req *builderv0.UpgradeRequest) (*builderv0.UpgradeResponse, error)
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 ¶
LoadBuilder creates a BuilderAgent from the shared connection.
func (*Instance) LoadRuntime ¶
LoadRuntime creates a RuntimeAgent from the shared connection.
func (*Instance) WithWorkspace ¶
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 (instance *RuntimeInstance) Destroy(ctx context.Context, req *runtimev0.DestroyRequest) (*runtimev0.DestroyResponse, error)
func (*RuntimeInstance) Information ¶ added in v0.1.155
func (instance *RuntimeInstance) Information(ctx context.Context, req *runtimev0.InformationRequest) (*runtimev0.InformationResponse, error)
func (*RuntimeInstance) Init ¶ added in v0.1.155
func (instance *RuntimeInstance) Init(ctx context.Context, req *runtimev0.InitRequest) (*runtimev0.InitResponse, error)
func (*RuntimeInstance) Load ¶
func (instance *RuntimeInstance) Load(ctx context.Context, env *basev0.Environment) (*runtimev0.LoadResponse, error)
func (*RuntimeInstance) Start ¶ added in v0.1.155
func (instance *RuntimeInstance) Start(ctx context.Context, req *runtimev0.StartRequest) (*runtimev0.StartResponse, error)
func (*RuntimeInstance) Stop ¶ added in v0.1.155
func (instance *RuntimeInstance) Stop(ctx context.Context, req *runtimev0.StopRequest) (*runtimev0.StopResponse, error)
func (*RuntimeInstance) Test ¶ added in v0.1.155
func (instance *RuntimeInstance) Test(ctx context.Context, req *runtimev0.TestRequest) (*runtimev0.TestResponse, error)