mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update thrift, opencensus, others (#893)
* update thrift, opencensus, others * stats: update to opencensus 0.6.0 view api
This commit is contained in:
26
vendor/github.com/fnproject/fdk-go/fdk_test.go
generated
vendored
26
vendor/github.com/fnproject/fdk-go/fdk_test.go
generated
vendored
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/fnproject/fdk-go/utils"
|
||||
)
|
||||
|
||||
func echoHTTPHandler(ctx context.Context, in io.Reader, out io.Writer) {
|
||||
func echoHTTPHandler(_ context.Context, in io.Reader, out io.Writer) {
|
||||
io.Copy(out, in)
|
||||
WriteStatus(out, http.StatusTeapot+2)
|
||||
SetHeader(out, "yo", "dawg")
|
||||
@@ -67,19 +67,18 @@ func JSONHandler(_ context.Context, in io.Reader, out io.Writer) {
|
||||
}
|
||||
}
|
||||
|
||||
func JSONWithStatusCode(_ context.Context, in io.Reader, out io.Writer) {
|
||||
func JSONWithStatusCode(_ context.Context, _ io.Reader, out io.Writer) {
|
||||
SetHeader(out, "Content-Type", "application/json")
|
||||
WriteStatus(out, 201)
|
||||
}
|
||||
|
||||
func TestJSON(t *testing.T) {
|
||||
req := &utils.JsonIn{
|
||||
`{"name":"john"}`,
|
||||
"application/json",
|
||||
"someid",
|
||||
"2018-01-30T16:52:39.786Z",
|
||||
"sync",
|
||||
utils.CallRequestHTTP{
|
||||
CallID: "someid",
|
||||
Body: `{"name":"john"}`,
|
||||
ContentType: "application/json",
|
||||
Deadline: "2018-01-30T16:52:39.786Z",
|
||||
Protocol: utils.CallRequestHTTP{
|
||||
Type: "http",
|
||||
RequestURL: "someURL",
|
||||
Headers: http.Header{},
|
||||
@@ -146,12 +145,11 @@ func TestJSONEOF(t *testing.T) {
|
||||
func TestJSONOverwriteStatusCodeAndHeaders(t *testing.T) {
|
||||
var out, buf bytes.Buffer
|
||||
req := &utils.JsonIn{
|
||||
`{"name":"john"}`,
|
||||
"application/json",
|
||||
"someid",
|
||||
"2018-01-30T16:52:39.786Z",
|
||||
"sync",
|
||||
utils.CallRequestHTTP{
|
||||
CallID: "someid",
|
||||
Body: `{"name":"john"}`,
|
||||
ContentType: "application/json",
|
||||
Deadline: "2018-01-30T16:52:39.786Z",
|
||||
Protocol: utils.CallRequestHTTP{
|
||||
Type: "json",
|
||||
RequestURL: "someURL",
|
||||
Headers: http.Header{},
|
||||
|
||||
5
vendor/github.com/fnproject/fdk-go/utils/utils.go
generated
vendored
5
vendor/github.com/fnproject/fdk-go/utils/utils.go
generated
vendored
@@ -101,11 +101,10 @@ type CallRequestHTTP struct {
|
||||
}
|
||||
|
||||
type JsonIn struct {
|
||||
Body string `json:"body"`
|
||||
ContentType string `json:"content_type"`
|
||||
CallID string `json:"call_id"`
|
||||
Deadline string `json:"deadline"`
|
||||
Type string `json:"type"`
|
||||
Body string `json:"body"`
|
||||
ContentType string `json:"content_type"`
|
||||
Protocol CallRequestHTTP `json:"protocol"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user