Questions tagged [tonic]

Tonic is an open source less is more, RESTful Web application development PHP library designed to do things "the right way", where resources are king and the library gets out of the way and leaves the developer to get on with it.

Tonic is an open source less is more, RESTful Web application development PHP library designed to do things "the right way", where resources are king and the library gets out of the way and leaves the developer to get on with it.

To understand Tonic, you need to get the Web, so forget everything you know for a minute and think about how the Web really works, it's not about HTML pages, it's about resources:

Everything useful is a resource, not a file, not a CGI script, a resource, an abstract concept of something useful that the client wants to grab hold of.

  • Resources are located by URLs, URLs are cheap and form the universal addressing system of the Web. Clients can issue a standard number of HTTP methods upon an infinite number of resources and receive something useful in return.
  • Representations of resources are sent back to the client, a representation is just a way of turning the abstract concept of a resource into something more concrete, like a HTML page or a XML file. One resource can have many different representations.
  • Tonic helps you develop Web applications that embrace the way the Web really works, enabling your applications to scale, extend and work with other systems easily.
30 questions
5
votes
1 answer

How to import .proto when working with prost and tonic in rust?

I'm trying to build a simple gRPC client in rust using crates prost and tonic. My proto definitions are quite simple, but I suddenly stuck with using messages imported from other proto. // file src/protos/types.proto syntax = "proto3"; package…
ie.
  • 5,982
  • 1
  • 29
  • 44
3
votes
0 answers

How to configure tonic::transport::Endpoint to recover a broken connection?

I have a problem with a client. If the connection between the client and the server is lost. He can no longer restore it and the program that uses the client no longer works. For example, when you sleep for a long time or physically disconnect from…
Genius Merely
  • 374
  • 2
  • 11
3
votes
1 answer

How to handle external errors when using Tonic where I must use tonic::Status?

I am making a Tonic-based gRPC microservice that uses the Redis client. I can't figure out an example of implicitly converting a RedisError into a tonic::Status when an asynchronous error occurs. async fn make_transaction( &self, request:…
2
votes
0 answers

Rust Tonic gRPC "transport error" / " Kind(BrokenPipe)" only when running in Docker

this one is weirdo and bugging me quite a bit. I'm learning gRPC with tonic & prost. I've followed a tutorial and basically wrote a simple voting server & client. Locally, it runs perfectly fine. Next, I dockerized the voting service, and only when…
Marvin.Hansen
  • 1,436
  • 1
  • 15
  • 29
2
votes
1 answer

Rust tonic tonic::include_proto file path from one module to another module in tonic build

I am implementing gRPC client and server using Tonic. I have two modules each module depending on another module proto file. I am facing an issue when I try to provide the path of the proto file in tonic build. Below is my folder structure and code…
nagaraj
  • 797
  • 1
  • 6
  • 29
2
votes
0 answers

How to share .proto messages across multiple microservices?

I'm trying to create a bunch of microservices. Most grpc messages use this message message i18n { map translations = 0; } i18n also implements additional methods to choose the right key for the request context. In this way I would…
2
votes
1 answer

How to get the original URI extension using PHP Tonic?

I'm developing a REST API using PHP and Tonic. The framework has a fine feature which is the inference of the Content-Type based on the extension of the URI requested. In the case of the service I'm developing, it's important to know the full name…
Muc
  • 1,464
  • 2
  • 13
  • 31
2
votes
0 answers

Map URL with Method in Tonic?

I want to map the URL with tonic, how can I do that? is there any particular doc where I can? except for its API doc, because I have read it's API there are no any docs about that? for example here is my class /** * Display and process a HTML…
usii
  • 1,113
  • 1
  • 10
  • 17
2
votes
1 answer

Testing for PUT/POST/DELETE Methods

I am having some trouble running tests for PUT, POST and DELETE using the unit testing framework phpspec2. This is the code that I have in my unit test: $this->beConstructedWith(new \Tonic\Application(), new \Tonic\Request(array( 'uri' => '/', …
Nalum
  • 4,143
  • 5
  • 38
  • 55
1
vote
1 answer

"." in a Rust module identifier

A question about gRPC codegen with tonic (uses protoc) under the hood. The third party protos I am using are have package names like thirdparty.specificpackage, for example: syntax = "proto3"; package thirdparty.common; import…
Thomas Murphy
  • 1,360
  • 4
  • 14
  • 41
1
vote
0 answers

Tokio/Tonic Mutual TLS gRPC - Error: tls handshake eof

I am attempting do implement Tonic gRPC with mutual TLS. I generated a root cert with rcgen, generated a server cert with he same root and a client cert for testing. They're all ECCs PKCS_ECDSA_P384_SHA384. When I try to test with Postman I get 14…
Nikk
  • 7,384
  • 8
  • 44
  • 90
1
vote
0 answers

How to get my prost_types::DescriptorProto for my message from .proto file?

How to get my prost_types::DescriptorProto for my message from .proto file? I have written a rust program to invoke google bigquery storage write API via grpc w/ protobuf by gcloud-sdk…
WENPIN1
  • 21
  • 3
1
vote
1 answer

How to deserialize binary gRPC metadata to Rust struct?

Here's my codes. #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { /// login token #[prost(string, tag = "1")] pub…
cxw620
  • 13
  • 4
1
vote
1 answer

Can you change the node version on tonicdev.com?

Tonic allows you to run node code in the browser ... https://tonicdev.com/ But its currently running 0.12.7 of node Can you change the node version when using Tonic? i've searched but can't find anything - thought someone might now. My npm module…
danday74
  • 52,471
  • 49
  • 232
  • 283
1
vote
1 answer

Tonic.PHP on having "/resource" and "/resource/id" URL's

I'm trying to get the URL "/videoGame" to run "listAllVideoGames" method and "/videoGame/#" (Where # is a number) to run "getVideoGame" method. Changing priorities with "@priority" annotation I can make both URL's call one or the other but can't…
Ignacio Guerendiain
  • 417
  • 1
  • 8
  • 15
1
2