client

package
v0.0.0-...-ae9090d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientWithResponses

func NewClientWithResponses(
	appConfig config.Config,
) (*gen.ClientWithResponses, error)

NewClientWithResponses factory to create new instance. hate returning an error here... feels like a design flaw.

Types

type Client

type Client struct {
	// Client client for interacting with the API.
	Client *gen.ClientWithResponses
	// contains filtered or unexported fields
}

Client implementation of Client operations.

func New

func New(
	logger *slog.Logger,
	appConfig config.Config,
	client *gen.ClientWithResponses,
) *Client

New factory to create a new instance.

func (*Client) DeleteTaskByID

func (c *Client) DeleteTaskByID(
	ctx context.Context,
	messageID uint64,
) (*gen.DeleteTaskIDResponse, error)

DeleteTaskByID deletes a single item through the task API endpoint.

func (*Client) GetNetworkDNSByInterface

func (c *Client) GetNetworkDNSByInterface(
	ctx context.Context,
	interfaceName string,
) (*gen.GetNetworkDNSByInterfaceResponse, error)

GetNetworkDNSByInterface get the network dns get API endpoint.

func (*Client) GetSystemHostname

func (c *Client) GetSystemHostname(
	ctx context.Context,
) (*gen.GetSystemHostnameResponse, error)

GetSystemHostname get the system hostname API endpoint.

func (*Client) GetSystemStatus

func (c *Client) GetSystemStatus(
	ctx context.Context,
) (*gen.GetSystemStatusResponse, error)

GetSystemStatus get the system status API endpoint.

func (*Client) GetTaskByID

func (c *Client) GetTaskByID(
	ctx context.Context,
	messageID uint64,
) (*gen.GetTaskIDResponse, error)

GetTaskByID fetches a single item through the task API endpoint.

func (*Client) GetTaskList

func (c *Client) GetTaskList(
	ctx context.Context,
) (*gen.GetTaskResponse, error)

GetTaskList get all items through the task API endpoint.

func (*Client) GetTaskStatus

func (c *Client) GetTaskStatus(
	ctx context.Context,
) (*gen.GetTaskStatusResponse, error)

GetTaskStatus gets status through the task API endpoint.

func (*Client) PostNetworkPing

func (c *Client) PostNetworkPing(
	ctx context.Context,
	address string,
) (*gen.PostNetworkPingResponse, error)

PostNetworkPing post the network ping API endpoint.

func (*Client) PostTask

func (c *Client) PostTask(
	ctx context.Context,
	messageBody string,
) (*gen.PostTaskResponse, error)

PostTask inserts a single item into the task API endpoint.

func (*Client) PutNetworkDNS

func (c *Client) PutNetworkDNS(
	ctx context.Context,
	servers []string,
	searchDomains []string,
	interfaceName string,
) (*gen.PutNetworkDNSResponse, error)

PutNetworkDNS put the network dns put API endpoint.

type CombinedHandler

type CombinedHandler interface {
	NetworkHandler
	TaskHandler
	SystemHandler
}

CombinedHandler is a superset of all smaller handler interfaces.

type NetworkHandler

type NetworkHandler interface {
	// GetNetworkDNSByInterface get the network dns get API endpoint.
	GetNetworkDNSByInterface(
		ctx context.Context,
		_ string,
	) (*gen.GetNetworkDNSByInterfaceResponse, error)

	// PutNetworkDNS put the network dns put API endpoint.
	PutNetworkDNS(
		ctx context.Context,
		servers []string,
		searchDomains []string,
		interfaceName string,
	) (*gen.PutNetworkDNSResponse, error)
	// PostNetworkPing post the network ping API endpoint.
	PostNetworkPing(
		ctx context.Context,
		address string,
	) (*gen.PostNetworkPingResponse, error)
}

NetworkHandler defines an interface for interacting with Network client operations.

type SystemHandler

type SystemHandler interface {
	// GetSystemStatus get the system status API endpoint.
	GetSystemStatus(ctx context.Context) (*gen.GetSystemStatusResponse, error)
	// GetSystemHostname get the system hostname API endpoint.
	GetSystemHostname(ctx context.Context) (*gen.GetSystemHostnameResponse, error)
}

SystemHandler defines an interface for interacting with System client operations.

type TaskHandler

type TaskHandler interface {
	// DeleteTaskByID deletes a single item through the task API endpoint.
	DeleteTaskByID(
		ctx context.Context,
		messageID uint64,
	) (*gen.DeleteTaskIDResponse, error)
	// GetTaskID fetches a single item through the task API endpoint.
	GetTaskByID(
		ctx context.Context,
		messageID uint64,
	) (*gen.GetTaskIDResponse, error)
	// GetTaskList get all items through the task API endpoint.
	GetTaskList(
		ctx context.Context,
	) (*gen.GetTaskResponse, error)
	// PostTask inserts a single item into the task API endpoint.
	PostTask(
		ctx context.Context,
		messageBody string,
	) (*gen.PostTaskResponse, error)
	// GetTaskStatus gets status through the task API endpoint.
	GetTaskStatus(ctx context.Context) (*gen.GetTaskStatusResponse, error)
}

TaskHandler defines an interface for interacting with Task client operations.

Directories

Path Synopsis
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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