-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.go
40 lines (35 loc) · 953 Bytes
/
rpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package rpc
import (
"context"
//alertmanagerpb "github.com/go-bamboo/api/alertmanager"
//uuidpb "github.com/go-bamboo/api/uuid"
"github.com/go-kratos/kratos/v2/registry"
)
type Cache struct {
//uuidc uuidpb.UUIDClient
//alertmanagerc alertmanagerpb.AlertManagerClient
}
func NewCache(dis registry.Discovery) (uc *Cache, err error) {
//uuidc := uuidpb.MustNew(context.TODO(), time.Minute, dis)
//alertmanagerc := alertmanagerpb.MustNew(context.TODO(), time.Minute, dis)
uc = &Cache{
//uuidc: uuidc,
//alertmanagerc: alertmanagerc,
}
return
}
func (c *Cache) ID(ctx context.Context) (uint64, error) {
//id, err := c.uuidc.GenID(ctx, &uuidpb.GenIDReq{})
//if err != nil {
// return 0, err
//}
//return id.Id, nil
return 0, nil
}
//func (c *Cache) Send(ctx context.Context, in *alertmanagerpb.NotifyRequest) error {
//_, err := c.alertmanagerc.Notify(ctx, in)
//if err != nil {
// return err
//}
// return nil
//}