Documentation ¶
Index ¶
- type Github
- func (gh *Github) CreateContentFile(content domain.Content, oauthConfiguration *oauth2.Config) (*domain.Content, error)
- func (gh *Github) DownloadContents(content domain.Content, oauthConfiguration *oauth2.Config) (*string, error)
- func (gh *Github) GetFileContent(content domain.Content, oauthConfiguration *oauth2.Config) (*string, error)
- func (gh *Github) GetUser(accessToken string, oauthConfiguration *oauth2.Config) (*domain.User, error)
- func (gh *Github) ListContentTitles(content domain.Content, oauthConfiguration *oauth2.Config) ([]string, error)
- func (gh *Github) PushFiles(content domain.Content, oauthConfiguration *oauth2.Config, sourcePath string) error
- func (gh *Github) RemoveContentFile(content domain.Content, oauthConfiguration *oauth2.Config) error
- func (gh *Github) RemoveDownloadedContents(path string) error
- func (gh *Github) UpdateFileContent(content domain.Content, oauthConfiguration *oauth2.Config) error
- func (gh *Github) ValidateRepository(accessToken string, oauthConfiguration *oauth2.Config, ...) (bool, error)
- type Hugo
- type Logger
- type RethinkDBSession
- func (rs *RethinkDBSession) Add(data interface{}, table string, onConflict string) error
- func (rs *RethinkDBSession) List(key string, table string) ([]domain.Content, error)
- func (rs *RethinkDBSession) Remove(id string, table string) error
- func (rs *RethinkDBSession) Update(data interface{}, id string, table string) error
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Github ¶
type Github struct { Client *github.Client User *github.User Data interface{} OauthConfiguration *oauth2.Config }
func (*Github) CreateContentFile ¶
func (gh *Github) CreateContentFile(content domain.Content, oauthConfiguration *oauth2.Config) (*domain.Content, error)
CreateContentFile creates a content file in github with the given content information.
func (*Github) DownloadContents ¶
func (gh *Github) DownloadContents(content domain.Content, oauthConfiguration *oauth2.Config) (*string, error)
DownloadGithubContents downloads the github contents from the HUGO project branch.
func (*Github) GetFileContent ¶
func (gh *Github) GetFileContent(content domain.Content, oauthConfiguration *oauth2.Config) (*string, error)
GetFileContent retrieves the content of a github file.
func (*Github) GetUser ¶
func (gh *Github) GetUser(accessToken string, oauthConfiguration *oauth2.Config) (*domain.User, error)
GetUser gets the github user
func (*Github) ListContentTitles ¶
func (gh *Github) ListContentTitles(content domain.Content, oauthConfiguration *oauth2.Config) ([]string, error)
ListContentTitles lists the content of a set of github files.
func (*Github) PushFiles ¶
func (gh *Github) PushFiles(content domain.Content, oauthConfiguration *oauth2.Config, sourcePath string) error
PushFiles pushes files from a source path to github.
func (*Github) RemoveContentFile ¶
func (gh *Github) RemoveContentFile(content domain.Content, oauthConfiguration *oauth2.Config) error
RemoveContentFile removes an already existing Github file content at a given repository and in a given branch.
func (*Github) RemoveDownloadedContents ¶
RemoveDonwloadedContents removes the path of downloaded contents from github.
func (*Github) UpdateFileContent ¶
func (gh *Github) UpdateFileContent(content domain.Content, oauthConfiguration *oauth2.Config) error
UpdateFileContent updates the content of a github file.
func (*Github) ValidateRepository ¶
func (gh *Github) ValidateRepository(accessToken string, oauthConfiguration *oauth2.Config, repository domain.Repository) (bool, error)
Validates if a given repository is a valid repository. To be valid a repository should have some specific files or folders.
type RethinkDBSession ¶
RethinkDBSession holds the rethinkDB session
func NewRethinkDBSession ¶
func NewRethinkDBSession() (*RethinkDBSession, error)
NewRethinkDBSession creates a new database session
func (*RethinkDBSession) Add ¶
func (rs *RethinkDBSession) Add(data interface{}, table string, onConflict string) error
Add adds data to a given table. Also a conflict solver is passed.
type Tree ¶
type Tree struct { Name string // Parent refers to the parent tree of a tree. If a tree has no parent then // it is equal to the unique identied parent folder containing the unziped // repository. Parent string // Level represents that deepness of a tree. The deeper it is, the deper the folder level. Level int GithubTree *github.Tree }
Tree is a custom tree that extends the github tree.