Documentation ¶
Index ¶
- func GetK(datasourceID, timestamp uint64) ([32]byte, error)
- func GetLastPublicationTimestamp() (uint64, error)
- func GetPublication(rPoint [33]byte) (uint64, []byte, uint64, string, error)
- func GetPublicationByNameAndTimestamp(name string, timestamp uint64) (uint64, []byte, uint64, string, error)
- func GetRPoint(datasourceID, timestamp uint64) ([33]byte, error)
- func Init()
- func IsPublished(rPoint [33]byte) (bool, error)
- func Publish(rPoint [33]byte, value uint64, signature [32]byte, time uint64, name string) error
- type Key
- type Publication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetK ¶
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
func GetLastPublicationTimestamp ¶
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
func GetPublication ¶
GetPublication takes rPoint and returns value, signature, timestamp and name of publication if found
func GetPublicationByNameAndTimestamp ¶
func GetPublicationByNameAndTimestamp(name string, timestamp uint64) (uint64, []byte, uint64, string, error)
GetPublicationByNameAndTimestamp takes name and timestamp and returns value, signature, timestamp and name of publication if found
func Init ¶
func Init()
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
func IsPublished ¶
IsPublished takes in rPoint and returns true, nil if published or false, nil if unpublished
Types ¶
type Publication ¶
Publication with Value, Signature, Timestamp, and Name of publication
func GetAllPublicationsByName ¶
func GetAllPublicationsByName(name string) ([]*Publication, error)
GetAllPublicationsByName takes in a name string and returns all matching publications