(u *rpc.IMDInfo)
| 38 | } |
| 39 | |
| 40 | func UpdateIMDInfo(u *rpc.IMDInfo) bool { |
| 41 | conn, err := grpc.Dial(MasterIP, grpc.WithInsecure()) |
| 42 | if err != nil { |
| 43 | log.Panic(err) |
| 44 | } |
| 45 | defer conn.Close() |
| 46 | c := rpc.NewMasterClient(conn) |
| 47 | |
| 48 | ctx, cancel := context.WithTimeout(context.Background(), time.Second) |
| 49 | defer cancel() |
| 50 | |
| 51 | r, err := c.UpdateIMDInfo(ctx, u) |
| 52 | if err != nil { |
| 53 | log.Panic(err) |
| 54 | } |
| 55 | |
| 56 | if r.Result == false { |
| 57 | log.Panic("Update IMD Info Error") |
| 58 | } |
| 59 | |
| 60 | return r.Result |
| 61 | } |
| 62 | |
| 63 | func GetIMDData(ip string, filename string) []KV { |
| 64 | conn, err := grpc.Dial(ip, grpc.WithInsecure()) |
no test coverage detected