Documentation
¶
Index ¶
- Variables
- type AgentConnection
- type AgentRegistry
- type AgentStatus
- type AuditLogger
- type Authorizer
- type Core
- func (c *Core) ApplyStack(req *agentv1.ApplyStackRequest, stream agentv1.StackService_ApplyStackServer) error
- func (c *Core) DiffStack(ctx context.Context, req *agentv1.DiffStackRequest) (*agentv1.DiffStackResponse, error)
- func (c *Core) GetStack(ctx context.Context, req *agentv1.GetStackRequest) (*agentv1.GetStackResponse, error)
- func (c *Core) GetStackLogs(req *agentv1.GetStackLogsRequest, ...) error
- func (c *Core) HandleWebSocket(w http.ResponseWriter, r *http.Request)
- func (c *Core) Heartbeat(ctx context.Context, req *agentv1.HeartbeatRequest) (*agentv1.HeartbeatResponse, error)
- func (c *Core) ListAgents(ctx context.Context, req *agentv1.ListAgentsRequest) (*agentv1.ListAgentsResponse, error)
- func (c *Core) ListAgentsJSON() (interface{}, error)
- func (c *Core) ListStacks(ctx context.Context, req *agentv1.ListStacksRequest) (*agentv1.ListStacksResponse, error)
- func (c *Core) ProxyStackOperation(ctx context.Context, agentID string, req *agentv1.ApplyStackRequest) (string, error)
- func (c *Core) RegisterAgent(ctx context.Context, req *agentv1.RegisterRequest) (*agentv1.RegisterResponse, error)
- func (c *Core) RemoveStack(req *agentv1.RemoveStackRequest, stream agentv1.StackService_RemoveStackServer) error
- func (c *Core) Serve() error
- type CoreConfig
- type WSConnection
- type WSMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var WSUpgrader = websocket.Upgrader{ ReadBufferSize: 4096, WriteBufferSize: 4096, CheckOrigin: func(r *http.Request) bool { origin := r.Header.Get("Origin") if origin == "" { return true } return strings.Contains(origin, "localhost") || strings.Contains(origin, "127.0.0.1") || origin == r.Host }, }
WSUpgrader upgrades HTTP connections to WebSocket
Functions ¶
This section is empty.
Types ¶
type AgentConnection ¶
type AgentRegistry ¶
type AgentRegistry struct {
// contains filtered or unexported fields
}
type AgentStatus ¶
type AgentStatus string
const ( AgentStatusOnline AgentStatus = "online" AgentStatusOffline AgentStatus = "offline" AgentStatusError AgentStatus = "error" )
type AuditLogger ¶
type AuditLogger struct {
// contains filtered or unexported fields
}
func NewAuditLogger ¶
func NewAuditLogger(plugins *plugin.Registry) *AuditLogger
func (*AuditLogger) LogAgentOffline ¶
func (a *AuditLogger) LogAgentOffline(ctx context.Context, agentID string)
func (*AuditLogger) LogAgentRegistration ¶
func (a *AuditLogger) LogAgentRegistration(ctx context.Context, agentID, hostname string)
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(plugins *plugin.Registry) *Authorizer
type Core ¶
type Core struct {
agentv1.UnimplementedCoreServiceServer
agentv1.UnimplementedStackServiceServer
// contains filtered or unexported fields
}
Core is the central control plane that manages multiple agents
func NewCore ¶
func NewCore(cfg *CoreConfig) (*Core, error)
func (*Core) ApplyStack ¶
func (c *Core) ApplyStack(req *agentv1.ApplyStackRequest, stream agentv1.StackService_ApplyStackServer) error
func (*Core) DiffStack ¶
func (c *Core) DiffStack(ctx context.Context, req *agentv1.DiffStackRequest) (*agentv1.DiffStackResponse, error)
func (*Core) GetStack ¶
func (c *Core) GetStack(ctx context.Context, req *agentv1.GetStackRequest) (*agentv1.GetStackResponse, error)
func (*Core) GetStackLogs ¶
func (c *Core) GetStackLogs(req *agentv1.GetStackLogsRequest, stream agentv1.StackService_GetStackLogsServer) error
func (*Core) HandleWebSocket ¶
func (c *Core) HandleWebSocket(w http.ResponseWriter, r *http.Request)
HandleWebSocket handles incoming WebSocket connections from agents
func (*Core) Heartbeat ¶
func (c *Core) Heartbeat(ctx context.Context, req *agentv1.HeartbeatRequest) (*agentv1.HeartbeatResponse, error)
func (*Core) ListAgents ¶
func (c *Core) ListAgents(ctx context.Context, req *agentv1.ListAgentsRequest) (*agentv1.ListAgentsResponse, error)
ListAgents returns all registered agents
func (*Core) ListAgentsJSON ¶
ListAgentsJSON returns agents as JSON for the REST API
func (*Core) ListStacks ¶
func (c *Core) ListStacks(ctx context.Context, req *agentv1.ListStacksRequest) (*agentv1.ListStacksResponse, error)
func (*Core) ProxyStackOperation ¶
func (c *Core) ProxyStackOperation(ctx context.Context, agentID string, req *agentv1.ApplyStackRequest) (string, error)
ProxyStackOperation forwards stack operations to the target agent
func (*Core) RegisterAgent ¶
func (c *Core) RegisterAgent(ctx context.Context, req *agentv1.RegisterRequest) (*agentv1.RegisterResponse, error)
RegisterAgent handles agent registration
func (*Core) RemoveStack ¶
func (c *Core) RemoveStack(req *agentv1.RemoveStackRequest, stream agentv1.StackService_RemoveStackServer) error
type CoreConfig ¶
type WSConnection ¶
type WSConnection struct {
// contains filtered or unexported fields
}
WSConnection represents a WebSocket connection from an agent
Click to show internal directories.
Click to hide internal directories.