Example #1
0
func Chunked(sock string) handlers.HandlerConst {
	return func() (handlers.Handler, error) {
		conn, err := net.Dial("unix", sock)
		if err != nil {
			log.Println("Error opening connection:", err.Error())
			if conn != nil {
				conn.Close()
			}
			return nil, err
		}
		return chunked.NewHandler(conn), nil
	}
}
Example #2
0
func NewChunkedHandler(conn io.ReadWriteCloser) chunked.Handler {
	return chunked.NewHandler(conn)
}