当前位置: 首页>>代码示例>>Golang>>正文


Golang errors.FilterOut函数代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/util/errors.FilterOut函数的典型用法代码示例。如果您正苦于以下问题:Golang FilterOut函数的具体用法?Golang FilterOut怎么用?Golang FilterOut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FilterOut函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Visit

// Visit implements the Visitor interface on the items described in the Builder.
// Note that some visitor sources are not traversable more than once, or may
// return different results.  If you wish to operate on the same set of resources
// multiple times, use the Infos() method.
func (r *Result) Visit(fn VisitorFunc) error {
	if r.err != nil {
		return r.err
	}
	err := r.visitor.Visit(fn)
	return utilerrors.FilterOut(err, r.ignoreErrors...)
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:11,代码来源:result.go

示例2: Filter

// Filter removes items from the ErrorList that match the provided fns.
func (list ErrorList) Filter(fns ...utilerrors.Matcher) ErrorList {
	err := utilerrors.FilterOut(list.ToAggregate(), fns...)
	if err == nil {
		return nil
	}
	// FilterOut takes an Aggregate and returns an Aggregate
	return fromAggregate(err.(utilerrors.Aggregate))
}
开发者ID:erinboyd,项目名称:origin,代码行数:9,代码来源:errors.go

示例3: Filter

// Filter removes items from the ErrorList that match the provided fns.
func (list ErrorList) Filter(fns ...utilerrors.Matcher) ErrorList {
	err := utilerrors.FilterOut(utilerrors.NewAggregate(list), fns...)
	if err == nil {
		return nil
	}
	// FilterOut that takes an Aggregate returns an Aggregate
	agg := err.(utilerrors.Aggregate)
	return ErrorList(agg.Errors())
}
开发者ID:yanns,项目名称:kubernetes,代码行数:10,代码来源:errors.go

示例4: Filter

// Filter removes items from the ValidationErrorList that match the provided fns.
func (list ValidationErrorList) Filter(fns ...errors.Matcher) ValidationErrorList {
	err := errors.FilterOut(errors.NewAggregate(list), fns...)
	if err == nil {
		return nil
	}
	// FilterOut that takes an Aggregate returns an Aggregate
	agg := err.(errors.Aggregate)
	return ValidationErrorList(agg.Errors())
}
开发者ID:MohamedFAhmed,项目名称:heapster,代码行数:10,代码来源:fielderrors.go

示例5: Infos

// Infos returns an array of all of the resource infos retrieved via traversal.
// Will attempt to traverse the entire set of visitors only once, and will return
// a cached list on subsequent calls.
func (r *Result) Infos() ([]*Info, error) {
	if r.err != nil {
		return nil, r.err
	}
	if r.info != nil {
		return r.info, nil
	}

	infos := []*Info{}
	err := r.visitor.Visit(func(info *Info) error {
		infos = append(infos, info)
		return nil
	})
	err = errors.FilterOut(err, r.ignoreErrors...)

	r.info, r.err = infos, err
	return infos, err
}
开发者ID:dctse,项目名称:openshift-cucumber,代码行数:21,代码来源:result.go


注:本文中的k8s/io/kubernetes/pkg/util/errors.FilterOut函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。