Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(err error)
Check makes checking errors easy, so they actually get a minimal check
func FindRetentionPeriod ¶
func FindRetentionPeriod(retentionPeriods RetentionT, companyID int) int
FindRetentionPeriod finds the retention period for a companyID eg 30 days, or returns the default retention period
Types ¶
type Directory ¶
type Directory struct { // Base directory for storage eg /data/fb Base string // CompanyID CompanyID int // Device name eg j1_readnews_com DeviceName string // Device Number eg 2466 DeviceNumber int }
Directory represents a directory for storage eg "/data/fb/1289/j1_readnews_com" TODO rename Directory to Database
func BuildDirectory ¶
BuildDirectory is a constructor for the Directory struct. It takes a 'storage' like "/data/fb" and a 'path' like "/data/fb/1289/j1_readnews_com/2466/2015/08/11/09/18" and returns a 'Directory' struct
func (Directory) Retain ¶
Retain returns true if, on a given 'date', the 'path' should be kept if the retention period is 'period'
func (Directory) StripStart ¶
StripStart strips directories, for example "/data/fb/1289/j1_readnews_com/2466/" from the start of a path eg "/data/fb/1289/j1_readnews_com/2466/2015/08/11/09/18" giving the date part of the path eg "2015/08/11/09/18"
type RetentionT ¶
type RetentionT map[int]SubRetentionT
RetentionT is used for storing retention settings
type SubRetentionT ¶
SubRetentionT is used for storing retention settings