package
0.0.0-20230310224206-d465f1b57d09
Repository: https://github.com/tirith-tech/dlc-oracle.git
Documentation: pkg.go.dev

# Functions

GetAllPublicationsByName takes in a name string and returns all matching publications.
GetK takes datasourceID and timestamp datasourceID and timestamp are used to create the storage key for the Keys collection Creates privKey if not found and then inserts new record in Keys collection Finally, returns privKey.
GetLastPublicationTimestamp finds most recent timestamp for all publications This function is used to gather historical data in the event an Oracle is down and rebooted and datapoints are missing.
GetPublication takes rPoint and returns value, signature, timestamp and name of publication if found.
GetPublicationByNameAndTimestamp takes name and timestamp and returns value, signature, timestamp and name of publication if found.
GetRPoint takes datasourceID and timestamp and then creates and returns rPoint.
Init initializes connection to MongoDB and makes/retreives two collections "Keys" which contains publication index keys (from timestamp and publicationID) and private keys "Publications" which contains Value, Signature, Timestamp, and Name of publication.
IsPublished takes in rPoint and returns true, nil if published or false, nil if unpublished.
Publish takes in rPoint, value, signature, time and name and returns nil if successfully published.

# Structs

Key with private key.
Publication with Value, Signature, Timestamp, and Name of publication.