api

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorRed    = "\033[31m"
	ColorBlue   = "\033[34m"
	ColorCyan   = "\033[36m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(serverAddr string, checkInterval time.Duration, customer string, environment string) (*Client, error)

func (*Client) CheckAndExecute

func (c *Client) CheckAndExecute() error

func (*Client) SetDryRun

func (c *Client) SetDryRun(enabled bool)

func (*Client) Start

func (c *Client) Start() error

type EnvironmentManager

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

func NewEnvironmentManager

func NewEnvironmentManager(baseDir string) (*EnvironmentManager, error)

func (*EnvironmentManager) Close

func (m *EnvironmentManager) Close() error

func (*EnvironmentManager) GetEnvironments

func (m *EnvironmentManager) GetEnvironments() map[string][]models.Playbook

func (*EnvironmentManager) GetPlaybooksForHost

func (m *EnvironmentManager) GetPlaybooksForHost(hostname string) []models.Task

type InventoryEntry

type InventoryEntry struct {
	Hostname    string    `json:"hostname"`
	IP          string    `json:"ip"`
	LastSeen    time.Time `json:"last_seen"`
	FirstSeen   time.Time `json:"first_seen"`
	Environment string    `json:"environment,omitempty"`
}

InventoryEntry represents a client in the inventory

type InventoryManager

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

InventoryManager handles the server's inventory of clients

func NewInventoryManager

func NewInventoryManager(dataDir string) (*InventoryManager, error)

NewInventoryManager creates a new inventory manager

func (*InventoryManager) GetInventory

func (im *InventoryManager) GetInventory() []InventoryEntry

GetInventory returns all inventory entries

func (*InventoryManager) UpdateClient

func (im *InventoryManager) UpdateClient(hostname, remoteAddr string) error

UpdateClient updates or adds a client in the inventory

type Server

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

func NewServer

func NewServer(playbookDir string) (*Server, error)

func (*Server) Start

func (s *Server) Start(addr string) error

type TaskResult

type TaskResult struct {
	Name       string
	Status     string
	Changed    bool
	Failed     bool
	SkipReason string
	Duration   time.Duration
	Output     string
	Error      string
}

Jump to

Keyboard shortcuts

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