Documentation ¶
Index ¶
- Variables
- func PublishKeysToKeyServer(ctx context.Context, haid string, maxBatchSize int, ...) error
- type Database
- type DiagnosisKey
- func (*DiagnosisKey) Descriptor() ([]byte, []int)deprecated
- func (x *DiagnosisKey) GetDaysSinceOnsetOfSymptoms() int32
- func (x *DiagnosisKey) GetKeyData() []byte
- func (x *DiagnosisKey) GetOrigin() string
- func (x *DiagnosisKey) GetReportType() ReportType
- func (x *DiagnosisKey) GetRollingPeriod() uint32
- func (x *DiagnosisKey) GetRollingStartIntervalNumber() uint32
- func (x *DiagnosisKey) GetTransmissionRiskLevel() int32
- func (x *DiagnosisKey) GetVisitedCountries() []string
- func (*DiagnosisKey) ProtoMessage()
- func (x *DiagnosisKey) ProtoReflect() protoreflect.Message
- func (x *DiagnosisKey) Reset()
- func (x *DiagnosisKey) String() string
- type DiagnosisKeyBatch
- func (*DiagnosisKeyBatch) Descriptor() ([]byte, []int)deprecated
- func (x *DiagnosisKeyBatch) GetKeys() []*DiagnosisKey
- func (*DiagnosisKeyBatch) ProtoMessage()
- func (x *DiagnosisKeyBatch) ProtoReflect() protoreflect.Message
- func (x *DiagnosisKeyBatch) Reset()
- func (x *DiagnosisKeyBatch) String() string
- type DiagnosisKeyWrapper
- type ReportType
Constants ¶
This section is empty.
Variables ¶
var ( ReportType_name = map[int32]string{ 0: "UNKNOWN", 1: "CONFIRMED_TEST", 2: "CONFIRMED_CLINICAL_DIAGNOSIS", 3: "SELF_REPORT", 4: "RECURSIVE", 5: "REVOKED", } ReportType_value = map[string]int32{ "UNKNOWN": 0, "CONFIRMED_TEST": 1, "CONFIRMED_CLINICAL_DIAGNOSIS": 2, "SELF_REPORT": 3, "RECURSIVE": 4, "REVOKED": 5, } )
Enum value maps for ReportType.
var File_efgs_proto protoreflect.FileDescriptor
Functions ¶
func PublishKeysToKeyServer ¶
func PublishKeysToKeyServer(ctx context.Context, haid string, maxBatchSize int, keys []keyserverapi.ExposureKey) error
PublishKeysToKeyServer Publish exposure keys to Keys server.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database Contains database connection pool.
func (Database) GetDiagnosisKeys ¶
func (db Database) GetDiagnosisKeys(date string) ([]*DiagnosisKeyWrapper, error)
GetDiagnosisKeys Get keys from database that are not yet in EFGS and are older than date in parameter.
func (Database) PersistDiagnosisKeys ¶
func (db Database) PersistDiagnosisKeys(keys []*DiagnosisKey) error
PersistDiagnosisKeys Save array of DiagnosisKey to database
func (Database) RemoveDiagnosisKey ¶
func (db Database) RemoveDiagnosisKey(keys []*DiagnosisKeyWrapper) error
RemoveDiagnosisKey Remove array of DiagnosisKeyWrapper from database.
type DiagnosisKey ¶
type DiagnosisKey struct { KeyData []byte `protobuf:"bytes,1,opt,name=keyData,proto3" json:"keyData,omitempty"` // key RollingStartIntervalNumber uint32 `protobuf:"varint,2,opt,name=rollingStartIntervalNumber,proto3" json:"rollingStartIntervalNumber,omitempty"` RollingPeriod uint32 `protobuf:"varint,3,opt,name=rollingPeriod,proto3" json:"rollingPeriod,omitempty"` // number of 10-minute windows between key-rolling TransmissionRiskLevel int32 `protobuf:"varint,4,opt,name=transmissionRiskLevel,proto3" json:"transmissionRiskLevel,omitempty"` // risk of transmission VisitedCountries []string `protobuf:"bytes,5,rep,name=visitedCountries,proto3" json:"visitedCountries,omitempty"` Origin string `protobuf:"bytes,6,opt,name=origin,proto3" json:"origin,omitempty"` // country of origin ReportType ReportType `protobuf:"varint,7,opt,name=reportType,proto3,enum=ReportType" json:"reportType,omitempty"` // set by backend DaysSinceOnsetOfSymptoms int32 `` /* 142-byte string literal not displayed */ // contains filtered or unexported fields }
func (*DiagnosisKey) Descriptor
deprecated
func (*DiagnosisKey) Descriptor() ([]byte, []int)
Deprecated: Use DiagnosisKey.ProtoReflect.Descriptor instead.
func (*DiagnosisKey) GetDaysSinceOnsetOfSymptoms ¶
func (x *DiagnosisKey) GetDaysSinceOnsetOfSymptoms() int32
func (*DiagnosisKey) GetKeyData ¶
func (x *DiagnosisKey) GetKeyData() []byte
func (*DiagnosisKey) GetOrigin ¶
func (x *DiagnosisKey) GetOrigin() string
func (*DiagnosisKey) GetReportType ¶
func (x *DiagnosisKey) GetReportType() ReportType
func (*DiagnosisKey) GetRollingPeriod ¶
func (x *DiagnosisKey) GetRollingPeriod() uint32
func (*DiagnosisKey) GetRollingStartIntervalNumber ¶
func (x *DiagnosisKey) GetRollingStartIntervalNumber() uint32
func (*DiagnosisKey) GetTransmissionRiskLevel ¶
func (x *DiagnosisKey) GetTransmissionRiskLevel() int32
func (*DiagnosisKey) GetVisitedCountries ¶
func (x *DiagnosisKey) GetVisitedCountries() []string
func (*DiagnosisKey) ProtoMessage ¶
func (*DiagnosisKey) ProtoMessage()
func (*DiagnosisKey) ProtoReflect ¶
func (x *DiagnosisKey) ProtoReflect() protoreflect.Message
func (*DiagnosisKey) Reset ¶
func (x *DiagnosisKey) Reset()
func (*DiagnosisKey) String ¶
func (x *DiagnosisKey) String() string
type DiagnosisKeyBatch ¶
type DiagnosisKeyBatch struct { Keys []*DiagnosisKey `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` // contains filtered or unexported fields }
func (*DiagnosisKeyBatch) Descriptor
deprecated
func (*DiagnosisKeyBatch) Descriptor() ([]byte, []int)
Deprecated: Use DiagnosisKeyBatch.ProtoReflect.Descriptor instead.
func (*DiagnosisKeyBatch) GetKeys ¶
func (x *DiagnosisKeyBatch) GetKeys() []*DiagnosisKey
func (*DiagnosisKeyBatch) ProtoMessage ¶
func (*DiagnosisKeyBatch) ProtoMessage()
func (*DiagnosisKeyBatch) ProtoReflect ¶
func (x *DiagnosisKeyBatch) ProtoReflect() protoreflect.Message
func (*DiagnosisKeyBatch) Reset ¶
func (x *DiagnosisKeyBatch) Reset()
func (*DiagnosisKeyBatch) String ¶
func (x *DiagnosisKeyBatch) String() string
type DiagnosisKeyWrapper ¶
type DiagnosisKeyWrapper struct { ID int32 `pg:",pk" json:"id"` CreatedAt time.Time `pg:"default:now()" json:"created_at"` KeyData []byte `json:"keyData,omitempty"` RollingStartIntervalNumber uint32 `json:"rollingStartIntervalNumber,omitempty"` RollingPeriod uint32 `json:"rollingPeriod,omitempty"` TransmissionRiskLevel int32 `json:"transmissionRiskLevel,omitempty"` VisitedCountries []string `json:"visitedCountries,omitempty"` Origin string `pg:"default:'CZ'" json:"origin,omitempty"` ReportType string `json:"reportType,omitempty"` DaysSinceOnsetOfSymptoms int32 `json:"days_since_onset_of_symptoms,omitempty"` // contains filtered or unexported fields }
DiagnosisKeyWrapper map json response from EFGS to local DiagnosisKey structure
func (*DiagnosisKeyWrapper) ToData ¶
func (wrappedKey *DiagnosisKeyWrapper) ToData() *DiagnosisKey
ToData convert struct from DiagnosisKeyWrapper to DiagnosisKey
type ReportType ¶
type ReportType int32
const ( ReportType_UNKNOWN ReportType = 0 ReportType_CONFIRMED_TEST ReportType = 1 ReportType_CONFIRMED_CLINICAL_DIAGNOSIS ReportType = 2 ReportType_SELF_REPORT ReportType = 3 ReportType_RECURSIVE ReportType = 4 ReportType_REVOKED ReportType = 5 )
func (ReportType) Descriptor ¶
func (ReportType) Descriptor() protoreflect.EnumDescriptor
func (ReportType) Enum ¶
func (x ReportType) Enum() *ReportType
func (ReportType) EnumDescriptor
deprecated
func (ReportType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ReportType.Descriptor instead.
func (ReportType) Number ¶
func (x ReportType) Number() protoreflect.EnumNumber
func (ReportType) String ¶
func (x ReportType) String() string
func (ReportType) Type ¶
func (ReportType) Type() protoreflect.EnumType