mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Formatting issues
Aren't we running go-fmt.sh in CI?
This commit is contained in:
@@ -94,14 +94,14 @@ func TestDecimate(t *testing.T) {
|
|||||||
|
|
||||||
func TestParseImage(t *testing.T) {
|
func TestParseImage(t *testing.T) {
|
||||||
cases := map[string][]string{
|
cases := map[string][]string{
|
||||||
"fnproject/hello": {"", "fnproject/hello", "latest"},
|
"fnproject/hello": {"", "fnproject/hello", "latest"},
|
||||||
"fnproject/hello:v1": {"", "fnproject/hello", "v1"},
|
"fnproject/hello:v1": {"", "fnproject/hello", "v1"},
|
||||||
"my.registry/hello": {"my.registry", "hello", "latest"},
|
"my.registry/hello": {"my.registry", "hello", "latest"},
|
||||||
"my.registry/hello:v1": {"my.registry", "hello", "v1"},
|
"my.registry/hello:v1": {"my.registry", "hello", "v1"},
|
||||||
"mongo": {"", "library/mongo", "latest"},
|
"mongo": {"", "library/mongo", "latest"},
|
||||||
"mongo:v1": {"", "library/mongo", "v1"},
|
"mongo:v1": {"", "library/mongo", "v1"},
|
||||||
"quay.com/fnproject/hello": {"quay.com", "fnproject/hello", "latest"},
|
"quay.com/fnproject/hello": {"quay.com", "fnproject/hello", "latest"},
|
||||||
"quay.com:8080/fnproject/hello:v2": {"quay.com:8080", "fnproject/hello", "v2"},
|
"quay.com:8080/fnproject/hello:v2": {"quay.com:8080", "fnproject/hello", "v2"},
|
||||||
"localhost.localdomain:5000/samalba/hipache:latest": {"localhost.localdomain:5000", "samalba/hipache", "latest"},
|
"localhost.localdomain:5000/samalba/hipache:latest": {"localhost.localdomain:5000", "samalba/hipache", "latest"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setLogBuffer() *bytes.Buffer {
|
func setLogBuffer() *bytes.Buffer {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
"github.com/go-sql-driver/mysql"
|
"github.com/go-sql-driver/mysql"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
@@ -21,6 +20,7 @@ import (
|
|||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
"github.com/mattn/go-sqlite3"
|
"github.com/mattn/go-sqlite3"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// this aims to be an ANSI-SQL compliant package that uses only question
|
// this aims to be an ANSI-SQL compliant package that uses only question
|
||||||
@@ -71,23 +71,23 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type sqlStore struct {
|
type sqlStore struct {
|
||||||
db *sqlx.DB
|
db *sqlx.DB
|
||||||
insertAppQuery string
|
insertAppQuery string
|
||||||
updateAppQuery string
|
updateAppQuery string
|
||||||
getAppQuery string
|
getAppQuery string
|
||||||
selectAppConfigQuery string
|
selectAppConfigQuery string
|
||||||
removeAppQuery string
|
removeAppQuery string
|
||||||
insertRouteQuery string
|
insertRouteQuery string
|
||||||
updateRouteQuery string
|
updateRouteQuery string
|
||||||
checkRouteAppQuery string
|
checkRouteAppQuery string
|
||||||
checkRouteQuery string
|
checkRouteQuery string
|
||||||
getRouteQuery string
|
getRouteQuery string
|
||||||
removeRouteQuery string
|
removeRouteQuery string
|
||||||
insertCallQuery string
|
insertCallQuery string
|
||||||
getCallQuery string
|
getCallQuery string
|
||||||
insertLogQuery string
|
insertLogQuery string
|
||||||
getLogQuery string
|
getLogQuery string
|
||||||
deleteLogQuery string
|
deleteLogQuery string
|
||||||
}
|
}
|
||||||
|
|
||||||
// New will open the db specified by url, create any tables necessary
|
// New will open the db specified by url, create any tables necessary
|
||||||
@@ -147,14 +147,14 @@ func New(url *url.URL) (models.Datastore, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dstore := &sqlStore{
|
dstore := &sqlStore{
|
||||||
db: db,
|
db: db,
|
||||||
insertAppQuery: db.Rebind("INSERT INTO apps (name, config) VALUES (?, ?);"),
|
insertAppQuery: db.Rebind("INSERT INTO apps (name, config) VALUES (?, ?);"),
|
||||||
selectAppConfigQuery: db.Rebind(`SELECT config FROM apps WHERE name=?`),
|
selectAppConfigQuery: db.Rebind(`SELECT config FROM apps WHERE name=?`),
|
||||||
updateAppQuery: db.Rebind(`UPDATE apps SET config=? WHERE name=?`),
|
updateAppQuery: db.Rebind(`UPDATE apps SET config=? WHERE name=?`),
|
||||||
removeAppQuery: db.Rebind(`DELETE FROM apps WHERE name = ?`),
|
removeAppQuery: db.Rebind(`DELETE FROM apps WHERE name = ?`),
|
||||||
getAppQuery: db.Rebind(`SELECT name, config FROM apps WHERE name=?`),
|
getAppQuery: db.Rebind(`SELECT name, config FROM apps WHERE name=?`),
|
||||||
checkRouteAppQuery: db.Rebind(`SELECT 1 FROM apps WHERE name=?`),
|
checkRouteAppQuery: db.Rebind(`SELECT 1 FROM apps WHERE name=?`),
|
||||||
checkRouteQuery: db.Rebind(`SELECT 1 FROM routes WHERE app_name=? AND path=?`),
|
checkRouteQuery: db.Rebind(`SELECT 1 FROM routes WHERE app_name=? AND path=?`),
|
||||||
insertRouteQuery: db.Rebind(`INSERT INTO routes (
|
insertRouteQuery: db.Rebind(`INSERT INTO routes (
|
||||||
app_name,
|
app_name,
|
||||||
path,
|
path,
|
||||||
@@ -190,9 +190,9 @@ func New(url *url.URL) (models.Datastore, error) {
|
|||||||
path
|
path
|
||||||
)
|
)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?);`),
|
VALUES (?, ?, ?, ?, ?, ?, ?);`),
|
||||||
getCallQuery: db.Rebind(fmt.Sprintf(`%s WHERE id=? AND app_name=?`, callSelector)),
|
getCallQuery: db.Rebind(fmt.Sprintf(`%s WHERE id=? AND app_name=?`, callSelector)),
|
||||||
insertLogQuery: db.Rebind(`INSERT INTO logs (id, log) VALUES (?, ?);`),
|
insertLogQuery: db.Rebind(`INSERT INTO logs (id, log) VALUES (?, ?);`),
|
||||||
getLogQuery: db.Rebind(`SELECT log FROM logs WHERE id=?`),
|
getLogQuery: db.Rebind(`SELECT log FROM logs WHERE id=?`),
|
||||||
deleteLogQuery: db.Rebind(`DELETE FROM logs WHERE id=?`),
|
deleteLogQuery: db.Rebind(`DELETE FROM logs WHERE id=?`),
|
||||||
}
|
}
|
||||||
return dstore, nil
|
return dstore, nil
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/fnproject/fn/api/datastore/sql"
|
"github.com/fnproject/fn/api/datastore/sql"
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func New(dbURL string) (models.LogStore, error) {
|
func New(dbURL string) (models.LogStore, error) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/boltdb/bolt"
|
"github.com/boltdb/bolt"
|
||||||
"github.com/fnproject/fn/api/common"
|
"github.com/fnproject/fn/api/common"
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BoltDbMQ struct {
|
type BoltDbMQ struct {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
mq_config "github.com/iron-io/iron_go3/config"
|
mq_config "github.com/iron-io/iron_go3/config"
|
||||||
ironmq "github.com/iron-io/iron_go3/mq"
|
ironmq "github.com/iron-io/iron_go3/mq"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type assoc struct {
|
type assoc struct {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
"github.com/opentracing/opentracing-go"
|
"github.com/opentracing/opentracing-go"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New will parse the URL and return the correct MQ implementation.
|
// New will parse the URL and return the correct MQ implementation.
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/fnproject/fn/api/datastore"
|
"github.com/fnproject/fn/api/datastore"
|
||||||
"github.com/fnproject/fn/api/logs"
|
"github.com/fnproject/fn/api/logs"
|
||||||
"github.com/fnproject/fn/api/models"
|
"github.com/fnproject/fn/api/models"
|
||||||
"github.com/fnproject/fn/api/mqs"
|
"github.com/fnproject/fn/api/mqs"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setLogBuffer() *bytes.Buffer {
|
func setLogBuffer() *bytes.Buffer {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/coreos/go-semver/semver"
|
"github.com/coreos/go-semver/semver"
|
||||||
"github.com/go-sql-driver/mysql"
|
"github.com/go-sql-driver/mysql"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
"github.com/mattn/go-sqlite3"
|
"github.com/mattn/go-sqlite3"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewAllGrouper returns a Grouper that will return the entire list of nodes
|
// NewAllGrouper returns a Grouper that will return the entire list of nodes
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/coreos/go-semver/semver"
|
"github.com/coreos/go-semver/semver"
|
||||||
opentracing "github.com/opentracing/opentracing-go"
|
opentracing "github.com/opentracing/opentracing-go"
|
||||||
"github.com/opentracing/opentracing-go/ext"
|
"github.com/opentracing/opentracing-go/ext"
|
||||||
"github.com/openzipkin/zipkin-go-opentracing"
|
"github.com/openzipkin/zipkin-go-opentracing"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO the load balancers all need to have the same list of nodes. gossip?
|
// TODO the load balancers all need to have the same list of nodes. gossip?
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/coreos/go-semver/semver"
|
"github.com/coreos/go-semver/semver"
|
||||||
"github.com/fnproject/fn/fnlb/lb"
|
"github.com/fnproject/fn/fnlb/lb"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "0.0.56"
|
const VERSION = "0.0.56"
|
||||||
|
|||||||
Reference in New Issue
Block a user