// ConnsWithGroup narrows down a set of connections to those in a given group.
505662
func ConnsWithGroup(g Group, conns []*Conn) []*Conn {
	var out []*Conn
	for _, c := range conns {
		if c.InGroup(g) {
			out = append(out, c)
		}
	}
	return out
}
49798
func (g *routeGroup) GroupWithNone(prefix string) IRouteGroup {
	return &routeGroup{
		prefix:     g.prefix + prefix,
		pure:       g.pure,
		middleware: make([]Middleware, 0),
	}
}
1052082
func (g *Google) Group(provider *http.Client) (string, error) {
	srv, err := goauth2.New(provider)
	if err != nil {
		g.Logger.Error("Unable to communicate with Google ", err.Error())
		return "", err
	}
	info, err := srv.Userinfo.Get().Do()
	if err != nil {
		g.Logger.Error("Unable to retrieve Google email ", err.Error())
		return "", err
	}

	return info.Hd, nil
}
608127
func (g *BuilderGroup) AddGroup(info string) *BuilderGroup {
	return g.builder.AddGroup(info, g)
}
185964
func (c *Conn) joinGroup(request joinGroupRequestV2) (joinGroupResponseV2, error) {
	var response joinGroupResponseV2

	err := c.writeOperation(
		func(deadline time.Time, id int32) error {
			return c.writeRequest(joinGroupRequest, v2, id, request)
		},
		func(deadline time.Time, size int) error {
			return expectZeroSize(func() (remain int, err error) {
				return (&response).readFrom(&c.rbuf, size)
			}())
		},
	)
	if err != nil {
		return joinGroupResponseV2{}, err
	}
	if response.ErrorCode != 0 {
		return joinGroupResponseV2{}, Error(response.ErrorCode)
	}

	return response, nil
}
795901
func (o *EnterpriseNetwork) NetworkMacroGroups(info *bambou.FetchingInfo) (NetworkMacroGroupsList, *bambou.Error) {

	var list NetworkMacroGroupsList
	err := bambou.CurrentSession().FetchChildren(o, NetworkMacroGroupIdentity, &list, info)
	return list, err
}
34268
func WrapGroup(router *gin.RouterGroup) {
	routers := []struct {
		Method  string
		Path    string
		Handler gin.HandlerFunc
	}{
		{"GET", "/debug/pprof/", IndexHandler()},
		{"GET", "/debug/pprof/heap", HeapHandler()},
		{"GET", "/debug/pprof/goroutine", GoroutineHandler()},
		{"GET", "/debug/pprof/allocs", AllocsHandler()},
		{"GET", "/debug/pprof/block", BlockHandler()},
		{"GET", "/debug/pprof/threadcreate", ThreadCreateHandler()},
		{"GET", "/debug/pprof/cmdline", CmdlineHandler()},
		{"GET", "/debug/pprof/profile", ProfileHandler()},
		{"GET", "/debug/pprof/symbol", SymbolHandler()},
		{"POST", "/debug/pprof/symbol", SymbolHandler()},
		{"GET", "/debug/pprof/trace", TraceHandler()},
		{"GET", "/debug/pprof/mutex", MutexHandler()},
	}

	basePath := strings.TrimSuffix(router.BasePath(), "/")
	var prefix string

	switch {
	case basePath == "":
		prefix = ""
	case strings.HasSuffix(basePath, "/debug"):
		prefix = "/debug"
	case strings.HasSuffix(basePath, "/debug/pprof"):
		prefix = "/debug/pprof"
	}

	for _, r := range routers {
		router.Handle(r.Method, strings.TrimPrefix(r.Path, prefix), r.Handler)
	}
}
463293
func WithConn(conn net.PacketConn) ClientOpt {
	return func(c *Client) error {
		c.conn = conn
		return nil
	}
}
519391
func (r *marathonClient) HasGroup(name string) (bool, error) {
	path := fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name))
	err := r.apiGet(path, "", nil)
	if err != nil {
		if apiErr, ok := err.(*APIError); ok && apiErr.ErrCode == ErrCodeNotFound {
			return false, nil
		}
		return false, err
	}
	return true, nil
}
202725
func (b *bitbucketConnector) getGroups(ctx context.Context, client *http.Client, groupScope bool, userLogin string) ([]string, error) {
	bitbucketTeams, err := b.userTeams(ctx, client)
	if err != nil {
		return nil, err
	}

	if len(b.teams) > 0 {
		filteredTeams := filterTeams(bitbucketTeams, b.teams)
		if len(filteredTeams) == 0 {
			return nil, fmt.Errorf("bitbucket: user %q is not in any of the required teams", userLogin)
		}
		return filteredTeams, nil
	} else if groupScope {
		return bitbucketTeams, nil
	}

	return nil, nil
}
1174740
func newRouteGroup(prefix string, router *Router, handlers []Handler) *RouteGroup {
	return &RouteGroup{
		prefix:   prefix,
		router:   router,
		handlers: handlers,
	}
}
416472
func (s *Swarm) NewStreamWithGroup(group Group) (*Stream, error) {
	conns := s.ConnsWithGroup(group)
	return s.newStreamSelectConn(s.SelectConn(), conns)
}
240408
func (c *Client) Group(msg *Group) error {
	if msg.GroupId == "" {
		return errors.New("You must pass a 'groupId'.")
	}

	if msg.UserId == "" && msg.AnonymousId == "" {
		return errors.New("You must pass either an 'anonymousId' or 'userId'.")
	}

	msg.Type = "group"
	c.queue(msg)

	return nil
}
939911
func (r *Router) Group(path string, handlers ...HandlerFunc) *Router {
	handlers = r.combineHandlers(handlers)
	return &Router{
		handlers: handlers,
		prefix:   r.path(path),
		ace:      r.ace,
	}
}
761880
func (g *routeGroup) Group(prefix string) IRouteGroup {
	rg := &routeGroup{
		prefix:     g.prefix + prefix,
		lars:       g.lars,
		middleware: make(HandlersChain, len(g.middleware)),
	}
	copy(rg.middleware, g.middleware)
	return rg
}
1154881
func (s *Swarm) NewStreamWithNetConn(netConn net.Conn) (*Stream, error) {
	c, err := s.AddConn(netConn)
	if err != nil {
		return nil, err
	}
	return s.NewStreamWithConn(c)
}
251609
func (s *Set) AddGroup(group string) {
	if !s.All {
		if s.Groups == nil {
			s.Groups = make(groupSet, 1)
		}
		s.Groups[group] = struct{}{}
	}
}