client

package
v4.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Example (ZeroRunDecode)
data := []uint32{0, 2, 4, 2, 0, 4, 3, 0, 1}

decoded := zeroRunDecode(data)

fmt.Printf("%+v\n", decoded)
Output:

[0 0 4 2 0 0 0 0 3 0]

Index

Examples

Constants

This section is empty.

Variables

View Source
var ClientMapKeyPrefix = "client-map-"

Functions

func ClearJWTCache

func ClearJWTCache()

func GetJWTFromCache

func GetJWTFromCache(host string, user string, pass string) string

Types

type APIClient

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

func Authenticate

func Authenticate() (*APIClient, error)

Authenticates using one of several methods: - First it looks for the environment variable, if found, it uses that, but if errors out we continue... - Second it looks for the config file in pre-defined path. If found, uses that.

func AuthenticateWithAuth0Info

func AuthenticateWithAuth0Info(connectParams ConnectInfo, auth0Params Auth0Info) (*APIClient, error)

func (*APIClient) CreateROI

func (c *APIClient) CreateROI(roiItem *protos.ROIItem, isMist bool) (*protos.RegionOfInterestWriteResp, error)

func (*APIClient) DeleteImage added in v4.54.1

func (c *APIClient) DeleteImage(imageName string) error

func (*APIClient) DeleteROI added in v4.54.6

func (c *APIClient) DeleteROI(roiId string) error

func (*APIClient) GetDiffractionAsMap added in v4.54.1

func (c *APIClient) GetDiffractionAsMap(scanId string, energyCalibrationSource protos.EnergyCalibrationSource, channelStart int32, channelEnd int32) (*protos.ClientMap, error)

func (*APIClient) GetDiffractionPeaks

func (c *APIClient) GetDiffractionPeaks(scanId string, energyCalibrationSource protos.EnergyCalibrationSource) (*protos.ClientDiffractionData, error)

func (*APIClient) GetQuant

func (c *APIClient) GetQuant(quantId string, summaryOnly bool) (*protos.QuantGetResp, error)

func (*APIClient) GetQuantColumnAsMap added in v4.54.1

func (c *APIClient) GetQuantColumnAsMap(quantId string, columnName string, detector string) (*protos.ClientMap, error)

func (*APIClient) GetQuantColumns

func (c *APIClient) GetQuantColumns(quantId string) (*protos.ClientStringList, error)

func (*APIClient) GetROI

func (c *APIClient) GetROI(id string, isMist bool) (*protos.RegionOfInterestGetResp, error)

func (*APIClient) GetRoughnessAsMap added in v4.54.1

func (c *APIClient) GetRoughnessAsMap(scanId string, energyCalibrationSource protos.EnergyCalibrationSource) (*protos.ClientMap, error)

func (*APIClient) GetScanBeamLocations

func (c *APIClient) GetScanBeamLocations(scanId string) (*protos.ClientBeamLocations, error)

func (*APIClient) GetScanBulkSumCalibration

func (c *APIClient) GetScanBulkSumCalibration(scanId string) (*protos.ClientEnergyCalibration, error)

func (*APIClient) GetScanEntries

func (c *APIClient) GetScanEntries(scanId string) (*protos.ScanEntryResp, error)

func (*APIClient) GetScanEntryDataColumnAsMap added in v4.54.1

func (c *APIClient) GetScanEntryDataColumnAsMap(scanId string, columnName string) (*protos.ClientMap, error)

func (*APIClient) GetScanEntryDataColumns

func (c *APIClient) GetScanEntryDataColumns(scanId string) (*protos.ClientStringList, error)

func (*APIClient) GetScanImageBeamLocationVersions

func (c *APIClient) GetScanImageBeamLocationVersions(imageName string) (*protos.ImageBeamLocationVersionsResp, error)

func (*APIClient) GetScanImageBeamLocations

func (c *APIClient) GetScanImageBeamLocations(imageName string, scanId string, version int32) (*protos.ImageBeamLocationsResp, error)

version can be -1 to indicate we just want the latest

func (*APIClient) GetScanMetaData

func (c *APIClient) GetScanMetaData(scanId string) (*protos.ScanEntryMetadataResp, error)

func (*APIClient) GetScanMetaList

func (c *APIClient) GetScanMetaList(scanId string) (*protos.ScanMetaLabelsAndTypesResp, error)

func (*APIClient) GetScanSpectrum

func (c *APIClient) GetScanSpectrum(scanId string, pmc int32, spectrumType protos.SpectrumType, detector string) (*protos.ClientSpectrum, error)

func (*APIClient) GetScanSpectrumRangeAsMap added in v4.54.1

func (c *APIClient) GetScanSpectrumRangeAsMap(scanId string, channelStart int32, channelEnd int32, detector string) (*protos.ClientMap, error)

Adds up all channels from channelStart, to channel at index channelEnd-1 Therefore if you request just one channel, you would have to set it to channelStart=10, channelEnd=11 NOTE: channelStart can be -1, which will just make it start from 0 channelEnd can be -1, which will be interpreted as all channels

func (*APIClient) GetTag added in v4.54.3

func (c *APIClient) GetTag(tagId string) (*protos.Tag, error)

func (*APIClient) GetTagByName added in v4.54.6

func (c *APIClient) GetTagByName(tagName string) (*protos.ClientTagList, error)

func (*APIClient) ListScanImages

func (c *APIClient) ListScanImages(scanIds []string, mustIncludeAll bool) (*protos.ImageListResp, error)

func (*APIClient) ListScanQuants

func (c *APIClient) ListScanQuants(scanId string) (*protos.QuantListResp, error)

func (*APIClient) ListScanROIs

func (c *APIClient) ListScanROIs(scanId string) (*protos.RegionOfInterestListResp, error)

func (*APIClient) ListScans

func (c *APIClient) ListScans(scanId string) (*protos.ScanListResp, error)

func (*APIClient) LoadMapData added in v4.54.1

func (c *APIClient) LoadMapData(key string) (*protos.ClientMap, error)

func (*APIClient) SaveMapData added in v4.54.1

func (c *APIClient) SaveMapData(key string, data *protos.ClientMap) error

func (*APIClient) SetUserScanCalibration

func (c *APIClient) SetUserScanCalibration(scanId string, detector string, starteV float32, perChanneleV float32) (*protos.ClientEnergyCalibration, error)

func (*APIClient) UploadImage added in v4.54.1

func (c *APIClient) UploadImage(imageUpload *protos.ImageUploadHttpRequest) error

func (*APIClient) UploadImageBeamLocations added in v4.54.5

func (c *APIClient) UploadImageBeamLocations(imageName string, locForScan *protos.ImageLocationsForScan) error

type Auth0Info

type Auth0Info struct {
	ClientId string `json:"auth0_client"`
	Domain   string `json:"auth0_domain"`
	Audience string `json:"auth0_audience"`
}

type ClientConfig

type ClientConfig struct {
	Host        string
	User        string
	Password    string
	LocalConfig *PIXLISEConfig
}

type ConnectInfo

type ConnectInfo struct {
	Host string
	User string
	Pass string
}

type PIXLISEConfig

type PIXLISEConfig struct {
	Auth0Domain   string `json:"auth0_domain"`
	Auth0Client   string `json:"auth0_client"`
	Auth0Audience string `json:"auth0_audience"`
	ApiUrl        string `json:"apiUrl"`
}

type SocketConn

type SocketConn struct {
	Host         string
	HostProtocol string
	JWT          string
	UserId       string
	// contains filtered or unexported fields
}

func (*SocketConn) Connect

func (s *SocketConn) Connect(connectParams ConnectInfo, auth0Params Auth0Info) error

Inspired by: https://tradermade.com/tutorials/golang-websocket-client

func (*SocketConn) Disconnect

func (s *SocketConn) Disconnect() error

func (*SocketConn) GetHost added in v4.54.1

func (s *SocketConn) GetHost(path string) (*url.URL, error)

func (*SocketConn) SendMessage

func (s *SocketConn) SendMessage(msg *protos.WSMessage) error

func (*SocketConn) WaitForMessages

func (s *SocketConn) WaitForMessages(msgCount int, timeout time.Duration) []*protos.WSMessage

Parameters define stop conditions, either how many messages or how much time to wait

Directories

Path Synopsis
internal
cmdline command

Jump to

Keyboard shortcuts

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