sheepstor

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 15 Imported by: 0

README

SheepsTor

CMS to complement Hugo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureZapLogger added in v0.0.8

func ConfigureZapLogger(debugging bool) (*zap.Logger, error)

func ConfigureZapSugarLogger added in v0.0.8

func ConfigureZapSugarLogger(debugging bool) (*zap.SugaredLogger, error)

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func DefaultProcessor

func DefaultProcessor(sourcesPath, targetFolderPathForBuild string)

func EnableDefaultLogger added in v0.0.8

func EnableDefaultLogger()

func HugoProcessor

func HugoProcessor(sourcesPath, targetFolderPathForBuild string) error

func SetLogger added in v0.0.8

func SetLogger(l *zap.SugaredLogger)

Types

type GitRepo

type GitRepo struct {
	CloneID       string
	RepoName      string
	BranchName    string
	BranchRef     string
	RepoLocalPath string
}

func NewGitRepo

func NewGitRepo(cloneID, repoName, branchName, localPath string) GitRepo

func (*GitRepo) Clone

func (g *GitRepo) Clone() error

func (*GitRepo) CommitAndPush

func (g *GitRepo) CommitAndPush(message string) error

func (*GitRepo) GetHeadCommitID

func (g *GitRepo) GetHeadCommitID() string

func (*GitRepo) Pull

func (g *GitRepo) Pull() error

type Website

type Website struct {
	ID               string
	ContentProcessor string //either 'hugo' or nil
	ProcessorRoot    string
	WebRoot          string
	GitRepo          GitRepo
}

func NewWebsite

func NewWebsite(id, contentProcessor, processorRoot, sourceRoot, webRoot, repoCloneID, repoName, repoBranchName string) Website

func (*Website) Build

func (w *Website) Build() error

func (*Website) CommitAndPush

func (w *Website) CommitAndPush(message string) error

func (*Website) ProvisionSources

func (w *Website) ProvisionSources() error

type WebsiteRegistry

type WebsiteRegistry struct {
	SourceRoot          string
	WebRoot             string
	GitHubWebHookSecret string
	WebSites            []*Website
}

func NewRegistry added in v0.0.8

func NewRegistry(sourceRoot, webRoot, gitHubWebHookSecret string) WebsiteRegistry

func (*WebsiteRegistry) Add

func (r *WebsiteRegistry) Add(w *Website)

func (*WebsiteRegistry) GetWebsiteByID

func (r *WebsiteRegistry) GetWebsiteByID(id string) *Website

func (*WebsiteRegistry) GetWebsiteByRepoNameAndBranchRef

func (r *WebsiteRegistry) GetWebsiteByRepoNameAndBranchRef(repoName, branchRef string) *Website

func (*WebsiteRegistry) GitHubWebHookHandler added in v0.0.8

func (r *WebsiteRegistry) GitHubWebHookHandler(resp http.ResponseWriter, req *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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