Documentation ¶
Overview ¶
Package genpjrpc is a generator JSON-RPC methods by proto spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version of the generator. Version = "(unknown)" // MethodsWithServiceName specifies that name of methods will be generate with service name. MethodsWithServiceName = false // GenerateClient true flag will generate the client code for json-rpc service. GenerateClient = true // GenerateServer true flag will generate the server code for json-rpc service. GenerateServer = true )
Some variables as config of generator.
Functions ¶
func GenerateFile ¶
GenerateFile generates golang file with JSON-RPC methods.
Types ¶
type MethodInfo ¶
type MethodInfo struct { Method *protogen.Method // Origin protogen type Name string // GoName of the method ConstName string // Name of the constant with RPC method name RPCName string // Method name in snake_case may be with service name RegHandlerName string // Name of the handler for registration method in router }
MethodInfo is a protogen.Method with names for JSON-RPC router.
type ServiceInfo ¶
type ServiceInfo struct { Service *protogen.Service // Origin protogen type Name string // GoName of service Methods []*MethodInfo // Methods list }
ServiceInfo is a protogen.Service with JSON-RPC methods.
func GetServiceInfo ¶
func GetServiceInfo(s *protogen.Service) *ServiceInfo
GetServiceInfo transforms protogen types with names for JSON-RPC router.
Click to show internal directories.
Click to hide internal directories.