1234567891011121314151617181920212223242526272829303132333435 |
- // Code generated by goctl. DO NOT EDIT!
- // Source: filesystem.proto
- package main
- import (
- "app.yhyue.com/moapp/jyfs/rpc/filesystem"
- "app.yhyue.com/moapp/jyfs/rpc/internal/config"
- "app.yhyue.com/moapp/jyfs/rpc/internal/server"
- "app.yhyue.com/moapp/jyfs/rpc/internal/svc"
- "flag"
- "fmt"
- "github.com/tal-tech/go-zero/core/conf"
- "github.com/tal-tech/go-zero/zrpc"
- "google.golang.org/grpc"
- )
- var configFile = flag.String("f", "etc/filesystem.yaml", "the config file")
- func main() {
- flag.Parse()
- var c config.Config
- conf.MustLoad(*configFile, &c)
- ctx := svc.NewServiceContext(c)
- srv := server.NewFileSystemServer(ctx)
- s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
- filesystem.RegisterFileSystemServer(grpcServer, srv)
- })
- defer s.Stop()
- fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
- s.Start()
- }
|