webapp

command module
v0.0.0-...-acfd95a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 4 Imported by: 0

README

Introduction

This is a template for doing go-micro development using GitLab. It's based on the helloworld Go Micro template.

Getting started

First thing to do is update main.go with your new project path:

-       proto "gitlab.com/gitlab-org/project-templates/go-micro/proto"
+       proto "gitlab.com/$YOUR_NAMESPACE/$PROJECT_NAME/proto"

Note that these are not actual environment variables, but values you should replace.

What's contained in this project

  • main.go - is the main definition of the service, handler and client
  • proto - contains the protobuf definition of the API

Dependencies

Install the following

Run Service

go run main.go --server_address localhost:8080

Query Service

micro call --address localhost:8080 greeter Greeter.Hello '{"name": "John"}'

Generate code from protobuf file

Make sure you have installed protoc and protoc-gen-go as described in https://github.com/go-micro/generator. You can then generate the go code by running:

 protoc --go_opt=paths=source_relative --micro_opt=paths=source_relative --proto_path=./proto/ --micro_out=./proto/ --go_out=./proto/ ./proto/greeter.proto

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL