sas

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	HostName            string
	DeviceID            string
	SharedAccessKey     string
	SharedAccessKeyName string
	// contains filtered or unexported fields
}

Credentials contains all the required credentials to access iothub from a device's prospective.

func ParseConnectionString

func ParseConnectionString(cs string) (*Credentials, error)

ParseConnectionString parses the given string into a Credentials struct. If you use a shared access policy DeviceId is needed to be added manually.

func (*Credentials) GenerateToken

func (c *Credentials) GenerateToken(uri string, duration time.Duration) (string, error)

GenerateToken generates a SAS token for the given uri and duration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL