Code Monkey home page Code Monkey logo

gonzo's Introduction

Heads up! Gonzo is being polished at this stage so some APIs may change.

Gonzo GoDoc

File Processing Framework based on Go Pipelines.

Use Case

  • Web App Development
  • Log Analysis
  • Continuous Integration
  • Content Mangement Systems

Why?

For an explanation of why Gonzo was written read on its predecessor, slurp.

Design

Gonzo is made up of File, Context, Stages, and Pipes.

File

File is an interface that mimics os.File with some additional APIs.

Pipes

Pipe holde a channel of files, a context for logging and deadlines, and a simple interface to pass files through a Stage.

Stages

Stages are where files are handled for processing.

Currently the follow stages are implemented, but writing new stages are supper simple.

ace Compile Ace templates.
archive/tar Work with tar archives.
archive/zip Work with zip Archives.
css Minify CSS
filter A collection of stages for filtering files.
fs Read and Write from Disk.
gcss Compile gcss to css.
gin A Go Server livereload utlity.
github Grab files from github.
html Minify HTML
js Minify JavaScript
livereload Livereload
passthrough Pass files through any executable.
resources go-resources binding.
s3 Put files to S3.
scss Compile SCSS to CSS.
util Some helpful utlites.
watch Watch files for change.
web Grab files from any URL.

Example

To compile scss files, minify the output, write it to disk, lifereload in browser, and upload it to Amazon S3, this all you need:

s3conf := s3.Config{
	AccessKey: os.Getenv("S3_ACCESSKEY"),
	SecretKey: os.Getenv("S3_SECRETE"),
	Name:      os.Getenv("S3_NAME"),
	Region:    s3.APSoutheast2,
	Perm:      s3.PublicRead,
}

lr := livereload.New(livereload.Config{LiveCSS: true})

err := s.Src(context.Background(), "app/style.scss").Then(
	util.Trim("app"),
	scss.Compile(),
	css.Minify(),
	fs.Dest("./public/assets/"),
	lr.Reload(),
	s3.Put(s3conf),
)
//Handle any _fatal_ error.

TODO:

  • Finish this doucment.
  • Add tests

gonzo's People

Contributors

omeid avatar

Watchers

Paul M Fox avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.