bastec

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BastecClient

type BastecClient struct {
	RequestURL url.URL

	DisallowedPrefixes []string
	// contains filtered or unexported fields
}

func Connect

func Connect(url url.URL) (bastecClient *BastecClient, err error)

func (*BastecClient) Browse

func (bastecClient *BastecClient) Browse() (valueResponse *BrowseResponse, err error)

func (*BastecClient) GetValues

func (bastecClient *BastecClient) GetValues(values []string) (response *ValuesResponse, err error)

func (*BastecClient) GetVersion

func (bastecClient *BastecClient) GetVersion() (response []byte, err error)

type BrowseResponse

type BrowseResponse struct {
	JsonRpc string `json:"json-rpc"`
	Result  struct {
		DevId  string        `json:"devid"`
		Points []PointConfig `json:"points"`
	} `json:"result"`
	Error string `json:"error"`
	Id    int    `json:"id"`
}

type JsonRpcRequest

type JsonRpcRequest struct {
	JsonRpcVersion string     `json:"json-rpc"`
	Method         string     `json:"method"`
	Params         [][]string `json:"params,omitempty"`
	Id             int        `json:"id"`
}

type Point

type Point struct {
	Pid           string  `json:"pid"`
	Value         float64 `json:"value"`
	Decimals      int     `json:"decimals"`
	DecimalsShown int     `json:"decimals_shown"`
}

type PointConfig

type PointConfig struct {
	Pid  string `json:"pid"`
	Desc string `json:"desc"`
	Acc  string `json:"acc"`
	Type string `json:"type"`
	Attr string `json:"attr,omitempty"`
}

type Salts

type Salts struct {
	SaltA []byte `json:"salt_a"`
	SaltB []byte `json:"salt_b"`
}

type Session

type Session struct {
	Name    string `json:"name"`
	UserId  string `json:"userid"`
	Company string `json:"company"`
	City    string `json:"city"`
}

type ValuesResponse

type ValuesResponse struct {
	JsonRpc string `json:"json-rpc"`
	Result  struct {
		Timet  int64   `json:"timet"`
		Times  string  `json:"times"`
		Points []Point `json:"points"`
	} `json:"result"`
	Error string `json:"error"`
	Id    int    `json:"id"`
}

Jump to

Keyboard shortcuts

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