turingpi

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TimeOut int = 10

HostURL - Default Hashicups URL const HostURL string = "http://localhost:19090"

Variables

This section is empty.

Functions

func ApiToMode added in v0.0.4

func ApiToMode(mode int64) (string, error)

func ModeToApi added in v0.0.4

func ModeToApi(mode string) (int64, error)

Types

type Client

type Client struct {
	ApiURI     string
	HTTPClient *http.Client
}

func NewClient

func NewClient(endpoint string) (*Client, error)

func (*Client) Get added in v0.0.3

func (c *Client) Get(params string) ([]byte, error)

func (*Client) GetNodeInfo added in v0.0.2

func (c *Client) GetNodeInfo() (NodeInfo, error)

GetNodeInfo - Returns Turing Pi BMC SD card status.

func (*Client) GetPower added in v0.0.2

func (c *Client) GetPower() (Power, error)

GetPower - Returns Turing Pi BMC SD card status.

func (*Client) GetSDCard

func (c *Client) GetSDCard() (SDCard, error)

GetSDCard - Returns Turing Pi BMC SD card status.

func (*Client) GetUsb added in v0.0.2

func (c *Client) GetUsb() (Usb, error)

GetUsb - Returns Turing Pi BMC SD card status.

func (*Client) Set added in v0.0.3

func (c *Client) Set(params string) ([]byte, error)

func (*Client) SetUsb added in v0.0.3

func (c *Client) SetUsb(mode, node int64) (Result, error)

SetUsb - Returns Turing Pi BMC SD card status.

type NodeInfo added in v0.0.2

type NodeInfo struct {
	Node1 string `json:"node1"`
	Node2 string `json:"node2"`
	Node3 string `json:"node3"`
	Node4 string `json:"node4"`
}

type NodeInfoResponse added in v0.0.2

type NodeInfoResponse struct {
	Response []NodeInfo `json:"response"`
}

type Power added in v0.0.2

type Power struct {
	Node1 int64 `json:"node1"`
	Node2 int64 `json:"node2"`
	Node3 int64 `json:"node3"`
	Node4 int64 `json:"node4"`
}

type PowerResponse added in v0.0.2

type PowerResponse struct {
	Response []Power `json:"response"`
}

type Result added in v0.0.3

type Result struct {
	Result string `json:"result"`
}

type ResultError added in v0.0.3

type ResultError struct {
	Reason string
}

func (*ResultError) Error added in v0.0.3

func (m *ResultError) Error() string

type ResultResponse added in v0.0.3

type ResultResponse struct {
	Response []Result `json:"response"`
}

type SDCard

type SDCard struct {
	Total int64 `json:"total"`
	Free  int64 `json:"free"`
	Use   int64 `json:"use"`
}

type SDCardResponse

type SDCardResponse struct {
	Response []SDCard `json:"response"`
}

type Usb added in v0.0.2

type Usb struct {
	Mode int64 `json:"mode"`
	Node int64 `json:"node"`
}

type UsbResponse added in v0.0.2

type UsbResponse struct {
	Response []Usb `json:"response"`
}

Jump to

Keyboard shortcuts

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