Skip to content

shenjing023/vivy-polaris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vivy-polaris

The project name has nothing to do with the actual content of this framework, just enjoyed the musical interlude <<Ensemble for Polaris>> of <<Vivy: Fluorite Eye's Song>> recently.

TODO

Useage

server

import (
    vp_server "github.com/shenjing023/vivy-polaris/server"
    "log"
    "net"
    "os"
    "os/signal"
    "syscall"

    pb "xxxx"
)

func main() {
    lis, err := net.Listen("tcp", fmt.Sprintf(":%d", 8888))
    if err != nil {
        log.Fatalf("failed to listen: %+v", err)
    }
    s := vp_server.NewServer()
    pb.RegisterXXXXXServer(s, &handler.Server{})
    go func() {
        if err := s.Serve(lis); err != nil {
            log.Fatalf("failed to serve: %+v", err)
        }
    }()
    log.Printf("%s server start success, port: %d", conf.ServerCfg.ServerName, conf.ServerCfg.Port)

    // Wait for interrupt signal to gracefully shutdown the server
    quit := make(chan os.Signal, 1)
    signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
    <-quit
    log.Printf("signal %d received and shutdown service", quit)
    s.GracefulStop()
}

About

A simple microservice framework based on gRPC

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published