Skip to content
Snippets Groups Projects
sbi.go 600 B
Newer Older
  • Learn to ignore specific revisions
  • 	spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
    
    var sbiClientConnection *grpc.ClientConn
    
    
    // SbiClient returns a client for the gRPC SBI service. It takes
    // the address of the gRPC endpoint and optional grpc.DialOption
    
    func SbiClient(addr string, opts ...grpc.DialOption) (spb.SbiServiceClient, error) {
    
    	var err error
    
    	if sbiClientConnection == nil {
    		sbiClientConnection, err = grpc.NewClient(addr, opts...)
    		if err != nil {
    			return nil, err
    		}
    
    
    	return spb.NewSbiServiceClient(sbiClientConnection), nil