yesod-gitrepo-0.3.0: Host content provided by a Git repo

Safe HaskellNone
LanguageHaskell2010

Yesod.GitRepo

Synopsis

Documentation

data GitRepo a Source #

A combination of Yesod subsite to be used for creating a refresh route, as well as action to extract the current value of the content and force a refresh.

Since 0.1.0

Instances

Eq (Route (GitRepo a)) Source # 

Methods

(==) :: Route (GitRepo a) -> Route (GitRepo a) -> Bool #

(/=) :: Route (GitRepo a) -> Route (GitRepo a) -> Bool #

Read (Route (GitRepo a)) Source # 
Show (Route (GitRepo a)) Source # 

Methods

showsPrec :: Int -> Route (GitRepo a) -> ShowS #

show :: Route (GitRepo a) -> String #

showList :: [Route (GitRepo a)] -> ShowS #

RenderRoute (GitRepo a) Source # 

Associated Types

data Route (GitRepo a) :: * #

Methods

renderRoute :: Route (GitRepo a) -> ([Text], [(Text, Text)]) #

ParseRoute (GitRepo a) Source # 

Methods

parseRoute :: ([Text], [(Text, Text)]) -> Maybe (Route (GitRepo a)) #

YesodSubDispatch (GitRepo a) site Source # 
data Route (GitRepo a) Source # 

grRefresh :: GitRepo a -> IO () Source #

Force a refresh of the content. Usually this is done automatically via a POST request to the subsite route.

Since 0.1.0

grContent :: GitRepo a -> IO a Source #

Get the current value of the content.

Since 0.1.0

gitRepo Source #

Arguments

:: Text

URL

-> Text

branch name

-> (FilePath -> IO a)

what to do on clone/refresh

-> IO (GitRepo a) 

Create a new GitRepo value that can be used as a refresh subsite, as well as to extract the current value of the content.

Note that if the initial clone or user action fails, this function will throw an exception. For subsequent refreshes, the exception will be stored as an impure exception for future grContent calls.

Since 0.1.0

gitRepoDev :: FilePath -> (FilePath -> IO a) -> IO (GitRepo a) Source #

Like gitRepo, but intended to be used in a dev environment. It just uses a hard-coded FilePath and reloads the contents on each request.

Since 0.1.1

data family Route a :: * #

The type-safe URLs associated with a site argument.

Instances

Eq (Route LiteApp) 
Eq (Route WaiSubsite) 
Eq (Route WaiSubsiteWithAuth) 
Eq (Route (GitRepo a)) # 

Methods

(==) :: Route (GitRepo a) -> Route (GitRepo a) -> Bool #

(/=) :: Route (GitRepo a) -> Route (GitRepo a) -> Bool #

Ord (Route LiteApp) 
Ord (Route WaiSubsite) 
Ord (Route WaiSubsiteWithAuth) 
Read (Route LiteApp) 
Read (Route WaiSubsite) 
Read (Route WaiSubsiteWithAuth) 
Read (Route (GitRepo a)) # 
Show (Route LiteApp) 
Show (Route WaiSubsite) 
Show (Route WaiSubsiteWithAuth) 
Show (Route (GitRepo a)) # 

Methods

showsPrec :: Int -> Route (GitRepo a) -> ShowS #

show :: Route (GitRepo a) -> String #

showList :: [Route (GitRepo a)] -> ShowS #

data Route LiteApp 
data Route WaiSubsite 
data Route WaiSubsiteWithAuth 
data Route (GitRepo a) #