Skip to content

Commit

Permalink
lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
omeid committed Oct 7, 2015
1 parent ae57867 commit 10af7dd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 2 additions & 8 deletions README.md
Expand Up @@ -3,15 +3,9 @@
</p>

> _**Heads up!**_ Gonzo is being polished at this stage so some APIs may change.
> Gonzo is a refinment of Slurp.
# Gonzo [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/omeid/gonzo)
Go file-processing Framework based on Go [Pipelines](http://blog.golang.org/pipelines) concept.

- Convention over configuration
- Explicit is better than implicit.
- Do one thing. Do it well.
- ...
File Processing Framework based on Go [Pipelines](http://blog.golang.org/pipelines).

### Use Case
- Web App Development
Expand All @@ -20,7 +14,7 @@ Go file-processing Framework based on Go [Pipelines](http://blog.golang.org/pipe
- Content Mangement Systems

### Why?
For an explanation of why Gonzo was written read on its predecessor, [slurp](https://github.com/omeid/slurp)
For an explanation of why Gonzo was written read on its predecessor, [slurp](https://github.com/omeid/slurp).


## Design
Expand Down
14 changes: 9 additions & 5 deletions context/helpers.go
Expand Up @@ -3,8 +3,9 @@ package context
import (
"time"

"github.com/Sirupsen/logrus"
"golang.org/x/net/context"

"github.com/Sirupsen/logrus"
)

func Background() Context {
Expand All @@ -30,19 +31,20 @@ func WithCancel(parent Context) (Context, context.CancelFunc) {
Entry: entry,
}

return ctx, cancel
return &ctx, cancel
}

func WithDeadline(parent Context, deadline time.Time) (Context, context.CancelFunc) {
c, cancel := context.WithDeadline(parent, deadline)

var entry *logrus.Entry
if ctx, ok := parent.(*ctx); ok {
entry = ctx.Entry
} else {
entry = std
}

ctx := ctx{
ctx := &ctx{
Context: c,
Entry: entry,
}
Expand All @@ -52,14 +54,15 @@ func WithDeadline(parent Context, deadline time.Time) (Context, context.CancelFu

func WithTimeout(parent Context, timeout time.Duration) (Context, context.CancelFunc) {
c, cancel := context.WithTimeout(parent, timeout)

var entry *logrus.Entry
if ctx, ok := parent.(*ctx); ok {
entry = ctx.Entry
} else {
entry = std
}

ctx := ctx{
ctx := &ctx{
Context: c,
Entry: entry,
}
Expand All @@ -69,14 +72,15 @@ func WithTimeout(parent Context, timeout time.Duration) (Context, context.Cancel

func WithValue(parent Context, key string, value interface{}) Context {
c := context.WithValue(parent, key, value)

var entry *logrus.Entry
if ctx, ok := parent.(*ctx); ok {
entry = ctx.Entry
} else {
entry = std
}

ctx := ctx{
ctx := &ctx{
Context: c,
Entry: entry.WithField(key, value),
}
Expand Down
2 changes: 2 additions & 0 deletions doc.go
@@ -0,0 +1,2 @@
// Package gonzo is a file-processing Framework based on Go [Pipelines](http://blog.golang.org/pipelines) concept.
package gonzo

0 comments on commit 10af7dd

Please sign in to comment.