agent

package
v0.0.0-...-5bd05a1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterApi

func RegisterApi(router *chi.Mux, statusUpdater *service.StatusUpdater, dataDir string)

func RegisterFileServer

func RegisterFileServer(router *chi.Mux, wwwDir string)

Types

type Agent

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

func New

func New(id uuid.UUID, config *config.Config) *Agent

New creates a new agent.

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

func (*Agent) Stop

func (a *Agent) Stop()

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, dataFolder, wwwFolder string) *Server

func (*Server) Start

func (s *Server) Start(statusUpdater *service.StatusUpdater)

func (*Server) Stop

func (s *Server) Stop(stopCh chan any)

type StatusReply

type StatusReply struct {
	Status     string `json:"status"`
	StatusInfo string `json:"statusInfo"`
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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