backendclient

package
v0.0.0-test.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package backendclient provides the agent-facing client for backend workflows.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("backend client not implemented")

ErrNotImplemented is returned by skeleton backend client methods.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	TotalComponents             int64    `json:"totalComponents"`
	RetentionPeriodSeconds      int64    `json:"retentionPeriodSeconds"`
	MetricScrapeIntervalSeconds int64    `json:"metricScrapeIntervalSeconds"`
	EnabledComponents           []string `json:"enabledComponents"`
	DisabledComponents          []string `json:"disabledComponents"`
	InventoryEnabled            bool     `json:"inventoryEnabled"`
	InventoryIntervalSeconds    int64    `json:"inventoryIntervalSeconds"`
	AttestationEnabled          bool     `json:"attestationEnabled"`
	AttestationIntervalSeconds  int64    `json:"attestationIntervalSeconds"`
}

type AttestationData

type AttestationData struct {
	SDKResponse           AttestationSDKResponse `json:"sdkResponse"`
	NonceRefreshTimestamp time.Time              `json:"nonceRefreshTimestamp"`
	Success               bool                   `json:"success"`
	ErrorMessage          string                 `json:"errorMessage,omitempty"`
}

type AttestationRequest

type AttestationRequest struct {
	AttestationData AttestationData `json:"attestationData"`
}

AttestationRequest is the backend DTO for attestation submission.

type AttestationSDKResponse

type AttestationSDKResponse struct {
	Evidences     []EvidenceItem `json:"evidences"`
	ResultCode    int            `json:"resultCode"`
	ResultMessage string         `json:"resultMessage"`
}

type BlockDevice

type BlockDevice struct {
	Name       string   `json:"name"`
	Type       string   `json:"type"`
	Size       int64    `json:"size"`
	WWN        string   `json:"wwn"`
	MountPoint string   `json:"mountPoint"`
	FSType     string   `json:"fsType"`
	PartUUID   string   `json:"partUUID"`
	Parents    []string `json:"parents"`
}

type CPUInfo

type CPUInfo struct {
	Type         string `json:"type"`
	Manufacturer string `json:"manufacturer"`
	Architecture string `json:"architecture"`
	LogicalCores string `json:"logicalCores"`
}

type Client

type Client interface {
	Enroll(ctx context.Context, sakToken string) (jwt string, err error)
	UpsertNode(ctx context.Context, nodeUUID string, req *NodeUpsertRequest, jwt string) error
	GetNonce(ctx context.Context, nodeUUID string, jwt string) (*NonceResponse, error)
	SubmitAttestation(ctx context.Context, nodeUUID string, req *AttestationRequest, jwt string) error
}

Client is the backend workflow client used by enrollment, inventory, and attestation paths.

func New

func New(rawBaseURL string) (Client, error)

New creates a backend client from a validated backend base URL.

func NewWithHTTPClient

func NewWithHTTPClient(baseURL *url.URL, httpClient *http.Client) Client

NewWithHTTPClient creates a backend client with an explicit HTTP client.

type DiskInfo

type DiskInfo struct {
	ContainerRootDisk string        `json:"containerRootDisk"`
	BlockDevices      []BlockDevice `json:"blockDevices"`
}

type EvidenceItem

type EvidenceItem struct {
	Arch          string `json:"arch"`
	Certificate   string `json:"certificate"`
	DriverVersion string `json:"driverVersion"`
	Evidence      string `json:"evidence"`
	Nonce         string `json:"nonce"`
	VBIOSVersion  string `json:"vbiosVersion"`
	Version       string `json:"version"`
}

type GPUDevice

type GPUDevice struct {
	UUID         string `json:"uuid"`
	BusID        string `json:"busID"`
	SN           string `json:"sn"`
	MinorID      string `json:"minorID"`
	BoardID      int    `json:"boardID"`
	VBIOSVersion string `json:"vbiosVersion"`
	ChassisSN    string `json:"chassisSN"`
	GPUIndex     string `json:"gpuIndex,omitempty"`
}

type GPUInfo

type GPUInfo struct {
	Product      string      `json:"product"`
	Manufacturer string      `json:"manufacturer"`
	Architecture string      `json:"architecture"`
	Memory       string      `json:"memory"`
	GPUs         []GPUDevice `json:"gpus"`
}

type HTTPStatusError

type HTTPStatusError struct {
	StatusCode int
	Body       string
}

HTTPStatusError captures a non-2xx backend response.

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type MemoryInfo

type MemoryInfo struct {
	TotalBytes string `json:"totalBytes"`
}

type NICInfo

type NICInfo struct {
	PrivateIPInterfaces []NICInterface `json:"privateIPInterfaces"`
}

type NICInterface

type NICInterface struct {
	Interface string `json:"interface"`
	MAC       string `json:"mac"`
	IP        string `json:"ip"`
}

type NodeResources

type NodeResources struct {
	CPUInfo    CPUInfo    `json:"cpuInfo"`
	MemoryInfo MemoryInfo `json:"memoryInfo"`
	GPUInfo    GPUInfo    `json:"gpuInfo"`
	DiskInfo   DiskInfo   `json:"diskInfo"`
	NICInfo    NICInfo    `json:"nicInfo"`
}

type NodeUpsertRequest

type NodeUpsertRequest struct {
	Hostname                string        `json:"hostname"`
	AgentConfig             AgentConfig   `json:"agentConfig,omitempty"`
	Resources               NodeResources `json:"resources"`
	AgentVersion            string        `json:"agentVersion"`
	GPUDriverVersion        string        `json:"gpuDriverVersion"`
	CUDAVersion             string        `json:"cudaVersion"`
	DCGMVersion             string        `json:"dcgmVersion"`
	ContainerRuntimeVersion string        `json:"containerRuntimeVersion"`
	KernelVersion           string        `json:"kernelVersion"`
	OSImage                 string        `json:"osImage"`
	OperatingSystem         string        `json:"operatingSystem"`
	SystemUUID              string        `json:"systemUUID"`
	MachineID               string        `json:"machineId"`
	BootID                  string        `json:"bootID"`
	Uptime                  *time.Time    `json:"uptime,omitempty"`
	EnrolledAt              *time.Time    `json:"enrolledAt,omitempty"`
	NetPrivateIP            string        `json:"netPrivateIP,omitempty"`
	NodeGroup               string        `json:"nodeGroup"`
	ComputeZone             string        `json:"computeZone"`
}

NodeUpsertRequest is the backend DTO for node inventory upserts.

type NonceResponse

type NonceResponse struct {
	Nonce                 string    `json:"nonce"`
	JWTAssertion          string    `json:"jwtAssertion,omitempty"`
	NonceRefreshTimestamp time.Time `json:"nonceRefreshTimestamp"`
}

NonceResponse is the backend DTO for node-scoped nonce responses.

Jump to

Keyboard shortcuts

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