| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Freckle.App.Version
Description
Facilities for inferring an application version
Various inputs are checked: files written during a docker build, git information, or falling back to an unknown version. This is useful for Bugsnag reports, client age comparison, etc.
Synopsis
- data AppVersion = AppVersion {
- avName :: Text
 - avCreatedAt :: UTCTime
 
 - getAppVersion :: MonadUnliftIO m => m AppVersion
 - tryGetAppVersion :: MonadUnliftIO m => FilePath -> m (Either [String] AppVersion)
 
Documentation
data AppVersion Source #
Constructors
| AppVersion | |
Fields 
  | |
Instances
| Eq AppVersion Source # | |
Defined in Freckle.App.Version  | |
| Show AppVersion Source # | |
Defined in Freckle.App.Version Methods showsPrec :: Int -> AppVersion -> ShowS # show :: AppVersion -> String # showList :: [AppVersion] -> ShowS #  | |
getAppVersion :: MonadUnliftIO m => m AppVersion Source #
Attempt to infer an AppVersion
- If files exist under 
/app-versionthey ar read, otherwise - If we're in a Git repository commit information is used, otherwise
 - An Unknown version as of the current time is returned
 
tryGetAppVersion :: MonadUnliftIO m => FilePath -> m (Either [String] AppVersion) Source #
A more testable version of getAppVersion
- Reports what didn't work in 
Left - Accepts a parent path, for file-system version information