apitypes

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	// Status is the HTTP-style status code (e.g., 400, 404, 500)
	Status int `json:"status"`
	// Title is a short, human-readable summary of the problem type
	Title string `json:"title"`
	// Detail is a human-readable explanation specific to this occurrence
	Detail string `json:"detail"`
}

ApiError represents an RFC 7807 (problem+json) error response.

func (*ApiError) Error

func (e *ApiError) Error() string

type BusCreateResponse

type BusCreateResponse struct {
	BusID uint32 `json:"busId"`
}

type BusListResponse

type BusListResponse struct {
	Buses []uint32 `json:"buses"`
}

type BusRemoveResponse

type BusRemoveResponse struct {
	BusID uint32 `json:"busId"`
}

type Device

type Device struct {
	BusID uint32 `json:"busId"`
	DevId string `json:"devId"`
	Vid   string `json:"vid"`
	Pid   string `json:"pid"`
	Type  string `json:"type"`
}

type DeviceCreateRequest

type DeviceCreateRequest struct {
	Type      *string `json:"type"`
	IdVendor  *uint16 `json:"idVendor,omitempty"`
	IdProduct *uint16 `json:"idProduct,omitempty"`
}

func (*DeviceCreateRequest) UnmarshalJSON

func (d *DeviceCreateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling to accept both uint16 and hex string formats for idVendor and idProduct (e.g., "0x12ac" or 4780).

type DeviceRemoveResponse

type DeviceRemoveResponse struct {
	BusID uint32 `json:"busId"`
	DevId string `json:"devId"`
}

type DevicesListResponse

type DevicesListResponse struct {
	Devices []Device `json:"devices"`
}

type PingResponse added in v0.3.0

type PingResponse struct {
	Server  string `json:"server"`
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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