Documentation
¶
Index ¶
- Variables
- type ConnectionString
- func (cs ConnectionString) Authorization(expireAt time.Time) string
- func (cs ConnectionString) IsZero() bool
- func (cs ConnectionString) MarshalText() ([]byte, error)
- func (cs ConnectionString) String() string
- func (cs *ConnectionString) UnmarshalText(b []byte) error
- func (cs ConnectionString) Validate() error
- type Settings
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConnectionStringTooLong = errors.New(
"connection string can be no longer than 4096 characters",
)
)
Functions ¶
This section is empty.
Types ¶
type ConnectionString ¶
type ConnectionString struct { HostName string `cs:"HostName" bson:"hostname"` GatewayHostName string `cs:"GatewayHostName" bson:"gateway_hostname,omitempty"` Name string `cs:"SharedAccessKeyName" bson:"name,omitempty"` DeviceID string `cs:"DeviceId" bson:"device_id,omitempty"` ModuleID string `cs:"ModuleId" bson:"module_id,omitempty"` Key []byte `cs:"SharedAccessKey" bson:"access_key"` Signature string `cs:"SharedAccessSignature" bson:"-"` }
ConnectionString implements the Azure connection string format and the SharedAccessSignature authz algorithm. The implementation is based on the official python SDK. https://github.com/Azure/azure-iot-sdk-python
func ParseConnectionString ¶
func ParseConnectionString(connection string) (*ConnectionString, error)
func (ConnectionString) Authorization ¶
func (cs ConnectionString) Authorization(expireAt time.Time) string
func (ConnectionString) IsZero ¶
func (cs ConnectionString) IsZero() bool
func (ConnectionString) MarshalText ¶
func (cs ConnectionString) MarshalText() ([]byte, error)
func (ConnectionString) String ¶
func (cs ConnectionString) String() string
func (*ConnectionString) UnmarshalText ¶
func (cs *ConnectionString) UnmarshalText(b []byte) error
func (ConnectionString) Validate ¶
func (cs ConnectionString) Validate() error
Click to show internal directories.
Click to hide internal directories.