Giter Site home page Giter Site logo

你们的tars2go工具问题 about tarsgo HOT 6 CLOSED

tarscloud avatar tarscloud commented on May 5, 2024
你们的tars2go工具问题

from tarsgo.

Comments (6)

sandyskies avatar sandyskies commented on May 5, 2024

1 , hi,建议使用https://github.com/TarsCloud/TarsGo/blob/master/docs/tars_go_quickstart.md 文档,里面有说明create_tars_server.sh , -outdir 指定的是要放文件的根目录, 我们通常指定的是项目目录下的vendor,参照我们的makefile。

from tarsgo.

sandyskies avatar sandyskies commented on May 5, 2024

2和3 我没太明白你说的意思,麻烦可以的话,微信详细和您了解下,微信号sandyskies

from tarsgo.

sandyskies avatar sandyskies commented on May 5, 2024

package main

import (
"github.com/TarsCloud/TarsGo/tars"

"TestApp"

)

func main() { //Init servant
imp := new(SayHelloImp) //New Imp
app := new(TestApp.SayHello) //New init the A JCE
cfg := tars.GetServerConfig() //Get Config File Object
app.AddServant(imp, cfg.App+"."+cfg.Server+".SayHelloObj") //Register Servant
tars.Run()
}
这是服务端helloworld的例子,没明白你说的路径命名,我们都是通过vendor来解决的

from tarsgo.

duguying avatar duguying commented on May 5, 2024

@sandyskies 我个人并不觉得生成的*_IF.go应当放在vendor中,vendor一般是指第三方依赖,而*_IF.go则确实属于该项目的重要组成部分。另外,纵观golang项目import路径,很少发现有项目以大驼峰的形式来命名,TestApp/HelloGo这种路径还是很不大众的。

from tarsgo.

sandyskies avatar sandyskies commented on May 5, 2024

@duguying 你说的驼峰问题,可以讨论下。 vendor的话,可以不放,但import 就必须相对路径

from tarsgo.

duguying avatar duguying commented on May 5, 2024

@sandyskies 可是它生成的IF文件的路径自动的带上了 TestApp\HelloGo 这就挺烦的了, 我不希望生成的IF文件放在项目的根目录,我希望放置在我指定的目录,方便我随时删除重新生成。建议参考一下 protobuf 的生成工具

from tarsgo.

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.