mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
All of the changes for func logs
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user