func filterEdges(n *gen.Type) ([]*gen.Edge, error) {
	c, err := config(n.Config)
	if err != nil {
		return nil, err
	}
	var filteredEdges []*gen.Edge
	for _, e := range n.Edges {
		var p Policy
		ant := &Annotation{}
		// If no policies are given follow the global policy.
		if e.Annotations == nil || e.Annotations[ant.Name()] == nil {
			p = c.HandlerPolicy
		} else {
			if err := ant.Decode(e.Annotations[ant.Name()]); err != nil {
				return nil, err
			}
			p = ant.Expose
			// If the policy is policy.None follow the globally defined policy.
			if p == None {
				p = c.HandlerPolicy
			}
		}
		if p == Expose {
			filteredEdges = append(filteredEdges, e)
		}
	}
	return filteredEdges, nil
}
// filterEdges returns the edges a read/list handler should be generated for.
filterEdges returns the edges a read/list handler should be generated for.
// filterEdges returns the edges a read / list handler should be generated for .
func filterEdges(n *gen.Type) ([]*gen.Edge, error) {
	c, err := config(n.Config)
	if err != nil {
		return nil, err
	}
	var filteredEdges []*gen.Edge
	for _, e := range n.Edges {
		var p Policy
		ant := &Annotation{}
		if e.Annotations == nil || e.Annotations[ant.Name()] == nil {
			p = c.HandlerPolicy
		} else {
			if err := ant.Decode(e.Annotations[ant.Name()]); err != nil {
				return nil, err
			}
			p = ant.Expose
			if p == None {
				p = c.HandlerPolicy
			}
		}
		if p == Expose {
			filteredEdges = append(filteredEdges, e)
		}
	}
	return filteredEdges, nil
}
func filterEdges ( n * gen . Type ) ( [ ] * gen . Edge , error ) { c , err := config ( n . Config ) if err != nil { return nil , err } var filteredEdges [ ] * gen . Edge for _ , e := range n . Edges { var p Policy ant := & Annotation { } if e . Annotations == nil || e . Annotations [ ant . Name ( ) ] == nil { p = c . HandlerPolicy } else { if err := ant . Decode ( e . Annotations [ ant . Name ( ) ] ) ; err != nil { return nil , err } p = ant . Expose if p == None { p = c . HandlerPolicy } } if p == Expose { filteredEdges = append ( filteredEdges , e ) } } return filteredEdges , nil }
filterEdges returns the edges a read/list handler should be generated for.
filterEdges returns the edges a read / list handler should be generated for .
// If no policies are given follow the global policy. // If the policy is policy.None follow the globally defined policy.