Documentation ¶
Index ¶
- func GetEntityPropertyReferenceKey(entityPropertyReference *iottwinmaker.EntityPropertyReference, ...) (s string)
- func HandleGetTokenError(err error) error
- func LoadPolicy(workspace *iottwinmaker.GetWorkspaceOutput) (string, error)
- func NewTwinMakerMockClient(path string) (*twinMakerMockClient, error)
- func SetInfo(credentials *sts.Credentials, info models.TokenInfo) models.TokenInfo
- type IAMPolicy
- type PolicyStatement
- type PropertyReference
- type TwinMakerClient
- type TwinMakerHandler
- type TwinMakerResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEntityPropertyReferenceKey ¶ added in v1.1.1
func GetEntityPropertyReferenceKey(entityPropertyReference *iottwinmaker.EntityPropertyReference, propertyDefinitions map[string]*iottwinmaker.PropertyDefinitionResponse) (s string)
func HandleGetTokenError ¶ added in v1.3.0
func LoadPolicy ¶
func LoadPolicy(workspace *iottwinmaker.GetWorkspaceOutput) (string, error)
func NewTwinMakerMockClient ¶
NewTwinMakerMockClient provides a mock twinMakerMockClient for the session and associated calls
Types ¶
type IAMPolicy ¶
type IAMPolicy struct { Version string `json:"Version"` Statement []PolicyStatement `json:"Statement"` }
type PolicyStatement ¶
type PropertyReference ¶ added in v1.1.1
type PropertyReference struct {
// contains filtered or unexported fields
}
type TwinMakerClient ¶
type TwinMakerClient interface { GetSessionToken(ctx context.Context, duration time.Duration, workspaceId string) (*sts.Credentials, error) GetWriteSessionToken(ctx context.Context, duration time.Duration, workspaceId string) (*sts.Credentials, error) ListWorkspaces(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.ListWorkspacesOutput, error) GetWorkspace(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.GetWorkspaceOutput, error) ListScenes(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.ListScenesOutput, error) ListEntities(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.ListEntitiesOutput, error) ListComponentTypes(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.ListComponentTypesOutput, error) GetComponentType(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.GetComponentTypeOutput, error) GetEntity(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.GetEntityOutput, error) BatchPutPropertyValues(ctx context.Context, req *iottwinmaker.BatchPutPropertyValuesInput) (*iottwinmaker.BatchPutPropertyValuesOutput, error) // NOTE: only works with non-timeseries data GetPropertyValue(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.GetPropertyValueOutput, error) // NOTE: only works with timeseries data GetPropertyValueHistory(ctx context.Context, query models.TwinMakerQuery) (*iottwinmaker.GetPropertyValueHistoryOutput, error) }
TwinMakerClient calls AWS services and returns the raw results
func NewCachingClient ¶
func NewCachingClient(client TwinMakerClient, ttl time.Duration) TwinMakerClient
func NewTwinMakerClient ¶
func NewTwinMakerClient(settings models.TwinMakerDataSourceSetting) (TwinMakerClient, error)
NewTwinMakerClient provides a twinMakerClient for the session and associated calls
type TwinMakerHandler ¶
type TwinMakerHandler interface { GetSessionToken(ctx context.Context, duration time.Duration, workspaceId string) (models.TokenInfo, error) GetWriteSessionToken(ctx context.Context, duration time.Duration, workspaceId string) (models.TokenInfo, error) ListWorkspaces(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse ListScenes(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse ListEntities(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse ListComponentTypes(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse GetEntity(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse GetPropertyValue(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse // These APIs do not exist in TwinMaker, but are simple constructions GetComponentHistory(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse GetEntityHistory(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse GetAlarms(ctx context.Context, query models.TwinMakerQuery) backend.DataResponse }
TwinMakerHandler uses a client to create grafana response objects
func NewTwinMakerHandler ¶
func NewTwinMakerHandler(client TwinMakerClient) TwinMakerHandler
type TwinMakerResources ¶
type TwinMakerResources interface { // Original model GetEntity(ctx context.Context, id string) (*iottwinmaker.GetEntityOutput, error) BatchPutPropertyValues(context.Context, []*iottwinmaker.PropertyValueEntry) (*iottwinmaker.BatchPutPropertyValuesOutput, error) // Selectable values ListWorkspaces(ctx context.Context) ([]models.SelectableString, error) ListScenes(ctx context.Context) ([]models.SelectableString, error) ListOptions(ctx context.Context) (models.OptionsInfo, error) ListEntity(ctx context.Context, id string) ([]models.SelectableProps, error) }
Resource requests
func NewCachingResource ¶
func NewCachingResource(res TwinMakerResources, ttl time.Duration) TwinMakerResources
func NewTwinMakerResource ¶
func NewTwinMakerResource(client TwinMakerClient, workspaceId string) TwinMakerResources
Click to show internal directories.
Click to hide internal directories.