Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CatchupResource(ctx context.Context, resourceID string) error
- func (c *Client) GetResourceFirstTime(ctx context.Context, resourceID string) (time.Time, error)
- func (c *Client) GetResourceLastTime(ctx context.Context, resourceID string) (time.Time, error)
- func (c *Client) GetResourceReadings(ctx context.Context, resourceID string, from, to time.Time) (*ResourceReadings, error)
- func (c *Client) GetResources(ctx context.Context) ([]*Resource, error)
- type Resource
- type ResourceReading
- type ResourceReadings
Constants ¶
View Source
const ResourceReadingDuration = time.Minute * 30
View Source
const ResourceReadingMaxDuration = time.Hour * 24 * 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CatchupResource ¶
func (*Client) GetResourceFirstTime ¶
func (*Client) GetResourceLastTime ¶
func (*Client) GetResourceReadings ¶
type Resource ¶
type Resource struct {
Active bool `json:"active"`
ResourceTypeID string `json:"resourceTypeId"`
OwnerID string `json:"ownerId"`
Name string `json:"name"`
Description string `json:"description"`
Label string `json:"label"`
DataSourceResourceTypeInfo struct {
Unit string `json:"unit"`
Type string `json:"type"`
} `json:"dataSourceResourceTypeInfo"`
DataSourceType string `json:"dataSourceType"`
Classifier string `json:"classifier"`
BaseUnit string `json:"baseUnit"`
ResourceID string `json:"resourceId"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
DataSourceUnitInfo struct {
Shid string `json:"shid"`
} `json:"dataSourceUnitInfo"`
HasOwnerPermissions bool `json:"hasOwnerPermissions"`
}
type ResourceReading ¶
func (*ResourceReading) UnmarshalJSON ¶
func (r *ResourceReading) UnmarshalJSON(b []byte) error
type ResourceReadings ¶
type ResourceReadings struct {
Status string `json:"status"`
Name string `json:"name"`
ResourceTypeID string `json:"resourceTypeId"`
ResourceID string `json:"resourceId"`
Query struct {
From string `json:"from"`
To string `json:"to"`
Period string `json:"period"`
Function string `json:"function"`
} `json:"query"`
Data []ResourceReading `json:"data"`
Units string `json:"units"`
Classifier string `json:"classifier"`
}
Click to show internal directories.
Click to hide internal directories.