Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterApi ¶
func RegisterApi(router *chi.Mux, statusUpdater *service.StatusUpdater, statusProvider AgentStatusProvider, configuration *config.Config)
func RegisterFileServer ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
type AgentStatusProvider ¶
type AgentStatusProvider interface {
GetStatus() common.AgentStatus
}
type InventoryReply ¶
type InventoryReply struct { AgentID string `json:"agentId"` Inventory api.Inventory `json:"inventory"` }
func (InventoryReply) Render ¶
func (v InventoryReply) Render(w http.ResponseWriter, r *http.Request) error
type SelfSignedCertificateProvider ¶
type SelfSignedCertificateProvider struct {
// contains filtered or unexported fields
}
func NewSelfSignedCertificateProvider ¶
func NewSelfSignedCertificateProvider(credentialAddr *net.TCPAddr) *SelfSignedCertificateProvider
func (*SelfSignedCertificateProvider) GetCertificate ¶
func (s *SelfSignedCertificateProvider) GetCertificate(expire time.Time) (*x509.Certificate, *rsa.PrivateKey, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves 3 endpoints: - /login serves the credentials login form - /api/v1/credentials called by the agent ui to pass the credentials entered by the user - /api/v1/status return the status of the agent.
func NewServer ¶
func NewServer(port int, configuration *config.Config, cert *x509.Certificate, certPrivateKey *rsa.PrivateKey) *Server
func (*Server) Start ¶
func (s *Server) Start(statusUpdater *service.StatusUpdater, statusProvider AgentStatusProvider)
type ServiceUIReply ¶
type ServiceUIReply struct {
URL string `json:"url"`
}
func (ServiceUIReply) Render ¶
func (s ServiceUIReply) Render(w http.ResponseWriter, r *http.Request) error
type StatusReply ¶
type StatusReply struct { Status string `json:"status"` Connected string `json:"connected"` StatusInfo string `json:"statusInfo"` AgentStateUpdateSuccessful string `json:"agentStateUpdateSuccessful,omitempty"` AgentStateUpdateErrMessage string `json:"agentStateUpdateErrMessage,omitempty"` InventoryUpdateSuccessful string `json:"inventoryUpdateSuccessful,omitempty"` InventoryUpdateErrMessage string `json:"inventoryUpdateErrMessage,omitempty"` }
func (StatusReply) Render ¶
func (s StatusReply) Render(w http.ResponseWriter, r *http.Request) error
type VersionReply ¶
type VersionReply struct {
Version string `json:"version"`
}
func (VersionReply) Render ¶
func (v VersionReply) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.