simpledali.util
Module Contents
Functions
Convert a datatime.datetime to a datalink hptime |
|
Convert a datalink hptime to a datatime.datetime |
|
Create a datetime to the current time with the timezone set to utc. |
|
A ISO8601 string for the given datatime, but with the timezone set to Z instead of +00:00 |
|
Convert an hptime into an ISO8601 string with Z timezone |
|
Note token auth is not part of ringserver proper, uses a fork I created. |
|
Note token auth is not part of ringserver proper, uses a fork I created. |
|
Note token auth is not part of ringserver proper, uses a fork I created. |
Data
API
- simpledali.util.MICROS = 1000000
- simpledali.util.datetimeToHPTime(time)
Convert a datatime.datetime to a datalink hptime
- simpledali.util.hptimeToDatetime(hptime)
Convert a datalink hptime to a datatime.datetime
- simpledali.util.utcnowWithTz()
Create a datetime to the current time with the timezone set to utc.
- simpledali.util.isowithz(dt)
A ISO8601 string for the given datatime, but with the timezone set to Z instead of +00:00
- simpledali.util.hptimeAsIso(hptime)
Convert an hptime into an ISO8601 string with Z timezone
- simpledali.util.optional_date(date_str)
- simpledali.util.INFO_VERSION = 'Version'
- simpledali.util.INFO_SERVERID = 'ServerID'
- simpledali.util.INFO_CAPABILITIES = 'Capabilities'
- simpledali.util.INFO_STATUS = 'Status'
- simpledali.util.INFO_STREAMLIST = 'StreamList'
- simpledali.util.INFO_STREAM = 'Stream'
- simpledali.util.prettyPrintInfo(info)
- simpledali.util.encodeAuthToken(user_id, expireDelta, writePattern, secretKey)
Note token auth is not part of ringserver proper, uses a fork I created.
Generates a ringserver Auth Token user_id: user name expireDelta: lifetime of token, ex timedelta(days=1, seconds=60) writePattern: streamid reg exp, ex ‘XX_.*/MTRIG’ secretKey: encryption pass phrase, should be > 32, longer is ok :return: string, base64 encoded signed jwt token
- simpledali.util.decodeAuthToken(encodedToken, secretKey)
Note token auth is not part of ringserver proper, uses a fork I created.
- simpledali.util.timeUntilExpireToken(token)
Note token auth is not part of ringserver proper, uses a fork I created.