exposure-notifications-server: github.com/google/exposure-notifications-server/internal/export Index | Files | Directories

package export

import "github.com/google/exposure-notifications-server/internal/export"

Package export defines the handlers for managing exposure key exporting.


Package Files

batcher.go config.go exportfile.go server.go worker.go

func MarshalExportFile Uses

func MarshalExportFile(eb *model.ExportBatch, exposures, revisedExposures []*publishmodel.Exposure, batchNum, batchSize int, signers []*Signer) ([]byte, error)

MarshalExportFile converts the inputs into an encoded byte array.

func UnmarshalExportFile Uses

func UnmarshalExportFile(zippedProtoPayload []byte) (*export.TemporaryExposureKeyExport, []byte, error)

UnmarshalExportFile extracts the protobuf encoded exposure key present in the zip archived payload. Returns the parsed TemporaryExposureKeyExport protocol buffer message, the SHA256 digest of the signed content and/or an error if error. The digest is useful in validating the signature as it returns the deigest of the content that was signed when the archive was created.

func UnmarshalSignatureFile Uses

func UnmarshalSignatureFile(zippedProtoPayload []byte) (*export.TEKSignatureList, error)

UnmarshalSignatureFile extracts the protobuf encode dsignatures.

type Config Uses

type Config struct {
    Database              database.Config
    KeyManager            keys.Config
    SecretManager         secrets.Config
    Storage               storage.Config
    ObservabilityExporter observability.Config

    Port           string        `env:"PORT, default=8080"`
    CreateTimeout  time.Duration `env:"CREATE_BATCHES_TIMEOUT, default=5m"`
    WorkerTimeout  time.Duration `env:"WORKER_TIMEOUT, default=5m"`
    MinRecords     int           `env:"EXPORT_FILE_MIN_RECORDS, default=1000"`
    PaddingRange   int           `env:"EXPORT_FILE_PADDING_RANGE, default=100"`
    MaxRecords     int           `env:"EXPORT_FILE_MAX_RECORDS, default=30000"`
    TruncateWindow time.Duration `env:"TRUNCATE_WINDOW, default=1h"`
    MinWindowAge   time.Duration `env:"MIN_WINDOW_AGE, default=2h"`
    TTL            time.Duration `env:"CLEANUP_TTL, default=336h"`

Config represents the configuration and associated environment variables for the export components.

func (*Config) BlobstoreConfig Uses

func (c *Config) BlobstoreConfig() *storage.Config

func (*Config) DatabaseConfig Uses

func (c *Config) DatabaseConfig() *database.Config

func (*Config) KeyManagerConfig Uses

func (c *Config) KeyManagerConfig() *keys.Config

func (*Config) ObservabilityExporterConfig Uses

func (c *Config) ObservabilityExporterConfig() *observability.Config

func (*Config) SecretManagerConfig Uses

func (c *Config) SecretManagerConfig() *secrets.Config

type Server Uses

type Server struct {
    // contains filtered or unexported fields

Server hosts end points to manage export batches.

func NewServer Uses

func NewServer(config *Config, env *serverenv.ServerEnv) (*Server, error)

NewServer makes a Server.

func (*Server) Routes Uses

func (s *Server) Routes(ctx context.Context) *http.ServeMux

Routes defines and returns the routes for this server.

type Signer Uses

type Signer struct {
    SignatureInfo *model.SignatureInfo
    Signer        crypto.Signer


databasePackage database is a database interface to export.
modelPackage model is a model abstraction of exports.

Package export imports 31 packages (graph) and is imported by 2 packages. Updated 2020-10-28. Refresh now. Tools for package owners.