Skip to content
Snippets Groups Projects
pnd.go 465 B
Newer Older
  • Learn to ignore specific revisions
  • Manuel Kieweg's avatar
    Manuel Kieweg committed
    package client
    
    import (
    
    	ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd"
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	"google.golang.org/grpc"
    )
    
    // PndClient returns a client for the gRPC PND service. It takes
    // the address of the gRPC endpoint and optional grpc.DialOption
    
    Fabian Seidl's avatar
    Fabian Seidl committed
    func PndClient(addr string, opts ...grpc.DialOption) (ppb.PndServiceClient, error) {
    
    	conn, err := grpc.NewClient(addr, opts...)
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    	if err != nil {
    		return nil, err
    	}
    
    Fabian Seidl's avatar
    Fabian Seidl committed
    	return ppb.NewPndServiceClient(conn), nil
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    }