Documentation

Overview

    Package util is a CLI tool for generating test exposure key data.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func DecodeKey

    func DecodeKey(b64key string) []byte

      DecodeKey decodes base64 string to []byte.

      func GenerateExposureKeys

      func GenerateExposureKeys(numKeys, tr int, randomInterval bool) []v1.ExposureKey

        GenerateExposureKeys creates the given number of exposure keys.

        func GenerateExposuresForIntervals

        func GenerateExposuresForIntervals(intervals []int32) ([]v1.ExposureKey, error)

          GenerateExposuresForIntervals generates a key for each interval start passed in

          func GenerateKey

          func GenerateKey() (string, error)

            GenerateKey generates a key.

            func RandomArrValue

            func RandomArrValue(arr []string) (string, error)

              RandomArrValue chooses a random element from the array.

              func RandomBytes

              func RandomBytes(arrLen int) ([]byte, error)

                RandomBytes generates a random byte sequence.

                func RandomExposureKey

                func RandomExposureKey(intervalNumber int32, intervalCount int32, transmissionRisk int) (v1.ExposureKey, error)

                  RandomExposureKey creates a random exposure key.

                  func RandomInt

                  func RandomInt(maxValue int) (int, error)

                    RandomInt produces a random integer up to but not including maxValue.

                    func RandomIntWithMin

                    func RandomIntWithMin(min, max int) (int, error)

                      RandomIntWithMin is inclusive, [min:max].

                      func RandomIntervalCount

                      func RandomIntervalCount() (int32, error)

                        RandomIntervalCount produces a random interval.

                        func RandomReportType

                        func RandomReportType() (string, error)

                        func RandomRevisedReportType

                        func RandomRevisedReportType() (string, error)

                        func RandomTransmissionRisk

                        func RandomTransmissionRisk() (int, error)

                          RandomTransmissionRisk produces a random transmission risk score.

                          func ToBase64

                          func ToBase64(key []byte) string

                            ToBase64 encodes bytes array to base64.

                            Types

                            This section is empty.

                            Source Files