Documentation ¶
Index ¶
- func ClearModels(endpoint string, method *AuthenticationMethod) error
- func DownloadModels(endpoint string, method *AuthenticationMethod, output ModelDirectory, ...) error
- func ListModels(endpoint string, method *AuthenticationMethod) error
- func UploadModels(endpoint string, method *AuthenticationMethod, source ModelDirectory) error
- type AuthenticationMethod
- type ModelDirectory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearModels ¶
func ClearModels(endpoint string, method *AuthenticationMethod) error
ClearModels will remove all models which have been created against the Azure Digital Twin endpoint using the authentication method provided
func DownloadModels ¶
func DownloadModels(endpoint string, method *AuthenticationMethod, output ModelDirectory, fileExtension string) error
DownloadModels reads all models from the Digital Twin instance into the output location using the fileExtension specified.
The download structure will be based on the model name structure broken apart by the colon and the semicolon, and so a model id of "dtmi:rec33:architectural:building;1" will become the following path "dtmi/rec33/architectural/building_1.dtdl" (assuming a file extension of 'dtdl')
func ListModels ¶
func ListModels(endpoint string, method *AuthenticationMethod) error
ListModels retrieves all models which have been created against the Azure Digital Twin endpoint using the authentication method provided
func UploadModels ¶
func UploadModels(endpoint string, method *AuthenticationMethod, source ModelDirectory) error
UploadModels will read all model files (.json and .dtdl files) in a given path recursively, and then attempt to upload them to the Azure Digital Twin instance
Types ¶
type AuthenticationMethod ¶
type AuthenticationMethod struct { UseAzureCli bool // Indicates if the Azure CLI credential should be used TenantId string // When using client credentials, specifies the Azure tenant to authenticate against ClientId string // The id of the client used for client credential authentication ClientSecret string // The secret of the client used for client credential authentication }
AuthenticationMethod defined how the application will authenticate with an Azure Digital Twin instance
type ModelDirectory ¶
type ModelDirectory struct {
Path string
}
ModelDirectory defines a location on disk where models may be uploaded from
func (*ModelDirectory) Set ¶
func (directory *ModelDirectory) Set(path string) error
Set creates a new instance of the ModelDirectory type
func (*ModelDirectory) String ¶
func (directory *ModelDirectory) String() string
String returns the string representation of the object