xphttpbridgego

package module
v0.0.0-...-fca4201 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 5 Imported by: 1

README

XPHTTPBridge Go Client

A Go client for XPHTTPBridge.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) *Client

Creates a new client instance with the provided configuration

func (*Client) GetAllDataRefs

func (c *Client) GetAllDataRefs(fetchSize int) ([]RefInfo, error)

Fetch datarefs takkes an optional fetch size and then fetches all the available Data Refs from the server

func (*Client) GetDataRef

func (c *Client) GetDataRef(refName string) (any, error)

Fetch the value of a Data Ref

func (*Client) GetDataRefSlice

func (c *Client) GetDataRefSlice(refName string) ([]any, error)

Get multiple values (slice) from a Data Ref

func (*Client) Ping

func (c *Client) Ping() error

Ping sends a GET request to the health check endpoint and returns an error if the response is not 200 OK

func (*Client) SetDataRef

func (c *Client) SetDataRef(refName string, value any) error

Set a Data Ref value

func (*Client) SetDataRefSlice

func (c *Client) SetDataRefSlice(refName string, values []any) error

Set multiple values (slice) to a Data Ref

type Config

type Config struct {
	Port    int
	Address string
}

type GetAllRefsParams

type GetAllRefsParams struct {
	FetchSize int `url:"fetch_size"`
}

type GetAllRefsResponse

type GetAllRefsResponse struct {
	Status  int       `json:"status"`
	Message string    `json:"message"`
	Refs    []RefInfo `json:"refs"`
}

type GetRefValueParams

type GetRefValueParams struct {
	RefName string `url:"ref_name"`
}

type GetRefValueResponse

type GetRefValueResponse struct {
	Status   int    `json:"status"`
	Message  string `json:"message"`
	RefName  string `json:"ref_name"`
	RefValue any    `json:"ref_value"`
}

type GetRefValuesParams

type GetRefValuesParams struct {
	RefName string `url:"ref_name"`
}

type GetRefValuesResponse

type GetRefValuesResponse struct {
	Status    int    `json:"status"`
	Message   string `json:"message"`
	RefName   string `json:"ref_name"`
	RefValues []any  `json:"ref_values"`
}

type HealthCheckResponse

type HealthCheckResponse struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type RefInfo

type RefInfo struct {
	RefName          string `json:"ref_name"`
	RefType          string `json:"ref_type"`
	Writeable        bool   `json:"writeable"`
	ValueType        string `json:"value_type"`
	ValueDescription string `json:"value_description"`
}

type SetRefValueBody

type SetRefValueBody struct {
	RefValue any `json:"ref_value"`
}

type SetRefValueParams

type SetRefValueParams struct {
	RefName string `url:"ref_name"`
}

type SetRefValueResponse

type SetRefValueResponse struct {
	Status   int    `json:"status"`
	Message  string `json:"message"`
	RefName  string `json:"ref_name"`
	RefValue any    `json:"ref_value"`
}

type SetRefValuesBody

type SetRefValuesBody struct {
	RefValues []any `json:"ref_values"`
}

type SetRefValuesParams

type SetRefValuesParams struct {
	RefName string `url:"ref_name"`
}

type SetRefValuesResponse

type SetRefValuesResponse struct {
	Status    int    `json:"status"`
	Message   string `json:"message"`
	RefName   string `json:"ref_name"`
	RefValues []any  `json:"ref_values"`
}

Directories

Path Synopsis
examples
beacon command

Jump to

Keyboard shortcuts

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