-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
746 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
eendpoint "github.com/pip-services3-go/pip-services3-rpc-go/example/custom_endpoint/endpoint" | ||
elogic "github.com/pip-services3-go/pip-services3-rpc-go/example/custom_endpoint/logic" | ||
eservices "github.com/pip-services3-go/pip-services3-rpc-go/example/custom_endpoint/services" | ||
|
||
eclients "github.com/pip-services3-go/pip-services3-rpc-go/example/custom_endpoint/clients" | ||
|
||
cconf "github.com/pip-services3-go/pip-services3-commons-go/config" | ||
cref "github.com/pip-services3-go/pip-services3-commons-go/refer" | ||
) | ||
|
||
func main() { | ||
service := BuildRestService() | ||
client := BuildRestClient() | ||
|
||
err := service.Open("") | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer service.Close("") | ||
defer service.Endpoint.Close("") | ||
|
||
err = client.Open("") | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer client.Close("") | ||
|
||
res, err := client.SayHello("example", "Jhon") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Printf("Response from Server: %s", res) | ||
} | ||
|
||
const ( | ||
Port = 3000 | ||
Protocol = "https" | ||
Host = "localhost" | ||
) | ||
|
||
func BuildRestService() *eservices.MyRestService { | ||
// Create custom endpoint | ||
endpointConfig := cconf.NewConfigParamsFromTuples( | ||
"root_path", "", | ||
"cors_headers", "x-session-id", | ||
|
||
"connection.protocol", Protocol, | ||
"connection.host", Host, | ||
"connection.port", Port, | ||
|
||
"endpoint_config.ssl_key_file", "../certs/server.key", | ||
"endpoint_config.ssl_crt_file", "../certs/server.crt", | ||
"endpoint_config.ssl_ca_file", "../certs/ca.crt", | ||
|
||
"endpoint_config.client_auth_type", "require_and_verify_client_cert", | ||
) | ||
|
||
eendpoint := eendpoint.NewMyHttpEndpoint() | ||
eendpoint.Configure(endpointConfig) | ||
|
||
// Create Service | ||
serviceConfig := cconf.NewConfigParamsFromTuples( | ||
"connection.protocol", Protocol, | ||
"connection.host", Host, | ||
"connection.port", Port, | ||
"openapi_content", "swagger yaml or json content", | ||
"swagger.enable", "true", | ||
) | ||
|
||
ctrl := elogic.NewMyController() | ||
|
||
service := eservices.NewMyRestService() | ||
service.Configure(serviceConfig) | ||
|
||
var references *cref.References = cref.NewReferencesFromTuples( | ||
cref.NewDescriptor("pip-services-dummies", "controller", "default", "default", "1.0"), ctrl, | ||
cref.NewDescriptor("pip-services-dummies", "service", "rest", "default", "1.0"), service, | ||
cref.NewDescriptor("pip-services-dummies", "endpoint", "http", "custom", "1.0"), eendpoint, | ||
) | ||
|
||
eendpoint.SetReferences(references) | ||
service.SetReferences(references) | ||
|
||
eendpoint.Open("") | ||
return service | ||
} | ||
|
||
func BuildRestClient() *eclients.MyRestClient { | ||
clientConfig := cconf.NewConfigParamsFromTuples( | ||
"connection.protocol", Protocol, | ||
"connection.host", Host, | ||
"connection.port", Port, | ||
|
||
"rest_client_config.correlation_id_place", "headers", | ||
|
||
"rest_client_config.ssl_key_file", "../certs/client.key", | ||
"rest_client_config.ssl_crt_file", "../certs/client.crt", | ||
"rest_client_config.ssl_ca_file", "../certs/ca.crt", | ||
) | ||
|
||
client := eclients.NewMyRestClient() | ||
|
||
client.Configure(clientConfig) | ||
client.SetReferences(cref.NewEmptyReferences()) | ||
|
||
return client | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-----BEGIN X509 CRL----- | ||
MIICfDBmAgEBMA0GCSqGSIb3DQEBCwUAMA0xCzAJBgNVBAMTAmNhFw0yMzA3Mjgx | ||
NjMyMDBaFw0yNTAxMjgxNjMyMDBaMACgIzAhMB8GA1UdIwQYMBaAFIkcup4xuoZh | ||
Ly5cRUbPs7l1ZbCzMA0GCSqGSIb3DQEBCwUAA4ICAQDDokwX3MOnEiodk/M5zNj/ | ||
QoRDxstEYfbbe8wLwpUQfzpdGjHhVD/Ba1B7v2D/gen0q6PdOrjLFYHRN3GonXrR | ||
L4WIcc+M+Z0Tx3VD27eM/ot6PmLr2/837brkRIdpIXmARQyu+utSWpFFXCBgp206 | ||
jst+AEe8XHO/vJlnS06EwZnrhJa/2Nqigc1xfaI/IAPpnn/G2tvOkVth8BasbhIu | ||
5GWIxyABenJIFNQQ7tzL3dUJOveyU1YlV+3wqVy7RBV/wu/z0pdH2GLvEz0mwD1A | ||
1fhCweIH7iG7ljfAAU61V0uY4JMvhmjlfJT11fctY8lwjQdMV0QxaPlivetiwfqm | ||
YqCjFTO87SPA8uZUnwnZt4mEGBZ99PKYI4Yymx6bf+MPi437n95d0+pMm5oBuWvy | ||
6WwCv4BL52ul6KJsQ0TF6T2KPp2E5lVIcWDtg6VPscZlwEJyBwtQhyCW3pC4QrZt | ||
vpJ/VMY8eI7ncTePL4mMJuz/BgvJrqcw/PC0M2i6UgsemQn7vEsYYy43Uw2CNlwu | ||
IIz1m8shURtXhSAQYVRQFrbm1apq9hB0ktzCT5DlZ0UwoMNkxOL+7xAtfvl/WL02 | ||
52QJZ0bDjacXLuDdf8jAo6KmaFni5kO8PZzFedTjmmLExIdQKWlZkGHbYlv3OmDs | ||
7Xyo1w7rAsQpMVHgQjikVg== | ||
-----END X509 CRL----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIE2jCCAsKgAwIBAgIBATANBgkqhkiG9w0BAQsFADANMQswCQYDVQQDEwJjYTAe | ||
Fw0yMzA3MjgxNjIyMDBaFw0yNTAxMjgxNjMyMDBaMA0xCzAJBgNVBAMTAmNhMIIC | ||
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxRCOmf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gK/lhBcMtKX+SIpAYVgsw6uMkM0lbd27jAAikVK0B82+pW | ||
mPOICkab5itYp3CNG/LwSAO9Uo6dv7HFs2O/30MaLDNUFleXSdkCQ2XekAmf9K5p | ||
ShmdmGXjcxlMpycZPS655rhkLargqEHPB6CibvCwPnu+hefQQj1RlL/8UT/6uAFN | ||
zc/DA0Anok8s5HHVEmDkZxLYdIb/VKhHxQlT+hmGhK3MTbUqHF5E+LEPxFk3PeTR | ||
CrJcdEREMoMBIVIBmp8t1IB+H2hB10y93nugnp9u7clyVOsFGglo+DJugc9+vjcG | ||
Y9+eJLYrmHonjfTEyJW4urRtxdKeEsm9P9ns4NMochjSDR9ZYo6HfPOhM+Ty3eUt | ||
U2l0qq6lI/FcoQjFHXzC9au6u6tK0a8EBQppdEDXNShPn2Udwm+p7rooo8fzaDEy | ||
WiVG3/nisrSQf50SmIIRVOq9nkaDBjdz2Q2HnAHV3880vkivGOaiBzqLv91scA== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIJKgIBAAKCAgEAxRCOmfm2Z+q80Q5qEC4asTM9MWc5TonSMYWG7LaRkhCqojwW | ||
tsbMbJukEgG532i/mERFQ4/f2s/1p+da/8atJu4sZp+LK03ieBiALbjANc3xAieh | ||
zeHaPxxLUtSposGEvqqx8hVV++E+HtNLscqlK6ne6wVUVW4mFWVbI8ZOoltuyB9l | ||
xDeKLy9ISPGKV3Cw6fNMsBXHPPTsTxZFyy9YA0U4w1oyf6NDPX6vVEXzzxyZVohh | ||
QgoMNpOhAtkj+EWaL3RNQfYn70zz5smaXHC24CGPjBbgsNkgM7n/pHRGtKg+Qbqx | ||
lmxtzlT6lpiu0tkLsW/jocMdbiDV1Kb+bD5xiaqXrMOggZs/L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44VcGAuP1BoY/drsBgmLn9pjUERyB0N5Gs8Vcc5o0r4 | ||
N8pfsNECggEBAJhA+okVykANitgeY+f/Wc/inw7i/fdklI0BA6BEXMpC/PO4UJKU | ||
4nmwM7IoMxvcUgV6DWZyr4CpR/Fkf4ZeaYdUd0HngFrkwrSNPBiVG76xlL5vgD9B | ||
j/4HC168Fc0ERDfJkuRmli7fiHFeVX4EODAmXYdO/EaspCnR4b+yps2zy4gLYdr+ | ||
b8VYLwFuisuRYOPJXRY5xVPuHV7l3fBuyVk0WS1fraPM+kYc8ofDIXfcoq31rWo5 | ||
LGF5cCN3hWw++eviuPteDdepSkEfcSbFn1P8PtaSyJZXupWqz2U2tg+lRiTjII9o | ||
i3OQSnJtUSilpeykeudEb2wVoAnSU+8KO8sCggEAdJ+tmEu+/a9Jvru8EmfZ26Hs | ||
ymG6QYNiep2X41qBfAwhGUGsKf0vqQ5CEXqsYWU7LLNJuG+xt04kj3zDCA9z/Swx | ||
XqtJqoJ0c6N+Bh2GflvnxBaGfLVPelvLIQSSbQ8h0xhFqtgES6gu71gtmtAPNacM | ||
IOP/mR0yynq1WZV5J6KdzHC3NMrygm0Mj4lFEdin/oEHqEE+lF6wuq5EGgN6BVeM | ||
6U/6BNGuf1eN/laCNOFMPM+wWo0kMAoJ53QeKDVUev63U6b4nL7+hg470ihdSxnW | ||
8QkOJ1raI7sYtibN9P0E5KijV3b+2Fn7sq2Xpc/6oF2aksicYGDYsopXqbFKrA== | ||
-----END RSA PRIVATE KEY----- |
Oops, something went wrong.