-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathhandleblob.go
More file actions
41 lines (34 loc) · 1.22 KB
/
handleblob.go
File metadata and controls
41 lines (34 loc) · 1.22 KB
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
41
package zedagent
import "github.com/lf-edge/eve/pkg/pillar/types"
func blobStatusGetAll(ctx *zedagentContext) map[string]*types.BlobStatus {
sub := ctx.subBlobStatus
blobShaAndBlobStatus := make(map[string]*types.BlobStatus)
for blobSha, blobStatusInt := range sub.GetAll() {
blobStatus := blobStatusInt.(types.BlobStatus)
blobShaAndBlobStatus[blobSha] = &blobStatus
}
return blobShaAndBlobStatus
}
func handleBlobStatusCreate(ctxArg interface{}, key string,
statusArg interface{}) {
handleBlobStatusImpl(ctxArg, key, statusArg)
}
func handleBlobStatusModify(ctxArg interface{}, key string,
statusArg interface{}, oldStatusArg interface{}) {
handleBlobStatusImpl(ctxArg, key, statusArg)
}
func handleBlobStatusImpl(ctxArg interface{}, key string,
statusArg interface{}) {
status := statusArg.(types.BlobStatus)
ctx := ctxArg.(*zedagentContext)
uuidStr := status.Key()
PublishBlobInfoToZedCloud(ctx, uuidStr, &status, ctx.iteration, AllDest)
ctx.iteration++
}
func handleBlobDelete(ctxArg interface{}, key string, statusArg interface{}) {
status := statusArg.(types.BlobStatus)
ctx := ctxArg.(*zedagentContext)
uuidStr := status.Key()
PublishBlobInfoToZedCloud(ctx, uuidStr, nil, ctx.iteration, AllDest)
ctx.iteration++
}