Coder Social home page Coder Social logo

Comments (2)

alex-dna-tech avatar alex-dna-tech commented on June 25, 2024

proto-gen-micro package by the README must be installed with master version, not latest.

I'll fix this in template
The next step in init is to install protoc-gen-openapi, but as far as I can see it is no longer supported in V4.
New problems are likely to arise as users try to follow the documentation's instructions.

TODO test

  • new service create
  • make targets
  • run service with default values

from micro.

alex-dna-tech avatar alex-dna-tech commented on June 25, 2024

The handler template is not fully compatible anymore. Only can run Call endpoint.

dna-tech@alex:micro$ go run cmd/micro/main.go new aaa
Creating service aaa

.
├── main.go
├── handler
│   └── aaa.go
├── proto
│   └── aaa.proto
├── dep-install.mk
├── Makefile
├── README.md
├── .gitignore
└── go.mod

cd aaa
go mod tidy
make proto
micro run .

dna-tech@alex:micro$ cd aaa
dna-tech@alex:aaa$ go mod tidy
dna-tech@alex:aaa$ make proto
protoc --proto_path=. --go_out=:. --micro_out=. proto/aaa.proto
dna-tech@alex:aaa$ micro run .
dna-tech@alex:aaa$ micro user
admin
dna-tech@alex:aaa$ micro services
auth
broker
config
events
helloworld
network
registry
runtime
store
dna-tech@alex:aaa$ micro status aaa
NAME    VERSION SOURCE                                          STATUS  BUILD   UPDATED METADATA
aaa     latest  /Volumes/DATA/sim/testdir/@micro/micro/aaa      running n/a     1m5s agoowner=admin, group=micro
dna-tech@alex:aaa$ micro services
aaa
auth
broker
config
events
helloworld
network
registry
runtime
store
dna-tech@alex:aaa$ micro aaa --help
NAME:
        micro aaa

VERSION:
        latest

USAGE:
        micro aaa [command]

COMMANDS:
        call
        pingPong
        stream

dna-tech@alex:aaa$ micro aaa call --help
NAME:
        micro aaa call

USAGE:
        micro aaa call [flags]

FLAGS:
        --name string

dna-tech@alex:aaa$ micro aaa call --name="John"
{
        "msg": "Hello John"
}
dna-tech@alex:aaa$ micro aaa stream --help
NAME:
        micro aaa stream

USAGE:
        micro aaa stream [flags]

FLAGS:

dna-tech@alex:aaa$ micro aaa not-exists --help
NAME:
        micro aaa not-exists

USAGE:
        micro aaa not-exists [flags]

FLAGS:

dna-tech@alex:aaa$ micro aaa pingPong --help
NAME:
        micro aaa pingPong

USAGE:
        micro aaa pingPong [flags]

FLAGS:

dna-tech@alex:aaa$ micro call --help
NAME:
   micro call - Call a service e.g micro call greeter Say.Hello '{"name": "John"}'

USAGE:
   micro call [command options] [arguments...]

OPTIONS:
   --address value          Set the address of the service instance to call [$MICRO_ADDRESS]
   --output value           Set the output format; json (default), raw [$MICRO_OUTPUT]
   --metadata value         A list of key-value pairs to be forwarded as metadata [$MICRO_METADATA]
   --request_timeout value  timeout duration
   --help, -h               show help (default: false)

dna-tech@alex:aaa$ micro call aaa --help
malformed method name: "--help"
dna-tech@alex:aaa$ micro call aaa Aaa.Call '{"name":"John"}'
{
        "msg": "Hello John"
}
dna-tech@alex:aaa$ micro call aaa Aaa.Stream '{"name":"John"}'
grpc: failed to unmarshal the received message: unknown field "name" in aaa.StreamingRequest
dna-tech@alex:aaa$ micro call aaa Aaa.Stream '{"name":"John","messages":10}'
grpc: failed to unmarshal the received message: unknown field "messages" in aaa.StreamingRequest
dna-tech@alex:aaa$ micro call aaa Aaa.Stream '{}'
EOF
dna-tech@alex:aaa$ micro call aaa Aaa.PingPong '{"stroke":1}'
EOF
dna-tech@alex:aaa$ micro call aaa Aaa.PingPong '{"stroke":"aaa"}'
grpc: failed to unmarshal the received message: invalid character 'a' looking for beginning of value
dna-tech@alex:aaa$ micro call aaa Aaa.Stream '{"count":10}'
grpc: client streaming protocol violation: get <nil>, want <EOF>
dna-tech@alex:aaa$

Maybe referenced to #1961

from micro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.