infrastructure

package
v0.0.0-...-b604398 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

func (gh *Github) RemoveDownloadedContents(path string) error

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 Hugo

type Hugo struct{}

Hugo holds the Hugo engine functionality

func (*Hugo) BuildSite

func (hugo *Hugo) BuildSite(source string) error

BuildSite builds an hugo project using the command line hugo tool. In the future a library use should be studied. Maybe this is better to be done when the HUGO project gets a more usable API.

type Logger

type Logger struct{}

Logger logs messages.

func (*Logger) Log

func (logger *Logger) Log(message string) error

Log logs the message. For the time being just the Info method of the logrus library is being used. It works like a general logger without any specific context like warning or error.

type RethinkDBSession

type RethinkDBSession struct {
	*r.Session
}

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.

func (*RethinkDBSession) List

func (rs *RethinkDBSession) List(key string, table string) ([]domain.Content, error)

List list a database table given given a key field

func (*RethinkDBSession) Remove

func (rs *RethinkDBSession) Remove(id string, table string) error

Remove removes an entry with id from a given table

func (*RethinkDBSession) Update

func (rs *RethinkDBSession) Update(data interface{}, id string, table string) error

Update updates an entry with id from a given table

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL