Example #1
0
func writeDecor(ctx context.Context, t table.BufferedProto, decor *srvpb.FileDecorations, targets map[string]*srvpb.Node) error {
	for _, n := range targets {
		decor.Target = append(decor.Target, n)
	}
	sort.Sort(assemble.ByOffset(decor.Decoration))
	sort.Sort(assemble.ByTicket(decor.Target))
	sort.Sort(assemble.ByAnchorTicket(decor.TargetDefinitions))
	return t.Put(ctx, xsrv.DecorationsKey(decor.File.Ticket), decor)
}
Example #2
0
func writeDecor(ctx context.Context, t table.BufferedProto, decor *srvpb.FileDecorations) error {
	sort.Sort(assemble.ByOffset(decor.Decoration))
	return t.Put(ctx, xsrv.DecorationsKey(decor.File.Ticket), decor)
}