diff --git a/env/env.go b/env/env.go index a1fa521..6cfd898 100644 --- a/env/env.go +++ b/env/env.go @@ -33,6 +33,8 @@ var ( Emails *db.EmailsTable // Labels is the global instance of LabelsTable Labels *db.LabelsTable + // Attachments is the global instance of AttachmentsTable + Attachments *db.AttachmentsTable // Factors contains all currently registered factors Factors map[string]factor.Factor // NATS is the encoded connection to the NATS queue diff --git a/setup/setup.go b/setup/setup.go index b3d1a7f..bb3e7e7 100644 --- a/setup/setup.go +++ b/setup/setup.go @@ -163,6 +163,13 @@ func PrepareMux(flags *env.Flags) *web.Mux { Emails: env.Emails, Cache: redis, } + env.Attachments = &db.AttachmentsTable{ + RethinkCRUD: db.NewCRUDTable( + rethinkSession, + rethinkOpts.Database, + "attachments", + ), + } // NATS queue connection nc, err := nats.Connect(flags.NATSAddress)