Versions in this module Expand all Collapse all v0 v0.1.0 Oct 11, 2026 Changes in this version + const BoundaryInside + const BoundaryInterpolated + const BoundaryOutside + const BufferBuffer + const BufferBufferIfPossible + const BufferDoNotBuffer + const CalculationEventWeighted + const CalculationTimeWeighted + const MarkerAssetDatabase + const MarkerAssetServer + const MarkerAttribute + const MarkerDataServer + const MarkerElement + const MarkerEnumeration + const MarkerEventFrame + const MarkerPoint + const OwnerElement + const OwnerEventFrame + const RetrieveAfter + const RetrieveAtOrAfter + const RetrieveAtOrBefore + const RetrieveAuto + const RetrieveBefore + const RetrieveExact + const SearchBackwardFromEndTime + const SearchBackwardFromStartTime + const SearchBackwardInProgress + const SearchEndInclusive + const SearchForwardFromEndTime + const SearchForwardFromStartTime + const SearchForwardInProgress + const SearchInclusive + const SearchOverlapped + const SearchStartInclusive + const SummaryAll + const SummaryAllForNonNumeric + const SummaryAverage + const SummaryCount + const SummaryMaximum + const SummaryMinimum + const SummaryPercentGood + const SummaryPopulationStdDev + const SummaryRange + const SummaryStdDev + const SummaryTotal + const SummaryTotalWithUOM + const Tick + const UpdateInsert + const UpdateInsertNoCompression + const UpdateNoReplace + const UpdateRemove + const UpdateReplace + const UpdateReplaceOnly + const WebIDDefaultIDOnly + const WebIDFull + const WebIDIDOnly + const WebIDLocalIDOnly + const WebIDPathOnly + var ErrAuth = errors.New("the PI Web API refused the login") + var ErrWebID = errors.New("piwebapi: not a WebID 2.0") + func AttributeWebID(path string) string + func IsNotFound(err error) bool + func PathWebID(marker, owner, path string) string + func PointWebID(path string) string + func Time(t time.Time) string + type AssetDatabase struct + Description string + ID string + Name string + Path string + WebID string + type AssetServer struct + Description string + ID string + IsConnected bool + Name string + Path string + ServerVersion string + WebID string + type AtTimesOptions struct + FilterExpression string + IncludeFilteredValues bool + RetrievalMode string + SortOrder string + type Attribute struct + CategoryNames []string + ConfigString string + DataReferencePlugIn string + DefaultUnitsName string + Description string + HasChildren bool + ID string + IsConfigurationItem bool + IsExcluded bool + IsHidden bool + IsManualDataEntry bool + Name string + Path string + Step bool + Type string + TypeQualifier string + WebID string + type AttributeQuery struct + CategoryName string + NameFilter string + SearchFullHierarchy bool + ShowExcluded bool + ShowHidden bool + TemplateName string + ValueType string + type AuthError struct + Message string + NTLM bool + Offered []string + Status int + func (e *AuthError) Error() string + func (e *AuthError) Is(target error) bool + type Authorizer interface + Authorize func(ctx context.Context, r *http.Request) error + type Basic struct + Password string + User string + func (b Basic) Authorize(_ context.Context, r *http.Request) error + type BatchRequest struct + Content string + Headers map[string]string + Method string + Parameters []string + ParentIDs []string + RequestTemplate *BatchTemplate + Resource string + type BatchResponse struct + Content json.RawMessage + Headers map[string]string + Status int + func (r BatchResponse) Decode(out any) error + func (r BatchResponse) Err() error + func (r BatchResponse) Items() ([]BatchResponse, error) + func (r BatchResponse) OK() bool + type BatchTemplate struct + Resource string + type Bearer string + func (b Bearer) Authorize(_ context.Context, r *http.Request) error + type Client struct + Auth Authorizer + Base string + HTTP *http.Client + RequestedWith string + func New(base string, hc *http.Client, auth Authorizer) *Client + func (c *Client) AssetDatabase(ctx context.Context, webID string) (AssetDatabase, error) + func (c *Client) AssetDatabaseByPath(ctx context.Context, path string) (AssetDatabase, error) + func (c *Client) AssetDatabases(ctx context.Context, serverWebID string) ([]AssetDatabase, error) + func (c *Client) AssetServer(ctx context.Context, webID string) (AssetServer, error) + func (c *Client) AssetServerByName(ctx context.Context, name string) (AssetServer, error) + func (c *Client) AssetServerByPath(ctx context.Context, path string) (AssetServer, error) + func (c *Client) AssetServers(ctx context.Context) ([]AssetServer, error) + func (c *Client) Attribute(ctx context.Context, webID string) (Attribute, error) + func (c *Client) AttributeByPath(ctx context.Context, path string) (Attribute, error) + func (c *Client) AttributeValue(ctx context.Context, webID string) (Value, error) + func (c *Client) Attributes(ctx context.Context, elementWebID string, o AttributeQuery) ([]Attribute, error) + func (c *Client) AttributesByPath(ctx context.Context, paths []string) ([]Found[Attribute], error) + func (c *Client) Batch(ctx context.Context, reqs map[string]BatchRequest) (map[string]BatchResponse, error) + func (c *Client) BatchGet(path string, q url.Values, parents ...string) BatchRequest + func (c *Client) BatchPost(path string, q url.Values, body any, parents ...string) (BatchRequest, error) + func (c *Client) ChildAttributes(ctx context.Context, attributeWebID string, o AttributeQuery) ([]Attribute, error) + func (c *Client) ChildElements(ctx context.Context, elementWebID string, o ElementQuery) ([]Element, error) + func (c *Client) ChildEventFrames(ctx context.Context, eventFrameWebID string, o EventFrameQuery) ([]EventFrame, error) + func (c *Client) DataServer(ctx context.Context, webID string) (DataServer, error) + func (c *Client) DataServerByName(ctx context.Context, name string) (DataServer, error) + func (c *Client) DataServerByPath(ctx context.Context, path string) (DataServer, error) + func (c *Client) DataServers(ctx context.Context) ([]DataServer, error) + func (c *Client) Do(ctx context.Context, method, path string, q url.Values, body, out any) error + func (c *Client) Element(ctx context.Context, webID string) (Element, error) + func (c *Client) ElementByPath(ctx context.Context, path string) (Element, error) + func (c *Client) ElementEventFrames(ctx context.Context, elementWebID string, o EventFrameQuery) ([]EventFrame, error) + func (c *Client) Elements(ctx context.Context, databaseWebID string, o ElementQuery) ([]Element, error) + func (c *Client) ElementsByPath(ctx context.Context, paths []string) ([]Found[Element], error) + func (c *Client) End(ctx context.Context, webID string, o Common) (Value, error) + func (c *Client) EventFrame(ctx context.Context, webID string) (EventFrame, error) + func (c *Client) EventFrameAttributes(ctx context.Context, eventFrameWebID string, o AttributeQuery) ([]Attribute, error) + func (c *Client) EventFrameByPath(ctx context.Context, path string) (EventFrame, error) + func (c *Client) EventFrames(ctx context.Context, databaseWebID string, o EventFrameQuery) ([]EventFrame, error) + func (c *Client) Get(ctx context.Context, path string, q url.Values, out any) error + func (c *Client) Interpolated(ctx context.Context, webID string, start, end time.Time, ...) (Values, error) + func (c *Client) InterpolatedAtTimes(ctx context.Context, webID string, times []string, o AtTimesOptions) (Values, error) + func (c *Client) InterpolatedWith(ctx context.Context, webID string, o InterpolatedOptions) (Values, error) + func (c *Client) Plot(ctx context.Context, webID string, o PlotOptions) (Values, error) + func (c *Client) Point(ctx context.Context, webID string) (Point, error) + func (c *Client) PointAttributes(ctx context.Context, webID, nameFilter string) ([]PointAttribute, error) + func (c *Client) PointByPath(ctx context.Context, path string) (Point, error) + func (c *Client) PointPages(ctx context.Context, dataServer, nameFilter string, page int, ...) error + func (c *Client) Points(ctx context.Context, dataServer, nameFilter string, startIndex, maxCount int) ([]Point, error) + func (c *Client) PointsByPath(ctx context.Context, paths []string) ([]Found[Point], error) + func (c *Client) Recorded(ctx context.Context, webID string, start, end time.Time, maxCount int) (Values, error) + func (c *Client) RecordedAtTime(ctx context.Context, webID, time, mode string, o Common) (Value, error) + func (c *Client) RecordedAtTimes(ctx context.Context, webID string, times []string, o AtTimesOptions) (Values, error) + func (c *Client) RecordedPages(ctx context.Context, webID string, start, end time.Time, page int, ...) error + func (c *Client) RecordedWith(ctx context.Context, webID string, o RecordedOptions) (Values, error) + func (c *Client) RegisterStreamSetUpdates(ctx context.Context, webIDs []string) ([]StreamUpdates, error) + func (c *Client) RegisterUpdates(ctx context.Context, webID string) (StreamUpdates, error) + func (c *Client) SetAttributeValue(ctx context.Context, webID string, v TimedValue) error + func (c *Client) Status(ctx context.Context) (SystemStatus, error) + func (c *Client) StreamSetEnd(ctx context.Context, s Streams, o Common) ([]StreamValue, error) + func (c *Client) StreamSetInterpolated(ctx context.Context, s Streams, o InterpolatedOptions) ([]StreamValues, error) + func (c *Client) StreamSetInterpolatedAtTimes(ctx context.Context, s Streams, times []string, o AtTimesOptions) ([]StreamValues, error) + func (c *Client) StreamSetPlot(ctx context.Context, s Streams, o PlotOptions) ([]StreamValues, error) + func (c *Client) StreamSetRecorded(ctx context.Context, s Streams, o RecordedOptions) ([]StreamValues, error) + func (c *Client) StreamSetRecordedAtTime(ctx context.Context, s Streams, time, mode string, o Common) ([]StreamValue, error) + func (c *Client) StreamSetRecordedAtTimes(ctx context.Context, s Streams, times []string, o AtTimesOptions) ([]StreamValues, error) + func (c *Client) StreamSetSummary(ctx context.Context, s Streams, o SummaryOptions) ([]StreamSummaries, error) + func (c *Client) StreamSetUpdateValue(ctx context.Context, vs []StreamUpdate, o UpdateOptions) error + func (c *Client) StreamSetUpdateValues(ctx context.Context, vs []StreamValuesUpdate, o UpdateOptions) error + func (c *Client) StreamSetUpdates(ctx context.Context, markers []string, o Common) ([]StreamUpdates, error) + func (c *Client) StreamSetValue(ctx context.Context, s Streams, o ValueOptions) ([]StreamValue, error) + func (c *Client) Summary(ctx context.Context, webID string, o SummaryOptions) ([]Summary, error) + func (c *Client) System(ctx context.Context) (System, error) + func (c *Client) URL(path string, q url.Values) string + func (c *Client) UpdateValue(ctx context.Context, webID string, v TimedValue, o UpdateOptions) error + func (c *Client) UpdateValues(ctx context.Context, webID string, vs []TimedValue, o UpdateOptions) error + func (c *Client) Updates(ctx context.Context, marker string, o Common) (StreamUpdates, error) + func (c *Client) UserInfo(ctx context.Context) (UserInfo, error) + func (c *Client) Value(ctx context.Context, webID string, o ValueOptions) (Value, error) + func (c *Client) Versions(ctx context.Context) (map[string]any, error) + type Common struct + DesiredUnits string + Extra url.Values + SelectedFields string + TimeZone string + WebIDType string + type DataServer struct + ID string + IsConnected bool + Name string + Path string + ServerVersion string + WebID string + type DigitalState struct + IsSystem bool + Name string + Value int + type Element struct + CategoryNames []string + Description string + HasChildren bool + ID string + Name string + Path string + TemplateName string + WebID string + type ElementQuery struct + CategoryName string + DescriptionFilter string + ElementType string + NameFilter string + SearchFullHierarchy bool + TemplateName string + type Error struct + Message string + Path string + RetryAfter time.Duration + Status int + func (e *Error) Error() string + func (e *Error) Temporary() bool + type EventFrame struct + AreValuesCaptured bool + CanBeAcknowledged bool + CategoryNames []string + Description string + EndTime time.Time + HasChildren bool + ID string + IsAcknowledged bool + IsAnnotated bool + IsLocked bool + Name string + Path string + RefElementWebIDs []string + Severity string + StartTime time.Time + TemplateName string + WebID string + func (e EventFrame) InProgress() bool + type EventFrameQuery struct + CanBeAcknowledged *bool + CategoryName string + EndTime string + IsAcknowledged *bool + NameFilter string + ReferencedElementNameFilter string + ReferencedElementTemplate string + SearchFullHierarchy bool + SearchMode string + Severity []string + StartTime string + TemplateName string + type Found struct + Err error + Identifier string + IdentifierType string + Object T + type InterpolatedOptions struct + EndTime string + FilterExpression string + IncludeFilteredValues bool + Interval string + StartTime string + SyncTime string + SyncTimeBoundaryType string + type ItemError struct + Index int + Message string + Status int + Sub int + WebID string + type Paging struct + MaxCount int + SortField string + SortOrder string + StartIndex int + type PartialError struct + Items []ItemError + func (e *PartialError) Error() string + type PlotOptions struct + EndTime string + Intervals int + StartTime string + type Point struct + Desc string + DigitalSetName string + Future bool + ID int64 + Name string + Path string + PointClass string + Step bool + Type string + Units string + WebID string + type PointAttribute struct + Name string + Value any + type RecordedOptions struct + BoundaryType string + EndTime string + FilterExpression string + IncludeFilteredValues bool + MaxCount int + StartTime string + type StreamSummaries struct + Exception *webException + Items []Summary + Name string + Path string + WebID string + func (s StreamSummaries) Err() error + type StreamUpdate struct + Value TimedValue + WebID string + type StreamUpdates struct + Events []UpdateEvent + Exception *webException + Marker string + RequestedMarker string + Source string + SourceName string + SourcePath string + Status string + func (u StreamUpdates) Err() error + type StreamValue struct + Exception *webException + Name string + Path string + Units string + Value Value + WebID string + func (s StreamValue) Err() error + type StreamValues struct + Exception *webException + Items []Value + Name string + Path string + Units string + WebID string + func (s StreamValues) Err() error + type StreamValuesUpdate struct + Items []TimedValue + WebID string + type Streams struct + CategoryName string + NameFilter string + Of string + SearchFullHierarchy bool + ShowExcluded bool + ShowHidden bool + SortField string + SortOrder string + TemplateName string + WebIDs []string + type Summary struct + Type string + Value Value + type SummaryOptions struct + CalculationBasis string + EndTime string + FilterExpression string + SampleInterval string + SampleType string + StartTime string + SummaryDuration string + SummaryTypes []string + TimeType string + type System struct + ProductTitle string + ProductVersion string + type SystemStatus struct + CacheInstances int + ServerTime string + State string + UpTimeInMinutes float64 + type TimedValue struct + Good *bool + Questionable *bool + Timestamp string + Units string + Value any + type UpdateEvent struct + Action string + type UpdateOptions struct + BufferOption string + UpdateOption string + type UserInfo struct + IdentityType string + ImpersonationLevel string + IsAuthenticated bool + Name string + SID string + type Value struct + Annotated bool + Errors []string + Good *bool + Questionable bool + Substituted bool + Timestamp time.Time + Units string + Value json.RawMessage + func (v Value) Decode() (any, string) + func (v Value) Float() (float64, bool) + func (v Value) IsGood() bool + func (v Value) State() (DigitalState, bool) + type ValueOptions struct + Time string + type Values struct + Items []Value + Units string + type WebIDInfo struct + Marker string + Owner string + Path string + Type byte + Version int + func ParseWebID(id string) (WebIDInfo, error)