123456789101112131415161718192021222324252627282930313233343536 |
- package main
- import (
- "cfTest/cloudflareApi/cache/purge"
- "cfTest/cloudflareApi/certificate"
- "cfTest/cloudflareApi/dns"
- "cfTest/cloudflareApi/logPush"
- "cfTest/cloudflareApi/zone"
- "cfTest/server"
- "google.golang.org/grpc"
- "log"
- "net"
- )
- const (
- port = ":50051"
- )
- func main() {
- lis, err := net.Listen("tcp", port)
- if err != nil {
- log.Fatalf("failed to listen: %v", err)
- }
- s := grpc.NewServer()
- purge.RegisterPurgeCloudflareServer(s, &server.PurgeServer{})
- certificate.RegisterCertificateCloudflareServer(s, &server.CertificateServer{})
- zone.RegisterZoneCloudflareServer(s, &server.ZoneServer{})
- dns.RegisterDnsCloudflareServer(s, &server.DnsServer{})
- logPush.RegisterLogPushCloudflareServer(s, &server.LogPushCloudflareServer{})
- log.Printf("server listening at %v", lis.Addr())
- if err := s.Serve(lis); err != nil {
- log.Fatalf("failed to serve: %v", err)
- }
- }
|