package
10.0.0+incompatible
Repository: https://github.com/nyaruka/rp-archiver.git
Documentation: pkg.go.dev

# Functions

ArchiveActiveOrgs fetches active orgs and archives messages and runs.
ArchiveOrg looks for any missing archives for the passed in org, creating and uploading them as necessary, returning the created archives.
BuildRollupArchive builds a monthly archive from the files present on S3.
CreateArchiveFile is responsible for writing an archive file for the passed in archive from our database.
CreateOrgArchives builds all the missing archives for the passed in org.
DeleteArchivedMessages takes the passed in archive, verifies the S3 file is still present (and correct), then selects all the messages in the archive date range, and if equal or fewer than the number archived, deletes them 100 at a time Upon completion it updates the needs_deletion flag on the archive.
DeleteArchivedOrgRecords deletes all the records for the given org based on archives already created.
DeleteArchivedRuns takes the passed in archive, verifies the S3 file is still present (and correct), then selects all the runs in the archive date range, and if equal or fewer than the number archived, deletes them 100 at a time Upon completion it updates the needs_deletion flag on the archive.
DeleteArchiveFile removes our own disk archive file.
DeleteBroadcasts deletes all broadcasts older than 90 days for the passed in org which have no associated messages.
DeleteFlowStarts deletes all starts older than 90 days for the passed in org which have no associated runs.
EnsureTempArchiveDirectory checks that we can write to our archive directory, creating it first if needbe.
GetActiveOrgs returns the active organizations sorted by id.
GetArchivesNeedingDeletion returns all the archives which need to be deleted.
GetCurrentArchiveCount returns the archive count for the passed in org and record type.
GetCurrentArchives returns all the current archives for the passed in org and record type.
GetDailyArchivesForDateRange returns all the current archives for the passed in org and record type and date range.
GetMissingDailyArchives calculates what archives need to be generated for the passed in org this is calculated per day.
GetMissingDailyArchivesForDateRange returns all them missing daily archives between the two passed in date ranges.
GetMissingMonthlyArchives gets which montly archives are currently missing for this org.
GetS3File return an io.ReadCloser for the passed in bucket and path.
GetS3FileInfo returns the ETAG hash for the passed in file.
NewS3Client creates a new s3 service from the passed in config, testing it as necessary.
RollupOrgArchives rolls up monthly archives from our daily archives.
UploadArchive uploads the passed archive file to S3.
UploadToS3 writes the passed in archive.
WriteArchiveToDB write an archive to the Database.

# Constants

DayPeriod id the period of a day (24 hours) from archive start date.
MessageType for message archives.
MonthPeriod is the period of a month from archive start date.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RunType for run archives.
SessionType for session archives.

# Structs

Archive represents the model for an archive.
Org represents the model for an org.

# Type aliases

ArchivePeriod is the period of data in the archive.
ArchiveType is the type for the archives.