// RemoteInfo sets up reindexing from a remote cluster.
766985
func (r *ReindexSource) RemoteInfo(ri *ReindexRemoteInfo) *ReindexSource {
	r.remoteInfo = ri
	return r
}
1149145
func RepoInfo() (repoRoot string, repoRevision string, repoTag string) {
	var vcsCmd *vcs.Cmd

	// Walk up the call stack until we find main.main
	for i := 1; ; i++ {
		caller, file, _, ok := runtime.Caller(i)
		if !ok {
			break
		}

		f := runtime.FuncForPC(caller)
		if f == nil {
			continue
		}
		if path.Base(f.Name()) == "main.main" {
			repoRoot = path.Dir(file)
			break
		}

		// see if we're in testing
		if path.Base(f.Name()) == "testing.tRunner" {
			// go back up one level
			_, file, _, _ := runtime.Caller(i - 1)
			repoRoot = path.Dir(file)
			break
		}
	}

	// Try and find the root of the VCS repo using repoRoot as a starting point.
	if repoRoot != "" {
		// walk up the dir until we get to the first directory in root.
		// This is an unfortunately necessity to use vcs.FromDir()
		topDir := repoRoot
		for dir := path.Dir(topDir); dir != "." && dir[len(dir)-1] != '/' && dir != topDir; dir = path.Dir(topDir) {
			topDir = dir
		}

		var vcsRoot string
		vcsCmd, vcsRoot, _ = vcs.FromDir(path.Dir(repoRoot), topDir)
		if len(vcsRoot) > 0 {
			if vcsRoot[0] != '/' {
				vcsRoot = topDir + "/" + vcsRoot
			}
			repoRoot = vcsRoot
		}
	}

	if vcsCmd != nil && vcsCmd.Name == "Git" {
		execCmd := exec.Command("git", "describe", "--dirty", "--match", "", "--always")
		execCmd.Dir = repoRoot
		output, err := execCmd.Output()
		if err == nil {
			repoRevision = string(bytes.TrimRight(output, "\n"))
		}

		execCmd = exec.Command("git", "describe", "--dirty", "--tags", "--always")
		execCmd.Dir = repoRoot
		output, err = execCmd.Output()
		if err == nil {
			repoTag = string(bytes.TrimRight(output, "\n"))
		}
	}

	return
}
903931
func (_m *Communicator) Remote(channel string, id uint64) (*cluster.RemoteContext, error) {
	ret := _m.Called(channel, id)

	var r0 *cluster.RemoteContext
	if rf, ok := ret.Get(0).(func(string, uint64) *cluster.RemoteContext); ok {
		r0 = rf(channel, id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*cluster.RemoteContext)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, uint64) error); ok {
		r1 = rf(channel, id)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
208431
func RemotesDocs(serverType string, services map[string]*component.Service, getPtrNames bool) (map[string]interface{}, error) {
	docs := &docs{
		Remotes: map[string]*doc{},
	}

	for serviceName, service := range services {
		for name, remote := range service.Remotes {
			routeName := route.NewRoute(serverType, serviceName, name)
			docs.Remotes[routeName.String()] = docForMethod(remote.Method, getPtrNames)
		}
	}

	return docs.Remotes.toMap()
}
359501
func (c *Connection) RemoteIP() string {
	if net.ParseIP(c.Hostname) == nil {
		addrs, err := net.LookupHost(c.Hostname)
		if err != nil && len(addrs) > 0 {
			return addrs[0]
		}
	}
	return c.Hostname
}
969153
func (c *ReloadCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "reload-spaces",
		Purpose: "Reloads spaces and subnets from substrate.",
		Doc:     strings.TrimSpace(ReloadCommandDoc),
	})
}
636372
func (s *DescribeProvisioningArtifactOutput) SetInfo(v map[string]*string) *DescribeProvisioningArtifactOutput {
	s.Info = v
	return s
}
128253
func (srv *Server) PeersInfo() []*PeerInfo {
	// Gather all the generic and sub-protocol specific infos
	infos := make([]*PeerInfo, 0, srv.PeerCount())
	for _, peer := range srv.Peers() {
		if peer != nil {
			infos = append(infos, peer.Info())
		}
	}
	// Sort the result array alphabetically by node identifier
	for i := 0; i < len(infos); i++ {
		for j := i + 1; j < len(infos); j++ {
			if infos[i].ID > infos[j].ID {
				infos[i], infos[j] = infos[j], infos[i]
			}
		}
	}
	return infos
}
1373050
func NewShardReplicationInfo(sr *topodatapb.ShardReplication, cell, keyspace, shard string) *ShardReplicationInfo {
	return &ShardReplicationInfo{
		ShardReplication: sr,
		cell:             cell,
		keyspace:         keyspace,
		shard:            shard,
	}
}
150938
func (s *Signer) remoteOp(req interface{}, profile, target string) (resp interface{}, err error) {
	jsonData, err := json.Marshal(req)
	if err != nil {
		return nil, cferr.Wrap(cferr.APIClientError, cferr.JSONError, err)
	}

	p, err := signer.Profile(s, profile)
	if err != nil {
		return
	}

	server := client.NewServerTLS(p.RemoteServer, helpers.CreateTLSConfig(p.RemoteCAs, p.ClientCert))
	if server == nil {
		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidRequest,
			errors.New("failed to connect to remote"))
	}

	server.SetReqModifier(s.reqModifier)

	// There's no auth provider for the "info" method
	if target == "info" {
		resp, err = server.Info(jsonData)
	} else if p.RemoteProvider != nil {
		resp, err = server.AuthSign(jsonData, nil, p.RemoteProvider)
	} else {
		resp, err = server.Sign(jsonData)
	}

	if err != nil {
		return nil, err
	}

	return
}
901044
func (a *AuthServer) GetRemoteCluster(clusterName string) (services.RemoteCluster, error) {
	// To make sure remote cluster exists - to protect against random
	// clusterName requests (e.g. when clusterName is set to local cluster name)
	remoteCluster, err := a.Presence.GetRemoteCluster(clusterName)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	if err := a.updateRemoteClusterStatus(remoteCluster); err != nil {
		return nil, trace.Wrap(err)
	}
	return remoteCluster, nil
}
270026
func (c *remoteClient) lockInfo() (*state.LockInfo, error) {
	r, err := c.lockFile().NewReader(c.storageContext)
	if err != nil {
		return nil, err
	}
	defer r.Close()

	rawData, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, err
	}

	info := &state.LockInfo{}
	if err := json.Unmarshal(rawData, info); err != nil {
		return nil, err
	}

	// We use the Generation as the ID, so overwrite the ID in the json.
	// This can't be written into the Info, since the generation isn't known
	// until it's written.
	attrs, err := c.lockFile().Attrs(c.storageContext)
	if err != nil {
		return nil, err
	}
	info.ID = strconv.FormatInt(attrs.Generation, 10)

	return info, nil
}
400595
func (d *DeployerAPI) ConnectionInfo() (result params.DeployerConnectionValues, err error) {
	apiAddrs, err := d.APIAddresses()
	if err != nil {
		return result, err
	}
	result = params.DeployerConnectionValues{
		APIAddresses: apiAddrs.Result,
	}
	return result, err
}
533587
func (wc *WhisperClient) GetInfo(ctx *Context) (info *Info, _ error) {
	rawInfo, err := wc.client.Info(ctx.context)
	return &Info{&rawInfo}, err
}
944790
func (s *Server) GetInfo() services.Server {
	return &services.ServerV2{
		Kind:    services.KindNode,
		Version: services.V2,
		Metadata: services.Metadata{
			Name:      s.ID(),
			Namespace: s.getNamespace(),
			Labels:    s.labels,
		},
		Spec: services.ServerSpecV2{
			CmdLabels: services.LabelsToV2(s.getCommandLabels()),
			Addr:      s.AdvertiseAddr(),
			Hostname:  s.hostname,
			UseTunnel: s.useTunnel,
		},
	}
}
228824
func (s *PresenceService) GetRemoteCluster(clusterName string) (services.RemoteCluster, error) {
	if clusterName == "" {
		return nil, trace.BadParameter("missing parameter cluster name")
	}
	item, err := s.Get(context.TODO(), backend.Key(remoteClustersPrefix, clusterName))
	if err != nil {
		if trace.IsNotFound(err) {
			return nil, trace.NotFound("remote cluster %q is not found", clusterName)
		}
		return nil, trace.Wrap(err)
	}
	return services.UnmarshalRemoteCluster(item.Value,
		services.WithResourceID(item.ID), services.WithExpires(item.Expires))
}
774485
func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) {
	tr, ok := trace.FromContext(stream.Context())
	if !ok {
		return nil
	}

	trInfo = &traceInfo{
		tr: tr,
		firstLine: firstLine{
			client:     false,
			remoteAddr: st.RemoteAddr(),
		},
	}
	if dl, ok := stream.Context().Deadline(); ok {
		trInfo.firstLine.deadline = time.Until(dl)
	}
	return trInfo
}