Documentation
¶
Index ¶
- Constants
- func Computehash(data ...[]byte) []byte
- type Backend
- func (backend *Backend) ProcessCENReport(cenReport *CENReport) (err error)
- func (backend *Backend) ProcessGetCENKeys(timestamp uint64) (cenKeys []string, err error)
- func (backend *Backend) ProcessGetCENReport(cenKey string) (reports []*CENReport, err error)
- func (backend *Backend) ProcessGetTCNReport(intervalNumber string, intervalLength string) (reportStrings []string, err error)
- func (backend *Backend) ProcessTCNReport(tcnReportString []byte, tcnRVK []byte) (err error)
- type CENReport
- type TCNReport
Constants ¶
const ( // TableCENKeys stores the mapping between CENKeys and CENReports. TableCENKeys = "CENKeys" // TableCENKeys stores the mapping between CENKeys and CENReports. TableCENReport = "CENReport" // TCNReports is the only table for TCN TableTCNReport = "TCNReport" // Default Conn String DefaultConnString = "root:CoEpi@/conn" )
Variables ¶
This section is empty.
Functions ¶
func Computehash ¶
Computehash returns the hash of its inputs
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend holds a client to connect to the BigTable backend
func NewBackend ¶
NewBackend sets up a client connection to BigTable to manage incoming payloads
func (*Backend) ProcessCENReport ¶
ProcessCENReport manages the API Endpoint to POST /cenreport
Input: CENReport Output: error Behavior: write report bytes to "report" table; write row for each CENKey with reportID
func (*Backend) ProcessGetCENKeys ¶
ProcessGetCENKeys manages the GET API endpoint /cenkeys
Input: timestamp Output: array of CENKeys (in string form) for the last hour
func (*Backend) ProcessGetCENReport ¶
ProcessGetCENReport manages the POST API endpoint /cenreport
Input: cenKey Output: array of CENReports
func (*Backend) ProcessGetTCNReport ¶
func (backend *Backend) ProcessGetTCNReport(intervalNumber string, intervalLength string) (reportStrings []string, err error)
ProcessGetTCNReport manages the GET API endpoint /v4/tcnreport
Input: intervalNumber, intervalLength Output: array of TCNReports, already encoded as base64, in a list
func (backend *Backend) ProcessGetTCNReport(intervalNumber string, intervalLength string) (reports []*TCNReport, err error)
type CENReport ¶
type CENReport struct { ReportID string `json:"reportID,omitempty"` Report []byte `json:"report,omitempty"` // this is expected to be a JSON blob but the server doesn't need to parse it CENKeys string `json:"cenKeys,omitempty"` // comma separated list of hex AES-128 Keys ReportMimeType string `json:"reportMimeType,omitempty"` ReportTimeStamp uint64 `json:"reportTimeStamp,omitempty"` }
CENReport payload is sent by client to /cenreport when user reports symptoms
func GetSampleCENReportAndCENKeys ¶
GetSampleCENReportAndCENKeys generates a CENReport and an array of CENKeys (in string form)