Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoReplacements ¶
func DoReplacements(patterns []Replacement, fullpath string) (result string, err error)
DoReplacements return the result of a series of replacements
Types ¶
type CourseDownloader ¶
CourseDownloader will download files from a canvas course.
func DownloaderFromWG ¶
func DownloaderFromWG(basedir string, wg *sync.WaitGroup) *CourseDownloader
DownloaderFromWG will create a course downloader form an existing waitgroup.
func NewDownloader ¶
func NewDownloader(basedir string) *CourseDownloader
NewDownloader creates a new CourseDownloader
func (*CourseDownloader) CheckReplacements ¶
func (cd *CourseDownloader) CheckReplacements( course *canvas.Course, reps []Replacement, ) (err error)
CheckReplacements will print the result of replacement patterns on the files in a course.
func (*CourseDownloader) Download ¶
func (cd *CourseDownloader) Download(course *canvas.Course, replacements []Replacement) error
Download will download all the files for a course and perform the replacement patterns.
func (*CourseDownloader) Wait ¶
func (cd *CourseDownloader) Wait()
Wait calls wait on the internal waitgroup
type Replacement ¶
type Replacement struct { Pattern string `yaml:"pattern"` Replacement string `yaml:"replacement"` Lower bool `yaml:"lower"` }
Replacement is a regex pattern replacement
func (Replacement) Replace ¶
func (r Replacement) Replace(path string) (result string, err error)
Replace will perform a replacement
func (Replacement) String ¶ added in v0.0.4
func (r Replacement) String() string
Click to show internal directories.
Click to hide internal directories.