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

Instances details
Read (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Show (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Methods

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

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

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

Eq (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Methods

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

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

ParseRoute (GitRepo a) Source # 
Instance details

Defined in Yesod.GitRepo

Methods

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

RenderRoute (GitRepo a) Source # 
Instance details

Defined in Yesod.GitRepo

Associated Types

data Route (GitRepo a) 
Instance details

Defined in Yesod.GitRepo

Methods

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

YesodSubDispatch (GitRepo a) site Source # 
Instance details

Defined in Yesod.GitRepo

data Route (GitRepo a) Source # 
Instance details

Defined in Yesod.GitRepo

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

Instances details
RedirectUrl master (Route master) 
Instance details

Defined in Yesod.Core.Handler

Methods

toTextUrl :: (MonadHandler m, HandlerSite m ~ master) => Route master -> m Text #

(key ~ Text, val ~ Text) => RedirectUrl master (Route master, Map key val) 
Instance details

Defined in Yesod.Core.Handler

Methods

toTextUrl :: (MonadHandler m, HandlerSite m ~ master) => (Route master, Map key val) -> m Text #

(key ~ Text, val ~ Text) => RedirectUrl master (Route master, [(key, val)]) 
Instance details

Defined in Yesod.Core.Handler

Methods

toTextUrl :: (MonadHandler m, HandlerSite m ~ master) => (Route master, [(key, val)]) -> m Text #

Read (Route LiteApp) 
Instance details

Defined in Yesod.Core.Internal.LiteApp

Read (Route WaiSubsite) 
Instance details

Defined in Yesod.Core.Types

Read (Route WaiSubsiteWithAuth) 
Instance details

Defined in Yesod.Core.Types

Read (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Show (Route LiteApp) 
Instance details

Defined in Yesod.Core.Internal.LiteApp

Show (Route WaiSubsite) 
Instance details

Defined in Yesod.Core.Types

Show (Route WaiSubsiteWithAuth) 
Instance details

Defined in Yesod.Core.Types

Show (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Methods

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

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

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

Eq (Route LiteApp) 
Instance details

Defined in Yesod.Core.Internal.LiteApp

Eq (Route WaiSubsite) 
Instance details

Defined in Yesod.Core.Types

Eq (Route WaiSubsiteWithAuth) 
Instance details

Defined in Yesod.Core.Types

Eq (Route (GitRepo a)) Source # 
Instance details

Defined in Yesod.GitRepo

Methods

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

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

Ord (Route LiteApp) 
Instance details

Defined in Yesod.Core.Internal.LiteApp

Ord (Route WaiSubsite) 
Instance details

Defined in Yesod.Core.Types

Ord (Route WaiSubsiteWithAuth) 
Instance details

Defined in Yesod.Core.Types

data Route LiteApp 
Instance details

Defined in Yesod.Core.Internal.LiteApp

data Route WaiSubsite 
Instance details

Defined in Yesod.Core.Types

data Route WaiSubsiteWithAuth 
Instance details

Defined in Yesod.Core.Types

data Route (GitRepo a) Source # 
Instance details

Defined in Yesod.GitRepo