Documentation
¶
Index ¶
- type APIError
- type Board
- type Client
- func (c *Client) CreateSession(boardType string) (*Session, error)
- func (c *Client) DialSerialWS(ctx context.Context, sessionID string) (*websocket.Conn, error)
- func (c *Client) EndSession(id string) (*Session, error)
- func (c *Client) FindActiveSession() (*Session, error)
- func (c *Client) FlashFirmware(sessionID, filePath string) error
- func (c *Client) GetMe() (*User, error)
- func (c *Client) GetSession(id string) (*Session, error)
- func (c *Client) ListBoards() ([]Board, error)
- func (c *Client) ListSessions() (*SessionsPage, error)
- func (c *Client) PowerCycle(sessionID string) error
- type Session
- type SessionsPage
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board struct {
ID string `json:"id"`
PodID *string `json:"pod_id,omitempty"`
BoardType string `json:"board_type"`
Device string `json:"device,omitempty"`
Label string `json:"label"`
State string `json:"state"`
Disabled bool `json:"disabled"`
SledVersion string `json:"sled_version"`
CurrentSessionID *string `json:"current_session_id,omitempty"`
CreatedAt string `json:"created_at"`
}
Board represents a siliconrig board as returned by the coordinator API.
type Client ¶
Client talks to the siliconrig coordinator API.
func (*Client) CreateSession ¶
CreateSession starts a new session for the given board type.
func (*Client) DialSerialWS ¶
DialSerialWS opens a WebSocket connection to the serial proxy for a session.
func (*Client) EndSession ¶
EndSession terminates a session by ID.
func (*Client) FindActiveSession ¶
FindActiveSession returns the first active/idle session, or an error.
func (*Client) FlashFirmware ¶
FlashFirmware uploads a firmware binary to the given session.
func (*Client) GetSession ¶
GetSession returns a single session by ID.
func (*Client) ListBoards ¶
ListBoards returns all boards (public, no auth required).
func (*Client) ListSessions ¶
func (c *Client) ListSessions() (*SessionsPage, error)
ListSessions returns the authenticated user's sessions (active + recent ended).
func (*Client) PowerCycle ¶
PowerCycle sends a power cycle command to the board in the given session.
type Session ¶
type Session struct {
ID string `json:"id"`
UserID string `json:"user_id"`
BoardID *string `json:"board_id,omitempty"`
BoardType string `json:"board_type"`
State string `json:"state"`
EndReason *string `json:"end_reason,omitempty"`
CreditsUsed int `json:"credits_used"`
StartedAt *string `json:"started_at,omitempty"`
EndedAt *string `json:"ended_at,omitempty"`
CreatedAt string `json:"created_at"`
}
Session represents a siliconrig session as returned by the coordinator API.
type SessionsPage ¶
type SessionsPage struct {
Active []Session `json:"active"`
Ended []Session `json:"ended"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
SessionsPage is the paginated response from GET /v1/sessions.
type User ¶
type User struct {
ID string `json:"id"`
Email string `json:"email"`
BalanceCredits int `json:"balance_credits"`
IsActive bool `json:"is_active"`
IsAdmin bool `json:"is_admin"`
CreatedAt string `json:"created_at"`
LastActiveAt string `json:"last_active_at"`
}
User represents the authenticated user profile.