⬆️ Using Paperclip as attachment provider

This commit is contained in:
2024-05-17 20:52:13 +08:00
parent 80a8a31726
commit 827423ae3f
13 changed files with 106 additions and 469 deletions

View File

@@ -1,6 +1,7 @@
package grpc
import (
pcpb "git.solsynth.dev/hydrogen/paperclip/pkg/grpc/proto"
idpb "git.solsynth.dev/hydrogen/passport/pkg/grpc/proto"
"google.golang.org/grpc/credentials/insecure"
@@ -8,6 +9,19 @@ import (
"google.golang.org/grpc"
)
var Attachments pcpb.AttachmentsClient
func ConnectPaperclip() error {
addr := viper.GetString("paperclip.grpc_endpoint")
if conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())); err != nil {
return err
} else {
Attachments = pcpb.NewAttachmentsClient(conn)
}
return nil
}
var Realms idpb.RealmsClient
var Friendships idpb.FriendshipsClient
var Notify idpb.NotifyClient