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:
4
vendor/git.apache.org/thrift.git/tutorial/Makefile.am
generated
vendored
4
vendor/git.apache.org/thrift.git/tutorial/Makefile.am
generated
vendored
@@ -78,6 +78,10 @@ if WITH_RS
|
||||
SUBDIRS += rs
|
||||
endif
|
||||
|
||||
if WITH_CL
|
||||
SUBDIRS += cl
|
||||
endif
|
||||
|
||||
#
|
||||
# generate html for ThriftTest.thrift
|
||||
#
|
||||
|
||||
47
vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am
generated
vendored
Executable file
47
vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am
generated
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
gen-cl: $(top_srcdir)/tutorial/tutorial.thrift
|
||||
$(THRIFT) --gen cl -r $<
|
||||
|
||||
TutorialServer: make-tutorial-server.lisp
|
||||
$(SBCL) --script make-tutorial-server.lisp
|
||||
|
||||
TutorialClient: make-tutorial-client.lisp
|
||||
$(SBCL) --script make-tutorial-client.lisp
|
||||
|
||||
all-local: gen-cl TutorialClient TutorialServer
|
||||
|
||||
tutorialserver: all
|
||||
./TutorialServer
|
||||
|
||||
tutorialclient: all
|
||||
./TutorialClient
|
||||
|
||||
clean-local:
|
||||
$(RM) -r gen-*
|
||||
$(RM) TutorialServer
|
||||
$(RM) TutorialClient
|
||||
|
||||
EXTRA_DIST = \
|
||||
tutorial-implementation.lisp \
|
||||
shared-implementation.lisp \
|
||||
thrift-tutorial.asd \
|
||||
make-tutorial-server.lisp \
|
||||
make-tutorial-client.lisp
|
||||
51
vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp
generated
vendored
Normal file
51
vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
(in-package #:cl-user)
|
||||
|
||||
;;;; Licensed under the Apache License, Version 2.0 (the "License");
|
||||
;;;; you may not use this file except in compliance with the License.
|
||||
;;;; You may obtain a copy of the License at
|
||||
;;;;
|
||||
;;;; http://www.apache.org/licenses/LICENSE-2.0
|
||||
;;;;
|
||||
;;;; Unless required by applicable law or agreed to in writing, software
|
||||
;;;; distributed under the License is distributed on an "AS IS" BASIS,
|
||||
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
;;;; See the License for the specific language governing permissions and
|
||||
;;;; limitations under the License.
|
||||
|
||||
(require "asdf")
|
||||
(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*))
|
||||
(asdf:load-system :net.didierverna.clon)
|
||||
(asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*))
|
||||
(asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*))
|
||||
(asdf:load-asd (merge-pathnames "thrift-tutorial.asd" *load-truename*))
|
||||
(asdf:load-system :thrift-tutorial)
|
||||
|
||||
(net.didierverna.clon:nickname-package)
|
||||
|
||||
(defun main ()
|
||||
"Entry point for the binary."
|
||||
(thrift:with-client (prot #u"thrift://127.0.0.1:9090")
|
||||
(tutorial.calculator:ping prot)
|
||||
(format t "ping()~%")
|
||||
(format t "1 + 1 = ~a~%" (tutorial.calculator:add prot 1 1))
|
||||
(let ((work-instance (tutorial:make-work :num1 5
|
||||
:num2 0
|
||||
:op tutorial:operation.divide
|
||||
:comment "Booya!")))
|
||||
(handler-case (format t
|
||||
"5 / 0 = ~a - Oh, really? An exception should have been thrown here.~%"
|
||||
(tutorial.calculator:calculate prot 1 work-instance))
|
||||
(tutorial:invalidoperation (e)
|
||||
(format t "---~%(Expected) Invalid Operation caught: ~%~a~%---~%" e))))
|
||||
(let ((work-instance (tutorial:make-work :num1 15
|
||||
:num2 10
|
||||
:op tutorial:operation.subtract
|
||||
:comment "Playing nice this time.")))
|
||||
(handler-case (format t
|
||||
"15 - 10 = ~a~%"
|
||||
(tutorial.calculator:calculate prot 1 work-instance))
|
||||
(tutorial:invalidoperation (e)
|
||||
(format t "---~%(Unexpected) Invalid Operation caught: ~%~a~%---~%" e))))
|
||||
(format t "Check log: ~a~%" (shared.shared-service:get-struct prot 1))))
|
||||
|
||||
(clon:dump "TutorialClient" main)
|
||||
29
vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp
generated
vendored
Normal file
29
vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
(in-package #:cl-user)
|
||||
|
||||
;;;; Licensed under the Apache License, Version 2.0 (the "License");
|
||||
;;;; you may not use this file except in compliance with the License.
|
||||
;;;; You may obtain a copy of the License at
|
||||
;;;;
|
||||
;;;; http://www.apache.org/licenses/LICENSE-2.0
|
||||
;;;;
|
||||
;;;; Unless required by applicable law or agreed to in writing, software
|
||||
;;;; distributed under the License is distributed on an "AS IS" BASIS,
|
||||
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
;;;; See the License for the specific language governing permissions and
|
||||
;;;; limitations under the License.
|
||||
|
||||
(require "asdf")
|
||||
(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*))
|
||||
(asdf:load-system :net.didierverna.clon)
|
||||
(asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*))
|
||||
(asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*))
|
||||
(asdf:load-asd (merge-pathnames "thrift-tutorial.asd" *load-truename*))
|
||||
(asdf:load-system :thrift-tutorial)
|
||||
|
||||
(net.didierverna.clon:nickname-package)
|
||||
|
||||
(defun main ()
|
||||
"Entry point for the binary."
|
||||
(thrift:serve #u"thrift://127.0.0.1:9090" tutorial:calculator))
|
||||
|
||||
(clon:dump "TutorialServer" main)
|
||||
25
vendor/git.apache.org/thrift.git/tutorial/cl/shared-implementation.lisp
generated
vendored
Normal file
25
vendor/git.apache.org/thrift.git/tutorial/cl/shared-implementation.lisp
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
(in-package #:shared-implementation)
|
||||
|
||||
;;;; Licensed under the Apache License, Version 2.0 (the "License");
|
||||
;;;; you may not use this file except in compliance with the License.
|
||||
;;;; You may obtain a copy of the License at
|
||||
;;;;
|
||||
;;;; http://www.apache.org/licenses/LICENSE-2.0
|
||||
;;;;
|
||||
;;;; Unless required by applicable law or agreed to in writing, software
|
||||
;;;; distributed under the License is distributed on an "AS IS" BASIS,
|
||||
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
;;;; See the License for the specific language governing permissions and
|
||||
;;;; limitations under the License.
|
||||
|
||||
(defvar *structs* (make-hash-table))
|
||||
|
||||
(defun shared.shared-service-implementation:get-struct (key)
|
||||
(format t "getStruct(~a)~%" key)
|
||||
(gethash key *structs*))
|
||||
|
||||
(defun add-log (key value)
|
||||
(setf (gethash key *structs*)
|
||||
(make-instance 'shared:sharedstruct
|
||||
:key key
|
||||
:value (write-to-string value))))
|
||||
17
vendor/git.apache.org/thrift.git/tutorial/cl/thrift-tutorial.asd
generated
vendored
Normal file
17
vendor/git.apache.org/thrift.git/tutorial/cl/thrift-tutorial.asd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
;;;; Licensed under the Apache License, Version 2.0 (the "License");
|
||||
;;;; you may not use this file except in compliance with the License.
|
||||
;;;; You may obtain a copy of the License at
|
||||
;;;;
|
||||
;;;; http://www.apache.org/licenses/LICENSE-2.0
|
||||
;;;;
|
||||
;;;; Unless required by applicable law or agreed to in writing, software
|
||||
;;;; distributed under the License is distributed on an "AS IS" BASIS,
|
||||
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
;;;; See the License for the specific language governing permissions and
|
||||
;;;; limitations under the License.
|
||||
|
||||
(asdf:defsystem #:thrift-tutorial
|
||||
:depends-on (#:thrift-gen-tutorial)
|
||||
:serial t
|
||||
:components ((:file "shared-implementation")
|
||||
(:file "tutorial-implementation")))
|
||||
41
vendor/git.apache.org/thrift.git/tutorial/cl/tutorial-implementation.lisp
generated
vendored
Normal file
41
vendor/git.apache.org/thrift.git/tutorial/cl/tutorial-implementation.lisp
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
(in-package #:tutorial-implementation)
|
||||
|
||||
;;;; Licensed under the Apache License, Version 2.0 (the "License");
|
||||
;;;; you may not use this file except in compliance with the License.
|
||||
;;;; You may obtain a copy of the License at
|
||||
;;;;
|
||||
;;;; http://www.apache.org/licenses/LICENSE-2.0
|
||||
;;;;
|
||||
;;;; Unless required by applicable law or agreed to in writing, software
|
||||
;;;; distributed under the License is distributed on an "AS IS" BASIS,
|
||||
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
;;;; See the License for the specific language governing permissions and
|
||||
;;;; limitations under the License.
|
||||
|
||||
(defun tutorial.calculator-implementation:ping ()
|
||||
(format t "ping()~%"))
|
||||
|
||||
(defun tutorial.calculator-implementation:add (num1 num2)
|
||||
(format t "add(~a, ~a)~%" num1 num2)
|
||||
(+ num1 num2))
|
||||
|
||||
(defun tutorial.calculator-implementation:calculate (logid work)
|
||||
(format t "calculate(~a, ~a)~%" logid work)
|
||||
(handler-case
|
||||
(let* ((num1 (tutorial:work-num1 work))
|
||||
(num2 (tutorial:work-num2 work))
|
||||
(op (tutorial:work-op work))
|
||||
(result
|
||||
(cond
|
||||
((= op tutorial:operation.add) (+ num1 num2))
|
||||
((= op tutorial:operation.subtract) (- num1 num2))
|
||||
((= op tutorial:operation.multiply) (* num1 num2))
|
||||
((= op tutorial:operation.divide) (/ num1 num2)))))
|
||||
(shared-implementation::add-log logid result)
|
||||
result)
|
||||
(division-by-zero () (error 'tutorial:invalidoperation
|
||||
:why "Division by zero."
|
||||
:what-op (tutorial:work-op work)))))
|
||||
|
||||
(defun tutorial.calculator-implementation:zip ()
|
||||
(format t "zip()~%"))
|
||||
@@ -51,5 +51,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.11.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.11.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
@@ -51,5 +51,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.11.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.11.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
4
vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml
generated
vendored
4
vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml
generated
vendored
@@ -16,7 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
name: tutorial_client
|
||||
version: 0.11.0
|
||||
version: 1.0.0-dev
|
||||
description: A Dart client implementation of the Apache Thrift tutorial
|
||||
author: Apache Thrift Developers <dev@thrift.apache.org>
|
||||
homepage: http://thrift.apache.org
|
||||
@@ -25,7 +25,7 @@ environment:
|
||||
sdk: ">=1.13.0 <2.0.0"
|
||||
|
||||
dependencies:
|
||||
browser: ^0.11.0
|
||||
browser: ^0.10.0
|
||||
shared:
|
||||
path: ../gen-dart/shared
|
||||
thrift:
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml
generated
vendored
@@ -16,7 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
name: tutorial_console_client
|
||||
version: 0.11.0
|
||||
version: 1.0.0-dev
|
||||
description: >
|
||||
A Dart console client to implementation of the Apache Thrift tutorial
|
||||
author: Apache Thrift Developers <dev@thrift.apache.org>
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml
generated
vendored
@@ -16,7 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
name: tutorial_server
|
||||
version: 0.11.0
|
||||
version: 1.0.0-dev
|
||||
description: A Dart server to support the Apache Thrift tutorial
|
||||
author: Apache Thrift Developers <dev@thrift.apache.org>
|
||||
homepage: http://thrift.apache.org
|
||||
|
||||
4
vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj
generated
vendored
4
vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj
generated
vendored
@@ -97,13 +97,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription">Thrift Tutorial</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">0.11.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName">DelphiClient</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright">Copyright © 2012 The Apache Software Foundation</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename">DelphiClient.exe</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName">Thrift</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">0.11.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
|
||||
4
vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj
generated
vendored
4
vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj
generated
vendored
@@ -96,13 +96,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription">Thrift Tutorial</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">0.11.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName">DelphiServer</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright">Copyright © 2012 The Apache Software Foundation</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename">DelphiServer.exe</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName">Thrift</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">0.11.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
|
||||
10
vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am
generated
vendored
10
vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am
generated
vendored
@@ -17,10 +17,6 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
if GOVERSION_LT_17
|
||||
COMPILER_EXTRAFLAG=":legacy_context"
|
||||
endif
|
||||
|
||||
gen-go/tutorial/calculator.go gen-go/shared/shared_service.go: $(top_srcdir)/tutorial/tutorial.thrift
|
||||
$(THRIFT) --gen go$(COMPILER_EXTRAFLAG) -r $<
|
||||
|
||||
@@ -37,9 +33,6 @@ src/git.apache.org/thrift.git/lib/go/thrift:
|
||||
ln -sf $(realpath $(top_srcdir)/lib/go/thrift) src/git.apache.org/thrift.git/lib/go/thrift
|
||||
|
||||
thirdparty-dep:
|
||||
mkdir -p src/golang.org/x/net
|
||||
GOPATH=`pwd`/gopath $(GO) get golang.org/x/net/context
|
||||
ln -sf `pwd`/gopath/src/golang.org/x/net/context src/golang.org/x/net/context
|
||||
|
||||
tutorialserver: all
|
||||
GOPATH=`pwd` $(GO) run src/*.go -server=true
|
||||
@@ -61,9 +54,6 @@ EXTRA_DIST = \
|
||||
src/handler.go \
|
||||
src/server.go \
|
||||
src/main.go \
|
||||
src/go17.go \
|
||||
src/handler_go17.go \
|
||||
src/pre_go17.go \
|
||||
server.crt \
|
||||
server.key
|
||||
|
||||
|
||||
3
vendor/git.apache.org/thrift.git/tutorial/go/src/client.go
generated
vendored
3
vendor/git.apache.org/thrift.git/tutorial/go/src/client.go
generated
vendored
@@ -20,6 +20,7 @@ package main
|
||||
*/
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"tutorial"
|
||||
@@ -27,6 +28,8 @@ import (
|
||||
"git.apache.org/thrift.git/lib/go/thrift"
|
||||
)
|
||||
|
||||
var defaultCtx = context.Background()
|
||||
|
||||
func handleClient(client *tutorial.CalculatorClient) (err error) {
|
||||
client.Ping(defaultCtx)
|
||||
fmt.Println("ping()")
|
||||
|
||||
26
vendor/git.apache.org/thrift.git/tutorial/go/src/go17.go
generated
vendored
26
vendor/git.apache.org/thrift.git/tutorial/go/src/go17.go
generated
vendored
@@ -1,26 +0,0 @@
|
||||
// +build go1.7
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import "context"
|
||||
|
||||
var defaultCtx = context.Background()
|
||||
5
vendor/git.apache.org/thrift.git/tutorial/go/src/handler.go
generated
vendored
5
vendor/git.apache.org/thrift.git/tutorial/go/src/handler.go
generated
vendored
@@ -1,5 +1,3 @@
|
||||
// +build !go1.7
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
@@ -22,12 +20,11 @@ package main
|
||||
*/
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"shared"
|
||||
"strconv"
|
||||
"tutorial"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type CalculatorHandler struct {
|
||||
|
||||
104
vendor/git.apache.org/thrift.git/tutorial/go/src/handler_go17.go
generated
vendored
104
vendor/git.apache.org/thrift.git/tutorial/go/src/handler_go17.go
generated
vendored
@@ -1,104 +0,0 @@
|
||||
// +build go1.7
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"shared"
|
||||
"strconv"
|
||||
"tutorial"
|
||||
)
|
||||
|
||||
type CalculatorHandler struct {
|
||||
log map[int]*shared.SharedStruct
|
||||
}
|
||||
|
||||
func NewCalculatorHandler() *CalculatorHandler {
|
||||
return &CalculatorHandler{log: make(map[int]*shared.SharedStruct)}
|
||||
}
|
||||
|
||||
func (p *CalculatorHandler) Ping(ctx context.Context) (err error) {
|
||||
fmt.Print("ping()\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *CalculatorHandler) Add(ctx context.Context, num1 int32, num2 int32) (retval17 int32, err error) {
|
||||
fmt.Print("add(", num1, ",", num2, ")\n")
|
||||
return num1 + num2, nil
|
||||
}
|
||||
|
||||
func (p *CalculatorHandler) Calculate(ctx context.Context, logid int32, w *tutorial.Work) (val int32, err error) {
|
||||
fmt.Print("calculate(", logid, ", {", w.Op, ",", w.Num1, ",", w.Num2, "})\n")
|
||||
switch w.Op {
|
||||
case tutorial.Operation_ADD:
|
||||
val = w.Num1 + w.Num2
|
||||
break
|
||||
case tutorial.Operation_SUBTRACT:
|
||||
val = w.Num1 - w.Num2
|
||||
break
|
||||
case tutorial.Operation_MULTIPLY:
|
||||
val = w.Num1 * w.Num2
|
||||
break
|
||||
case tutorial.Operation_DIVIDE:
|
||||
if w.Num2 == 0 {
|
||||
ouch := tutorial.NewInvalidOperation()
|
||||
ouch.WhatOp = int32(w.Op)
|
||||
ouch.Why = "Cannot divide by 0"
|
||||
err = ouch
|
||||
return
|
||||
}
|
||||
val = w.Num1 / w.Num2
|
||||
break
|
||||
default:
|
||||
ouch := tutorial.NewInvalidOperation()
|
||||
ouch.WhatOp = int32(w.Op)
|
||||
ouch.Why = "Unknown operation"
|
||||
err = ouch
|
||||
return
|
||||
}
|
||||
entry := shared.NewSharedStruct()
|
||||
entry.Key = logid
|
||||
entry.Value = strconv.Itoa(int(val))
|
||||
k := int(logid)
|
||||
/*
|
||||
oldvalue, exists := p.log[k]
|
||||
if exists {
|
||||
fmt.Print("Replacing ", oldvalue, " with ", entry, " for key ", k, "\n")
|
||||
} else {
|
||||
fmt.Print("Adding ", entry, " for key ", k, "\n")
|
||||
}
|
||||
*/
|
||||
p.log[k] = entry
|
||||
return val, err
|
||||
}
|
||||
|
||||
func (p *CalculatorHandler) GetStruct(ctx context.Context, key int32) (*shared.SharedStruct, error) {
|
||||
fmt.Print("getStruct(", key, ")\n")
|
||||
v, _ := p.log[int(key)]
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (p *CalculatorHandler) Zip(ctx context.Context) (err error) {
|
||||
fmt.Print("zip()\n")
|
||||
return nil
|
||||
}
|
||||
26
vendor/git.apache.org/thrift.git/tutorial/go/src/pre_go17.go
generated
vendored
26
vendor/git.apache.org/thrift.git/tutorial/go/src/pre_go17.go
generated
vendored
@@ -1,26 +0,0 @@
|
||||
// +build !go1.7
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import "golang.org/x/net/context"
|
||||
|
||||
var defaultCtx = context.Background()
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal
generated
vendored
@@ -18,7 +18,7 @@
|
||||
--
|
||||
|
||||
Name: ThriftTutorial
|
||||
Version: 0.11.0
|
||||
Version: 0.1.0
|
||||
Cabal-Version: >= 1.4
|
||||
License: OtherLicense
|
||||
Category: Foreign
|
||||
|
||||
12
vendor/git.apache.org/thrift.git/tutorial/java/build.xml
generated
vendored
12
vendor/git.apache.org/thrift.git/tutorial/java/build.xml
generated
vendored
@@ -25,11 +25,13 @@
|
||||
<property name="build" location="build" />
|
||||
|
||||
<path id="libs.classpath">
|
||||
<fileset dir="../../lib/java/build">
|
||||
<include name="*.jar" />
|
||||
<exclude name="-test.jar" />
|
||||
<fileset dir="../../lib/java/build/libs">
|
||||
<include name="libthrift*.jar" />
|
||||
<exclude name="libthrift*test.jar" />
|
||||
<exclude name="libthrift*javadoc.jar" />
|
||||
<exclude name="libthrift*sources.jar" />
|
||||
</fileset>
|
||||
<fileset dir="../../lib/java/build/lib">
|
||||
<fileset dir="../../lib/java/build/deps">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
@@ -42,7 +44,7 @@
|
||||
<pathelement path="${build}" />
|
||||
<pathelement path="tutorial.jar" />
|
||||
</path>
|
||||
|
||||
|
||||
<target name="init">
|
||||
<tstamp />
|
||||
<mkdir dir="${build}"/>
|
||||
|
||||
12
vendor/git.apache.org/thrift.git/tutorial/js/build.xml
generated
vendored
12
vendor/git.apache.org/thrift.git/tutorial/js/build.xml
generated
vendored
@@ -31,11 +31,13 @@
|
||||
<property name="thrift.java.dir" location="${thrift.dir}/lib/java" />
|
||||
|
||||
<path id="libs.classpath">
|
||||
<fileset dir="../../lib/java/build">
|
||||
<include name="*.jar" />
|
||||
<exclude name="-test.jar" />
|
||||
<fileset dir="${thrift.java.dir}/build/libs">
|
||||
<include name="libthrift*.jar" />
|
||||
<exclude name="libthrift*test.jar" />
|
||||
<exclude name="libthrift*javadoc.jar" />
|
||||
<exclude name="libthrift*sources.jar" />
|
||||
</fileset>
|
||||
<fileset dir="../../lib/java/build/lib">
|
||||
<fileset dir="${thrift.java.dir}/build/deps">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
@@ -80,7 +82,7 @@
|
||||
<arg line="--gen js -r ../tutorial.thrift"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="${build}" />
|
||||
<delete dir="gen-js"/>
|
||||
|
||||
20
vendor/git.apache.org/thrift.git/tutorial/netcore/Client/Program.cs
generated
vendored
20
vendor/git.apache.org/thrift.git/tutorial/netcore/Client/Program.cs
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// Licensed to the Apache Software Foundation(ASF) under one
|
||||
// Licensed to the Apache Software Foundation(ASF) under one
|
||||
// or more contributor license agreements.See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership.The ASF licenses this file
|
||||
@@ -42,14 +42,14 @@ namespace Client
|
||||
{
|
||||
Logger.LogInformation(@"
|
||||
Usage:
|
||||
Client.exe -h
|
||||
Client.exe -help
|
||||
will diplay help information
|
||||
|
||||
Client.exe -t:<transport> -p:<protocol> -mc:<numClients>
|
||||
Client.exe -tr:<transport> -pr:<protocol> -mc:<numClients>
|
||||
will run client with specified arguments (tcp transport and binary protocol by default) and with 1 client
|
||||
|
||||
Options:
|
||||
-t (transport):
|
||||
-tr (transport):
|
||||
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
|
||||
tcpbuffered - buffered transport over tcp will be used (host - ""localhost"", port - 9090)
|
||||
namedpipe - namedpipe transport will be used (pipe address - "".test"")
|
||||
@@ -57,7 +57,7 @@ Options:
|
||||
tcptls - tcp tls transport will be used (host - ""localhost"", port - 9090)
|
||||
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
|
||||
|
||||
-p (protocol):
|
||||
-pr (protocol):
|
||||
binary - (default) binary protocol will be used
|
||||
compact - compact protocol will be used
|
||||
json - json protocol will be used
|
||||
@@ -67,7 +67,7 @@ Options:
|
||||
<numClients> - number of multiple clients to connect to server (max 100, default 1)
|
||||
|
||||
Sample:
|
||||
Client.exe -t:tcp -p:binary
|
||||
Client.exe -tr:tcp -p:binary
|
||||
");
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ Sample:
|
||||
{
|
||||
args = args ?? new string[0];
|
||||
|
||||
if (args.Any(x => x.StartsWith("-h", StringComparison.OrdinalIgnoreCase)))
|
||||
if (args.Any(x => x.StartsWith("-help", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
DisplayHelp();
|
||||
return;
|
||||
@@ -127,7 +127,7 @@ Sample:
|
||||
|
||||
private static TClientTransport GetTransport(string[] args)
|
||||
{
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-t"))?.Split(':')?[1];
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':')?[1];
|
||||
|
||||
Transport selectedTransport;
|
||||
if (Enum.TryParse(transport, true, out selectedTransport))
|
||||
@@ -203,7 +203,7 @@ Sample:
|
||||
|
||||
private static Tuple<Protocol, TProtocol> GetProtocol(string[] args, TClientTransport transport)
|
||||
{
|
||||
var protocol = args.FirstOrDefault(x => x.StartsWith("-p"))?.Split(':')?[1];
|
||||
var protocol = args.FirstOrDefault(x => x.StartsWith("-pr"))?.Split(':')?[1];
|
||||
|
||||
Protocol selectedProtocol;
|
||||
if (Enum.TryParse(protocol, true, out selectedProtocol))
|
||||
@@ -352,4 +352,4 @@ Sample:
|
||||
Multiplexed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
vendor/git.apache.org/thrift.git/tutorial/netcore/Interfaces/.gitignore
generated
vendored
Normal file
3
vendor/git.apache.org/thrift.git/tutorial/netcore/Interfaces/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# ignore for autogenerated files
|
||||
/shared
|
||||
/tutorial
|
||||
10
vendor/git.apache.org/thrift.git/tutorial/netcore/Interfaces/Interfaces.csproj
generated
vendored
10
vendor/git.apache.org/thrift.git/tutorial/netcore/Interfaces/Interfaces.csproj
generated
vendored
@@ -17,4 +17,14 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.ServiceModel.Primitives" Version="[4.4,)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile">
|
||||
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" />
|
||||
</Exec>
|
||||
<Exec Condition="Exists('$(PathToThrift)')" Command="$(PathToThrift) -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
|
||||
<Exec Condition="Exists('thrift')" Command="thrift -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
|
||||
<Exec Condition="Exists('./../../../compiler/cpp/thrift')" Command="./../../../compiler/cpp/thrift -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
49
vendor/git.apache.org/thrift.git/tutorial/netcore/Makefile.am
generated
vendored
49
vendor/git.apache.org/thrift.git/tutorial/netcore/Makefile.am
generated
vendored
@@ -19,39 +19,11 @@
|
||||
|
||||
SUBDIRS = .
|
||||
|
||||
THRIFT = $(top_builddir)/compiler/cpp/thrift
|
||||
|
||||
GENDIR = Interfaces/gen-netcore
|
||||
|
||||
# Due to a known issue with "dotnet restore" the Thrift.dll dependency cannot be resolved from cmdline.
|
||||
# The problem does NOT affect Visual Studio builds, only cmdline.
|
||||
# - For details see https://github.com/dotnet/cli/issues/3199 and related tickets.
|
||||
# - Workaround is to temporarily copy the Thrift project into the solution
|
||||
COPYCMD = cp -u -p -r
|
||||
|
||||
|
||||
THRIFTCODE = \
|
||||
Interfaces/Properties/AssemblyInfo.cs \
|
||||
Client/Properties/AssemblyInfo.cs \
|
||||
Client/Program.cs \
|
||||
Server/Properties/AssemblyInfo.cs \
|
||||
Server/Program.cs
|
||||
|
||||
all-local: \
|
||||
Client.exe
|
||||
|
||||
Client.exe: $(THRIFTCODE)
|
||||
$(MKDIR_P) $(GENDIR)
|
||||
$(THRIFT) -gen netcore:wcf -r -out $(GENDIR) $(top_srcdir)/tutorial/tutorial.thrift
|
||||
$(DOTNETCORE) --info
|
||||
$(DOTNETCORE) restore
|
||||
all-local:
|
||||
$(DOTNETCORE) build
|
||||
|
||||
clean-local:
|
||||
$(RM) Client.exe
|
||||
$(RM) Server.exe
|
||||
$(RM) Interfaces.dll
|
||||
$(RM) -r $(GENDIR)
|
||||
$(RM) -r Client/bin
|
||||
$(RM) -r Client/obj
|
||||
$(RM) -r Server/bin
|
||||
@@ -60,16 +32,11 @@ clean-local:
|
||||
$(RM) -r Interfaces/obj
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(THRIFTCODE) \
|
||||
Tutorial.sln \
|
||||
Interfaces/Interfaces.csproj \
|
||||
Client/Client.csproj \
|
||||
Client/ThriftTest.pfx \
|
||||
Client/Properties/launchSettings.json \
|
||||
Server/Server.csproj \
|
||||
Server/ThriftTest.pfx \
|
||||
Server/Properties/launchSettings.json \
|
||||
build.cmd \
|
||||
build.sh \
|
||||
README.md
|
||||
Client \
|
||||
Interfaces \
|
||||
README.md \
|
||||
Server \
|
||||
Tutorial.sln \
|
||||
build.cmd \
|
||||
build.sh
|
||||
|
||||
|
||||
27
vendor/git.apache.org/thrift.git/tutorial/netcore/README.md
generated
vendored
27
vendor/git.apache.org/thrift.git/tutorial/netcore/README.md
generated
vendored
@@ -1,11 +1,11 @@
|
||||
# Building of samples for different platforms
|
||||
|
||||
# Reused components
|
||||
- NET Core Standard 1.6 (SDK 1.0.0-preview2-003121)
|
||||
- NET Core App 1.1
|
||||
- NET Core Standard 2.0
|
||||
- NET Core App 2.0
|
||||
|
||||
# How to build
|
||||
- Download and install .NET Core SDK for your platform https://www.microsoft.com/net/core#windowsvs2015 (archive for SDK 1.0.0-preview2-003121 located by: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md)
|
||||
- Download and install the latest .NET Core SDK for your platform https://www.microsoft.com/net/core#windowsvs2015 (archive for SDK 1.0.0-preview2-003121 located by: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md)
|
||||
- Ensure that you have thrift.exe which supports netcore lib and it added to PATH
|
||||
- Go to current folder
|
||||
- Run **build.sh** or **build.cmd** from the root of cloned repository
|
||||
@@ -18,16 +18,13 @@ Notes: dotnet run supports passing arguments to app after -- symbols (https://do
|
||||
|
||||
- build
|
||||
- go to folder (Client/Server)
|
||||
- run with specifying of correct parameters **dotnet run -t:tcp -p:multiplexed**, **dotnet run -help** (later, after migration to csproj and latest SDK will be possibility to use more usable form **dotnet run -- arguments**)
|
||||
- run with specifying of correct parameters **dotnet run -tr:tcp -pr:multiplexed**, **dotnet run -help** (later, after migration to csproj and latest SDK will be possibility to use more usable form **dotnet run -- arguments**)
|
||||
|
||||
#Notes
|
||||
- Migration to .NET Standard 2.0 planned for later (Q1 2017) according to https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/
|
||||
- Possible adding additional platforms after stabilization of .NET Core (runtimes, platforms (Red Hat Linux, OpenSuse, etc.)
|
||||
|
||||
#Known issues
|
||||
- In trace logging mode you can see some not important internal exceptions
|
||||
- Ubuntu 16.10 still not supported fully
|
||||
- There is some problems with .NET Core CLI and usage specific -r|--runtime for building and publishing projects with different target frameworks (netstandard1.6 and netcoreapp1.1)
|
||||
|
||||
# Running of samples
|
||||
Please install Thrift C# .NET Core library or copy sources and build them to correcly build and run samples
|
||||
@@ -39,12 +36,12 @@ Usage:
|
||||
Server.exe -h
|
||||
will diplay help information
|
||||
|
||||
Server.exe -t:<transport> -p:<protocol>
|
||||
Server.exe -tr:<transport> -pr:<protocol>
|
||||
will run server with specified arguments (tcp transport and binary protocol by default)
|
||||
|
||||
Options:
|
||||
|
||||
-t (transport):
|
||||
-tr (transport):
|
||||
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
|
||||
tcpbuffered - tcp buffered transport will be used (host - ""localhost"", port - 9090)
|
||||
namedpipe - namedpipe transport will be used (pipe address - "".test"")
|
||||
@@ -52,14 +49,14 @@ Options:
|
||||
tcptls - tcp transport with tls will be used (host - ""localhost"", port - 9090)
|
||||
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
|
||||
|
||||
-p (protocol):
|
||||
-pr (protocol):
|
||||
binary - (default) binary protocol will be used
|
||||
compact - compact protocol will be used
|
||||
json - json protocol will be used
|
||||
|
||||
Sample:
|
||||
|
||||
Server.exe -t:tcp
|
||||
Server.exe -tr:tcp
|
||||
|
||||
**Remarks**:
|
||||
|
||||
@@ -75,12 +72,12 @@ Usage:
|
||||
Client.exe -h
|
||||
will diplay help information
|
||||
|
||||
Client.exe -t:<transport> -p:<protocol> -mc:<numClients>
|
||||
Client.exe -tr:<transport> -pr:<protocol> -mc:<numClients>
|
||||
will run client with specified arguments (tcp transport and binary protocol by default)
|
||||
|
||||
Options:
|
||||
|
||||
-t (transport):
|
||||
-tr (transport):
|
||||
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
|
||||
tcpbuffered - buffered transport over tcp will be used (host - ""localhost"", port - 9090)
|
||||
namedpipe - namedpipe transport will be used (pipe address - "".test"")
|
||||
@@ -88,7 +85,7 @@ Options:
|
||||
tcptls - tcp tls transport will be used (host - ""localhost"", port - 9090)
|
||||
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
|
||||
|
||||
-p (protocol):
|
||||
-pr (protocol):
|
||||
binary - (default) binary protocol will be used
|
||||
compact - compact protocol will be used
|
||||
json - json protocol will be used
|
||||
@@ -98,7 +95,7 @@ Options:
|
||||
|
||||
Sample:
|
||||
|
||||
Client.exe -t:tcp -p:binary -mc:10
|
||||
Client.exe -tr:tcp -pr:binary -mc:10
|
||||
|
||||
Remarks:
|
||||
|
||||
|
||||
27
vendor/git.apache.org/thrift.git/tutorial/netcore/Server/Program.cs
generated
vendored
27
vendor/git.apache.org/thrift.git/tutorial/netcore/Server/Program.cs
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// Licensed to the Apache Software Foundation(ASF) under one
|
||||
// Licensed to the Apache Software Foundation(ASF) under one
|
||||
// or more contributor license agreements.See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership.The ASF licenses this file
|
||||
@@ -46,7 +46,7 @@ namespace Server
|
||||
{
|
||||
args = args ?? new string[0];
|
||||
|
||||
if (args.Any(x => x.StartsWith("-h", StringComparison.OrdinalIgnoreCase)))
|
||||
if (args.Any(x => x.StartsWith("-help", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
DisplayHelp();
|
||||
return;
|
||||
@@ -69,14 +69,14 @@ namespace Server
|
||||
{
|
||||
Logger.LogInformation(@"
|
||||
Usage:
|
||||
Server.exe -h
|
||||
Server.exe -help
|
||||
will diplay help information
|
||||
|
||||
Server.exe -t:<transport> -p:<protocol>
|
||||
Server.exe -tr:<transport> -pr:<protocol>
|
||||
will run server with specified arguments (tcp transport and binary protocol by default)
|
||||
|
||||
Options:
|
||||
-t (transport):
|
||||
-tr (transport):
|
||||
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
|
||||
tcpbuffered - tcp buffered transport will be used (host - ""localhost"", port - 9090)
|
||||
namedpipe - namedpipe transport will be used (pipe address - "".test"")
|
||||
@@ -84,14 +84,14 @@ Options:
|
||||
tcptls - tcp transport with tls will be used (host - ""localhost"", port - 9090)
|
||||
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
|
||||
|
||||
-p (protocol):
|
||||
-pr (protocol):
|
||||
binary - (default) binary protocol will be used
|
||||
compact - compact protocol will be used
|
||||
json - json protocol will be used
|
||||
multiplexed - multiplexed protocol will be used
|
||||
|
||||
Sample:
|
||||
Server.exe -t:tcp
|
||||
Server.exe -tr:tcp
|
||||
");
|
||||
}
|
||||
|
||||
@@ -112,20 +112,18 @@ Sample:
|
||||
|
||||
private static Protocol GetProtocol(string[] args)
|
||||
{
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-p"))?.Split(':')?[1];
|
||||
Protocol selectedProtocol;
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-pr"))?.Split(':')?[1];
|
||||
|
||||
Enum.TryParse(transport, true, out selectedProtocol);
|
||||
Enum.TryParse(transport, true, out Protocol selectedProtocol);
|
||||
|
||||
return selectedProtocol;
|
||||
}
|
||||
|
||||
private static Transport GetTransport(string[] args)
|
||||
{
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-t"))?.Split(':')?[1];
|
||||
Transport selectedTransport;
|
||||
var transport = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':')?[1];
|
||||
|
||||
Enum.TryParse(transport, true, out selectedTransport);
|
||||
Enum.TryParse(transport, true, out Transport selectedTransport);
|
||||
|
||||
return selectedTransport;
|
||||
}
|
||||
@@ -288,11 +286,10 @@ Sample:
|
||||
.UseKestrel()
|
||||
.UseUrls("http://localhost:9090")
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
host.StartAsync(cancellationToken); // was Run() in earlier .NET Core SDKs?
|
||||
host.RunAsync(cancellationToken).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public class Startup
|
||||
|
||||
78
vendor/git.apache.org/thrift.git/tutorial/netcore/Tutorial.sln
generated
vendored
78
vendor/git.apache.org/thrift.git/tutorial/netcore/Tutorial.sln
generated
vendored
@@ -1,68 +1,78 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26114.2
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thrift", "..\..\lib\netcore\Thrift\Thrift.csproj", "{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Thrift", "..\..\lib\netcore\Thrift\Thrift.csproj", "{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interfaces", "Interfaces\Interfaces.csproj", "{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Interfaces", "Interfaces\Interfaces.csproj", "{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6850CF46-5467-4C65-BD78-871581C539FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6850CF46-5467-4C65-BD78-871581C539FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6850CF46-5467-4C65-BD78-871581C539FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6850CF46-5467-4C65-BD78-871581C539FC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x86.Build.0 = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.Build.0 = Debug|x64
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.Build.0 = Debug|x86
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.ActiveCfg = Release|x64
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.Build.0 = Release|x64
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.ActiveCfg = Release|x86
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.Build.0 = Release|x86
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.Build.0 = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.Build.0 = Debug|x64
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.Build.0 = Debug|x86
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.ActiveCfg = Release|x64
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.Build.0 = Release|x64
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.ActiveCfg = Release|x86
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.Build.0 = Release|x86
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.Build.0 = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.Build.0 = Debug|x86
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.Build.0 = Release|x64
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.ActiveCfg = Release|x86
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.Build.0 = Release|x86
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {070A5D1D-B29D-4603-999D-693DB444AD0D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
5
vendor/git.apache.org/thrift.git/tutorial/netcore/build.cmd
generated
vendored
5
vendor/git.apache.org/thrift.git/tutorial/netcore/build.cmd
generated
vendored
@@ -19,12 +19,7 @@ rem * under the License.
|
||||
rem */
|
||||
setlocal
|
||||
|
||||
cd Interfaces
|
||||
thrift -gen netcore:wcf -r ..\..\tutorial.thrift
|
||||
cd ..
|
||||
|
||||
dotnet --info
|
||||
dotnet restore
|
||||
dotnet build
|
||||
|
||||
:eof
|
||||
|
||||
5
vendor/git.apache.org/thrift.git/tutorial/netcore/build.sh
generated
vendored
5
vendor/git.apache.org/thrift.git/tutorial/netcore/build.sh
generated
vendored
@@ -22,10 +22,5 @@
|
||||
#exit if any command fails
|
||||
set -e
|
||||
|
||||
cd Interfaces
|
||||
../../../compiler/cpp/thrift -gen netcore:wcf -r ../../tutorial.thrift
|
||||
cd ..
|
||||
|
||||
dotnet --info
|
||||
dotnet restore
|
||||
dotnet build
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis
generated
vendored
@@ -1,5 +1,5 @@
|
||||
Name: tutorial
|
||||
Version: 0.11.0
|
||||
Version: 1.0
|
||||
OASISFormat: 0.3
|
||||
Synopsis: OCaml Tutorial example
|
||||
Authors: Apache Thrift Developers <dev@thrift.apache.org>
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/php/PhpClient.php
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/php/PhpClient.php
generated
vendored
@@ -5,7 +5,7 @@ namespace tutorial\php;
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
|
||||
require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
|
||||
|
||||
use Thrift\ClassLoader\ThriftClassLoader;
|
||||
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/php/PhpServer.php
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/php/PhpServer.php
generated
vendored
@@ -5,7 +5,7 @@ namespace tutorial\php;
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
|
||||
require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
|
||||
|
||||
use Thrift\ClassLoader\ThriftClassLoader;
|
||||
|
||||
|
||||
1
vendor/git.apache.org/thrift.git/tutorial/shared.thrift
generated
vendored
1
vendor/git.apache.org/thrift.git/tutorial/shared.thrift
generated
vendored
@@ -22,6 +22,7 @@
|
||||
* these definitions.
|
||||
*/
|
||||
|
||||
namespace cl shared
|
||||
namespace cpp shared
|
||||
namespace d share // "shared" would collide with the eponymous D keyword.
|
||||
namespace dart shared
|
||||
|
||||
2
vendor/git.apache.org/thrift.git/tutorial/tutorial.thrift
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/tutorial.thrift
generated
vendored
@@ -62,6 +62,8 @@ include "shared.thrift"
|
||||
* Thrift files can namespace, package, or prefix their output in various
|
||||
* target languages.
|
||||
*/
|
||||
|
||||
namespace cl tutorial
|
||||
namespace cpp tutorial
|
||||
namespace d tutorial
|
||||
namespace dart tutorial
|
||||
|
||||
Reference in New Issue
Block a user