Code Monkey home page Code Monkey logo

gottp's Introduction

I am a Software Engineer. I live in San Francisco, California.

Until recently, I was the Founder and CTO at Last9. I conceptualized and built Levitate.

Previously, I have built and exited Oogway, Datascale, and Siminars

Outside of Software, I am a trained long-distance runner.

gottp's People

Contributors

meson10 avatar parthdesai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gottp's Issues

Improve pipeline and batch processor

Current pipelines allow you to have a series of urls which can
be executed one after he other or all in parallel. But they do not share
data among each other. So you can build something like,

Create user | notify everyone there is a new user | send welcome email

These of course can be done in serial or parallel. As long as they use
the same data input.

Now if we had to do something like..

Create user | start a billing cycle for the user_id | return the user

This cannot be achieved, because it requires the output of first
operation (most likely a user_Id) to be fed into the next steps. So it
limits what can be achieved right now.

Ideally we should be able to do complex chains like:

Parallel ( ( Create user | Start billing for user | return user ),
notify everyone, send welcome email)

This would require coming up with a protocol specification on how one
could submit these jobs. Also the return needs to be captured in the
same manner that s job was submitted.

gottp crashes when invalid json is supplied

The stacktrace is:

2015/02/05 11:02:12 exception.go:31: unexpected EOF goroutine 12 [running]:
gopkg.in/simversity/gottp%2ev1.Exception(0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/exception.go:90 +0xa0
runtime.panic(0x714320, 0xc210036070)
/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106
gopkg.in/simversity/gottp.v1/utils.DecodeStream(0x7fe4f0892b08, 0xc2100ce330, 0x685980, 0xc210000c78)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/utils/json.go:24 +0xda
gopkg.in/simversity/gottp%2ev1.(_Request).makeBodyParams(0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:123 +0x5b
gopkg.in/simversity/gottp%2ev1.(_Request).GetArguments(0xc2100cd240, 0x70)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:131 +0x84
gopkg.in/simversity/gottp%2ev1.(_Request).ConvertArguments(0xc2100cd240, 0x731980, 0xc21009a150)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:139 +0x27
github.com/parthdesai/sc-notifications/handlers.(_ChannelHandler).Post(0xc21000a720, 0xc2100cd240)
/home/parth/go_projects/src/github.com/parthdesai/sc-notifications/handlers/channel_handler.go:18 +0x58
gopkg.in/simversity/gottp%2ev1.performRequest(0x7fe4f0891380, 0xc21000a720, 0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/httpserver.go:32 +0x416
gopkg.in/simversity/gottp%2ev1.func·007(0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/httpserver.go:175 +0x1d7
net/http.HandlerFunc.ServeHTTP(0x8584b0, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1220 +0x40
net/http.(_ServeMux).ServeHTTP(0xc21001db40, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21001eaf0, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1597 +0x16e
net/http.(_conn).serve(0xc210086780)
/usr/lib/go/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(*Server).Serve
/usr/lib/go/src/pkg/net/http/server.go:1644 +0x28b

2015/02/05 11:02:12 httpserver.go:144: [POST] /channel/email 127.0.0.1:41810 728.072us
2015/02/05 11:02:12 server.go:1094: http: panic serving 127.0.0.1:41810: interface conversion: interface is _errors.errorString, not string
goroutine 12 [running]:
net/http.func·009()
/usr/lib/go/src/pkg/net/http/server.go:1093 +0xae
runtime.panic(0x733ac0, 0xc2100cd280)
/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106
gopkg.in/simversity/gottp%2ev1.Exception(0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/exception.go:108 +0x226
runtime.panic(0x714320, 0xc210036070)
/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106
gopkg.in/simversity/gottp.v1/utils.DecodeStream(0x7fe4f0892b08, 0xc2100ce330, 0x685980, 0xc210000c78)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/utils/json.go:24 +0xda
gopkg.in/simversity/gottp%2ev1.(_Request).makeBodyParams(0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:123 +0x5b
gopkg.in/simversity/gottp%2ev1.(_Request).GetArguments(0xc2100cd240, 0x70)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:131 +0x84
gopkg.in/simversity/gottp%2ev1.(_Request).ConvertArguments(0xc2100cd240, 0x731980, 0xc21009a150)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/request.go:139 +0x27
github.com/parthdesai/sc-notifications/handlers.(_ChannelHandler).Post(0xc21000a720, 0xc2100cd240)
/home/parth/go_projects/src/github.com/parthdesai/sc-notifications/handlers/channel_handler.go:18 +0x58
gopkg.in/simversity/gottp%2ev1.performRequest(0x7fe4f0891380, 0xc21000a720, 0xc2100cd240)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/httpserver.go:32 +0x416
gopkg.in/simversity/gottp%2ev1.func·007(0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/httpserver.go:175 +0x1d7
net/http.HandlerFunc.ServeHTTP(0x8584b0, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1220 +0x40
net/http.(_ServeMux).ServeHTTP(0xc21001db40, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21001eaf0, 0x7fe4f0892b60, 0xc210099780, 0xc21009c820)
/usr/lib/go/src/pkg/net/http/server.go:1597 +0x16e
net/http.(_conn).serve(0xc210086780)
/usr/lib/go/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(_Server).Serve
/usr/lib/go/src/pkg/net/http/server.go:1644 +0x28b
2015/02/05 11:02:12 smtp.go:55: dial tcp :0: connection refused
panic: dial tcp :0: connection refused

goroutine 15 [running]:
runtime.panic(0x6a1360, 0xc2100c6fc0)
/usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
log.Panic(0x7fe4ee7d5f10, 0x1, 0x1)
/usr/lib/go/src/pkg/log/log.go:307 +0xac
gopkg.in/simversity/gottp%2ev1.(*MailConn).SendEmail(0xc2101cf1e0, 0x0, 0x0, 0x0, 0x0, ...)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/smtp.go:55 +0x284
created by gopkg.in/simversity/gottp%2ev1.sendException
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/exception.go:41 +0x2ff

goroutine 1 [runnable]:
net.runtime_pollWait(0x7fe4f0892630, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc21009a3e0, 0x72, 0x7fe4f08910e8, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc21009a3e0, 0xb, 0x7fe4f08910e8)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).accept(0xc21009a380, 0x85b940, 0x0, 0x7fe4f08910e8, 0xb)
/usr/lib/go/src/pkg/net/fd_unix.go:382 +0x2c2
net.(_TCPListener).AcceptTCP(0xc210000558, 0x49742b, 0x7fe4f0701d08, 0x49742b)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:233 +0x47
net.(_TCPListener).Accept(0xc210000558, 0x7fe4f0892900, 0xc210000878, 0xc210086780, 0x0)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:243 +0x27
net/http.(_Server).Serve(0xc21001eaf0, 0x7fe4f0891690, 0xc210000558, 0x0, 0x0)
/usr/lib/go/src/pkg/net/http/server.go:1622 +0x91
net/http.(*Server).ListenAndServe(0xc21001eaf0, 0xc21001eaf0, 0x0)
/usr/lib/go/src/pkg/net/http/server.go:1612 +0xa0
net/http.ListenAndServe(0xc21000a9a0, 0xc, 0x0, 0x0, 0xffffffffffffffff, ...)
/usr/lib/go/src/pkg/net/http/server.go:1677 +0x6d
gopkg.in/simversity/gottp%2ev1.makeServer()
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/local_server.go:111 +0x5e8
gopkg.in/simversity/gottp%2ev1.MakeServer(0x7fe4f0891488, 0xb79ea0)
/home/parth/go_projects/src/gopkg.in/simversity/gottp.v1/local_server.go:68 +0x36
main.main()
/home/parth/go_projects/src/github.com/parthdesai/sc-notifications/main.go:22 +0x1f1

goroutine 3 [syscall]:
os/signal.loop()
/usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
/usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x31

goroutine 5 [select]:
gopkg.in/mgo%2ev2.(*mongoCluster).syncServersLoop(0xc2100a2000)
/home/parth/go_projects/src/gopkg.in/mgo.v2/cluster.go:381 +0x539
created by gopkg.in/mgo%2ev2.newCluster
/home/parth/go_projects/src/gopkg.in/mgo.v2/cluster.go:73 +0x120

goroutine 13 [IO wait]:
net.runtime_pollWait(0x7fe4f0892438, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc21009ae60, 0x72, 0x7fe4f08910e8, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc21009ae60, 0xb, 0x7fe4f08910e8)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).Read(0xc21009ae00, 0xc2100ce240, 0x24, 0x24, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(_conn).Read(0xc210000bd8, 0xc2100ce240, 0x24, 0x24, 0x0, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xc5
gopkg.in/mgo%2ev2.fill(0x7fe4f0892900, 0xc210000bd8, 0xc2100ce240, 0x24, 0x24, ...)
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:502 +0x5b
gopkg.in/mgo%2ev2.(*mongoSocket).readLoop(0xc210045b60)
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:519 +0x115
created by gopkg.in/mgo%2ev2.newSocket
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:166 +0x2b3

goroutine 10 [IO wait]:
net.runtime_pollWait(0x7fe4f0892588, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc21009a6f0, 0x72, 0x7fe4f08910e8, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc21009a6f0, 0xb, 0x7fe4f08910e8)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).Read(0xc21009a690, 0xc210097780, 0x24, 0x24, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(_conn).Read(0xc210000678, 0xc210097780, 0x24, 0x24, 0x0, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xc5
gopkg.in/mgo%2ev2.fill(0x7fe4f0892900, 0xc210000678, 0xc210097780, 0x24, 0x24, ...)
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:502 +0x5b
gopkg.in/mgo%2ev2.(*mongoSocket).readLoop(0xc2100458c0)
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:519 +0x115
created by gopkg.in/mgo%2ev2.newSocket
/home/parth/go_projects/src/gopkg.in/mgo.v2/socket.go:166 +0x2b3

goroutine 9 [syscall]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1394

goroutine 11 [sleep]:
time.Sleep(0x12a05f200)
/usr/lib/go/src/pkg/runtime/time.goc:31 +0x31
gopkg.in/mgo%2ev2.(*mongoServer).pinger(0xc210045700, 0xc210045701)
/home/parth/go_projects/src/gopkg.in/mgo.v2/server.go:296 +0x122
created by gopkg.in/mgo%2ev2.newServer
/home/parth/go_projects/src/gopkg.in/mgo.v2/server.go:89 +0xf6

Documentation using godoc

Please generate package level documentation using godoc,which will help us to understand code structure.

undefined: GottpSettings

package main

import (
	"gopkg.in/meson10/gottp.v3"
	"gopkg.in/meson10/gottp.v3/conf"
	"log"
)

type Configurer interface {
	MakeConfig(string)
	GetGottpConfig() *GottpSettings
}
type config struct {
	Custom struct {
		VarOne string
		VarTwo string
	}
	Gottp conf.GottpSettings
}

func (self *config) MakeConfig(configPath string) {
	if configPath != "" {
		conf.MakeConfig(configPath, self)
	}
}
func (self *config) GetGottpConfig() *conf.GottpSettings {
	return &self.Gottp
}

type HelloMessage struct {
	gottp.BaseHandler
}

func (self *HelloMessage) Get(req *gottp.Request) {
	req.Write("hello world")
}

var settings config

func main() {

	gottp.NewUrl("hello", "/hello/\\w{3,5}/?$", new(handlers.HelloMessage))

	gottp.MakeServer(&settings)
}

Allow yml config backend.

Currently config is supplied as .cfg files. This has worked all along but I have realised that people prefer yml since it's more human readable and easy to write. Also the gcfg repository has moved and fails to install half the times.

Traceback Exception email improvements for JSON payloads

In case a JSON data is sent during a request and an exception occurs, it's encoded and not formatted like this:

Arguments:

{"org":"12345","user":"12345"}

This makes debugging life hard compared to if it would look like this:

{
  "org":"12345",
  "user":"12345"
}

Improved url regular expressions

I have heard significant feedback to explore improving the url regular expressions to support something like what martini does.

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.