All of the changes for func logs

This commit is contained in:
James
2017-06-19 11:38:11 -07:00
parent 8f753b779c
commit 8a3edb8309
39 changed files with 783 additions and 140 deletions

View File

@@ -10,8 +10,6 @@ import (
"gitlab-odx.oracle.com/odx/functions/api/models"
"net/http"
"net/url"
"os"
"reflect"
"time"
@@ -30,14 +28,6 @@ func setLogBuffer() *bytes.Buffer {
return &buf
}
func GetContainerHostIP() string {
dockerHost := os.Getenv("DOCKER_HOST")
if dockerHost == "" {
return "127.0.0.1"
}
parts, _ := url.Parse(dockerHost)
return parts.Hostname()
}
func Test(t *testing.T, ds models.Datastore) {
buf := setLogBuffer()

View File

@@ -15,6 +15,13 @@ type RowScanner interface {
Scan(dest ...interface{}) error
}
func ScanLog(scanner RowScanner, log *models.FnCallLog) error {
return scanner.Scan(
&log.CallID,
&log.Log,
)
}
func ScanRoute(scanner RowScanner, route *models.Route) error {
var headerStr string
var configStr string