GODT-1779: Remove go-imap

This commit is contained in:
James Houlahan
2022-08-26 17:00:21 +02:00
parent 3b0bc1ca15
commit 39433fe707
593 changed files with 12725 additions and 91626 deletions

32
internal/focus/client.go Normal file
View File

@ -0,0 +1,32 @@
package focus
import (
"context"
"fmt"
"net"
"time"
"github.com/ProtonMail/proton-bridge/v2/internal/focus/proto"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/emptypb"
)
func TryRaise() bool {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
cc, err := grpc.DialContext(ctx, net.JoinHostPort(Host, fmt.Sprint(Port)), grpc.WithInsecure())
if err != nil {
return false
}
if _, err := proto.NewFocusClient(cc).Raise(ctx, &emptypb.Empty{}); err != nil {
return false
}
if err := cc.Close(); err != nil {
return false
}
return true
}