controllers

package
v0.0.0-...-8d92f6c Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidStatuses = map[string]db.IPStatus{
	"active":    db.Active,
	"blocked":   db.Blocked,
	"suspended": db.Suspended,
}

Functions

This section is empty.

Types

type HealthCheckController

type HealthCheckController struct{}

func (HealthCheckController) FetchAndStorePingResults

func (ctrl HealthCheckController) FetchAndStorePingResults(ip string, nodes []string) error

func (HealthCheckController) SendPingRequest

func (ctrl HealthCheckController) SendPingRequest(ip string, nodes []string) (string, error)

type IPController

type IPController struct{}

IPController handles the business logic for IP operations

func (IPController) Create

func (ctrl IPController) Create(ip *db.IP) error

Create adds a new IP address to the database

func (IPController) Delete

func (ctrl IPController) Delete(id uuid.UUID) error

Delete removes an IP address by its UUID

func (IPController) GetAll

func (ctrl IPController) GetAll(status, sort string, offset, limit int) ([]db.IP, error)

GetAll retrieves all IP addresses with optional filters

func (IPController) GetByID

func (ctrl IPController) GetByID(id uuid.UUID) (*db.IP, error)

GetByID retrieves a specific IP address by its UUID

func (IPController) Update

func (ctrl IPController) Update(id uuid.UUID, data map[string]interface{}) (*db.IP, error)

Update modifies an existing IP address

type PingRequestResponse

type PingRequestResponse struct {
	Nodes         map[string][]string `json:"nodes"`
	Ok            int                 `json:"ok"`
	PermanentLink string              `json:"permanent_link"`
	RequestID     string              `json:"request_id"`
}

type PingResultResponse

type PingResultResponse map[string][][][]interface{}

Jump to

Keyboard shortcuts

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