Beispiel #1
0
func toNSS(arr []*rpc.ArrString) []core.Namespace {
	nss := make([]core.Namespace, len(arr))
	for i, v := range arr {
		nss[i] = common.ToCoreNamespace(v.S)
	}
	return nss
}
Beispiel #2
0
func (pc *ControlGRPCServer) ExpandWildcards(ctx context.Context, r *rpc.ExpandWildcardsRequest) (*rpc.ExpandWildcardsReply, error) {
	nss, serr := pc.control.ExpandWildcards(common.ToCoreNamespace(r.Namespace))
	reply := &rpc.ExpandWildcardsReply{}
	if nss != nil {
		reply.NSS = convertNSS(nss)
	}
	if serr != nil {
		reply.Error = common.NewErrors([]serror.SnapError{serr})[0]
	}
	return reply, nil
}