// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.
779187
func (u *User) GetSiteAdmin() bool {
	if u == nil || u.SiteAdmin == nil {
		return false
	}
	return *u.SiteAdmin
}
1262841
func (i *TeleInstance) GetSiteAPI(siteName string) auth.ClientI {
	siteTunnel, err := i.Tunnel.GetSite(siteName)
	if err != nil {
		log.Warn(err)
		return nil
	}
	siteAPI, err := siteTunnel.GetClient()
	if err != nil {
		log.Warn(err)
		return nil
	}
	return siteAPI
}
757247
func (extr *ContentExtractor) GetDomain(canonicalLink string) string {
	u, err := url.Parse(canonicalLink)
	if err == nil {
		return u.Host
	}
	return ""
}
523148
func (c *Cache) getItemPtr(key Key) (it *Item, ok bool) {
	elem, ok := c.m[key]
	if !ok {
		return nil, false
	}
	it = elem.Value.(*Item)
	// Check for expiration.
	if c.config.Expires > 0 && time.Now().Sub(it.ModTime) > c.config.Expires {
		// Item expired, delete it.
		c.removeElement(elem)
		return nil, false
	}
	// Update access time.
	if c.config.TrackAccessTime {
		it.AccessTime = time.Now()
	}
	c.l.MoveToFront(elem)
	return it, true
}
278070
func (p *propHost) GetHostName() string {
	if p.Host == nil {
		return ""
	}
	return p.Host.GetName()
}
721482
func (_class PVSProxyClass) GetSite(sessionID SessionRef, self PVSProxyRef) (_retval PVSSiteRef, _err error) {
	_method := "PVS_proxy.get_site"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPVSProxyRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPVSSiteRefToGo(_method + " -> ", _result.Value)
	return
}
490394
func (set FeatureFlags) Admin(uid keybase1.UID) bool {
	for _, f := range set {
		if f == Feature("admin") {
			return true
		}
	}
	return IsKeybaseAdmin(uid)
}
133247
func (e Endpoints) GetAddress(ctx context.Context, profileID string, addressID string) (Address, error) {
	request := getAddressRequest{ProfileID: profileID, AddressID: addressID}
	response, err := e.GetAddressEndpoint(ctx, request)
	if err != nil {
		return Address{}, err
	}
	resp := response.(getAddressResponse)
	return resp.Address, resp.Err
}
1337109
func GetMaybeAdminByStringName(ctx context.Context, g *libkb.GlobalContext, name string, public bool) (*Team, error) {
	// Find out our up-to-date role.
	team, err := Load(ctx, g, keybase1.LoadTeamArg{
		Name:                      name,
		Public:                    public,
		ForceRepoll:               true,
		RefreshUIDMapper:          true,
		AllowNameLookupBurstCache: true,
	})
	if err != nil {
		return nil, fixupTeamGetError(ctx, g, err, name, public)
	}
	me, err := loadUserVersionByUID(ctx, g, g.Env.GetUID())
	if err != nil {
		return nil, err
	}
	role, err := team.MemberRole(ctx, me)
	if err != nil {
		return nil, err
	}
	if role.IsAdminOrAbove() {
		// Will hit the cache _unless_ we had a cached non-admin team
		// and are now an admin.
		team, err = Load(ctx, g, keybase1.LoadTeamArg{
			Name:                      name,
			Public:                    public,
			NeedAdmin:                 true,
			AllowNameLookupBurstCache: true,
		})
		if err != nil {
			return nil, err
		}
	}
	return team, nil
}
1171529
func (s *HostService) GetHostTagID(keyword string, opts ...OptionFunc) (string, int, error) {
	p := &ListHostTagsParams{}
	p.p = make(map[string]interface{})

	p.p["keyword"] = keyword

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListHostTags(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", keyword, l)
	}

	if l.Count == 1 {
		return l.HostTags[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.HostTags {
			if v.Name == keyword {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", keyword, l)
}
1088711
func (i *InstallationEvent) GetAction() string {
	if i == nil || i.Action == nil {
		return ""
	}
	return *i.Action
}
1258061
func (d *MasterDaemon) getPluginAddress(hostName string) (string, error) {
	srvList, err := d.objdbClient.GetService("netplugin.vtep")
	if err != nil {
		log.Errorf("Error getting netplugin nodes. Err: %v", err)
		return "", err
	}

	for _, srv := range srvList {
		if srv.Hostname == hostName {
			return srv.HostAddr, nil
		}
	}

	return "", fmt.Errorf("Could not find plugin instance with name: %s", hostName)
}
1167196
func (m *Module) getMigrationSource() (migrate.MigrationSource, error) {
	if m.migrationSource != nil {
		return m.migrationSource, nil
	}
	configPath, err := filepath.Abs(m.Config.ConfigPath)
	if err != nil {
		return nil, err
	}
	migrationPath := filepath.Join(filepath.Dir(configPath), m.config.MigrationsDir)
	return migrate.FileMigrationSource{Dir: migrationPath}, nil
}
1302647
func (m *Membership) GetRole() string {
	if m == nil || m.Role == nil {
		return ""
	}
	return *m.Role
}
357351
func (d *domainClient) GetScriptSource(ctx context.Context, args *GetScriptSourceArgs) (reply *GetScriptSourceReply, err error) {
	reply = new(GetScriptSourceReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Debugger.getScriptSource", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Debugger.getScriptSource", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Debugger", Op: "GetScriptSource", Err: err}
	}
	return
}
239762
func (r Billing_Item) GetItem() (resp datatypes.Product_Item, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Item", "getItem", nil, &r.Options, &resp)
	return
}
591196
func getBuildModule() *debug.Module {
	bi, ok := debug.ReadBuildInfo()
	if ok {
		// The recommended way to build Caddy involves
		// creating a separate main module, which
		// preserves caddy a read-only dependency
		// TODO: track related Go issue: https://github.com/golang/go/issues/29228
		for _, mod := range bi.Deps {
			if mod.Path == "github.com/mholt/caddy" {
				return mod
			}
		}
	}
	return &debug.Module{Version: "unknown"}
}