client

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package client provides a client for the inventory server. It handles the connection to the server and sending inventory reports

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDockerContainers

func GetDockerContainers(defaultIP string) ([]inventory.Container, error)

GetDockerContainers returns a list of docker containers running on the host

func GetHost

func GetHost() (inventory.Host, error)

func GetIncusContainers

func GetIncusContainers() ([]inventory.Container, error)

GetIncusContainers returns a list of incus containers running on the host

func GetListeners

func GetListeners() ([]inventory.Listener, error)

GetListeners returns a list of network listeners on the host It uses the go-netstat library to get the list of TCP and UDP sockets and filters them to only include those in the LISTEN state.

Types

type Client added in v0.2.0

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

Client is the client for the inventory server

func NewClient added in v0.2.0

func NewClient(remote, location, description string, services []*inventory.Service) *Client

NewClient creates a new client for the inventory server `remote` is the address of the inventory server `location` is the location of the host `description` is the description of the host `services` is a list of services to report

func (*Client) Search added in v0.2.0

func (r *Client) Search(query string) ([]inventory.Report, error)

Search sends a search query to the server and returns the results It connects to the server using the remote address and sends the query to the server.

func (*Client) Send added in v0.2.0

func (r *Client) Send() error

Send sends the inventory report to the server It connects to the server using the remote address, and collects the host information, listeners, and containers

Jump to

Keyboard shortcuts

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