// ServersToV1 converts list of servers to slice of V1 style ones
961104
func ServersToV1(in []Server) []ServerV1 {
	out := make([]ServerV1, len(in))
	for i := range in {
		out[i] = *(in[i].V1())
	}
	return out
}
624803
func (s *ServerV1) V2() *ServerV2 {
	labels := make(map[string]CommandLabelV2, len(s.CmdLabels))
	for key := range s.CmdLabels {
		val := s.CmdLabels[key]
		labels[key] = CommandLabelV2{
			Period:  Duration(val.Period),
			Result:  val.Result,
			Command: val.Command,
		}
	}
	return &ServerV2{
		Kind:    s.Kind,
		Version: V2,
		Metadata: Metadata{
			Name:      s.ID,
			Namespace: ProcessNamespace(s.Namespace),
			Labels:    s.Labels,
		},
		Spec: ServerSpecV2{
			Addr:      s.Addr,
			Hostname:  s.Hostname,
			CmdLabels: labels,
		},
	}
}
279465
func Convert_build_ImageChangeTrigger_To_v1_ImageChangeTrigger(in *build.ImageChangeTrigger, out *v1.ImageChangeTrigger, s conversion.Scope) error {
	return autoConvert_build_ImageChangeTrigger_To_v1_ImageChangeTrigger(in, out, s)
}
1072091
func ServerDiskless(client APIClient, name string) DisklessServerBuilder {
	b := newServerBuilder(client, name)
	b.hasCommonProperty = true
	b.hasNetworkInterfaceProperty = true
	b.hasServerEventProperty = true
	return b
}
1249510
func (c *Clientset) CrV1() crv1.CrV1Interface {
	return &fakecrv1.FakeCrV1{Fake: &c.Fake}
}
779900
func (r *HashRing) ServerCount() int {
	r.RLock()
	count := len(r.serverSet)
	r.RUnlock()
	return count
}
887532
func (i *Client) ServerCapabilities(c context.Context) (*isolateservice.HandlersEndpointsV1ServerDetails, error) {
	out := &isolateservice.HandlersEndpointsV1ServerDetails{}
	if err := i.postJSON(c, "/_ah/api/isolateservice/v1/server_details", nil, map[string]string{}, out); err != nil {
		return nil, err
	}
	return out, nil
}
841481
func Convert_config_TemplateServiceBrokerConfig_To_v1_TemplateServiceBrokerConfig(in *config.TemplateServiceBrokerConfig, out *TemplateServiceBrokerConfig, s conversion.Scope) error {
	return autoConvert_config_TemplateServiceBrokerConfig_To_v1_TemplateServiceBrokerConfig(in, out, s)
}
1111038
func (c chunk) WriteToVST1_1(w io.Writer) (int64, error) {
	le := binary.LittleEndian
	hdr := [maxChunkHeaderSize]byte{}

	le.PutUint32(hdr[0:], uint32(len(c.Data)+len(hdr))) // length
	le.PutUint32(hdr[4:], c.chunkX)                     // chunkX
	le.PutUint64(hdr[8:], c.MessageID)                  // message ID
	le.PutUint64(hdr[16:], c.MessageLength)             // message length

	// Write header
	//fmt.Printf("Writing hdr: %s\n", hex.EncodeToString(hdr))
	if n, err := w.Write(hdr[:]); err != nil {
		return int64(n), driver.WithStack(err)
	}

	// Write data
	//fmt.Printf("Writing data: %s\n", hex.EncodeToString(c.Data))
	n, err := w.Write(c.Data)
	result := int64(n) + int64(len(hdr))
	if err != nil {
		return result, driver.WithStack(err)
	}
	return result, nil
}
876213
func (m *ObserverMultiplexer) ServerReply(req Request, hdr *Header, body interface{}) {
	mapConcurrent(func(n Observer) { n.ServerReply(req, hdr, body) }, m.rpcObservers)
}
228602
func ServerFromArchive(client APIClient, name string, sourceArchiveID int64) CommonServerBuilder {
	b := newServerBuilder(client, name)
	b.hasCommonProperty = true
	b.hasNetworkInterfaceProperty = true
	b.hasDiskProperty = true
	b.hasDiskSourceProperty = true
	b.hasDiskEditProperty = true
	b.hasServerEventProperty = true
	b.hasDiskEventProperty = true
	b.hasAdditionalDiskProperty = true

	b.serverFromArchive(sourceArchiveID)
	return b
}
373215
func (*TeleportServerMarshaler) UnmarshalServers(bytes []byte) ([]Server, error) {
	var servers []ServerV2

	err := utils.FastUnmarshal(bytes, &servers)
	if err != nil {
		return nil, trace.Wrap(err)
	}

	out := make([]Server, len(servers))
	for i, v := range servers {
		out[i] = Server(&v)
	}
	return out, nil
}
556847
func Convert_core_ServicePort_To_v1_ServicePort(in *core.ServicePort, out *v1.ServicePort, s conversion.Scope) error {
	return autoConvert_core_ServicePort_To_v1_ServicePort(in, out, s)
}
575772
func (w *pgWorker) apiServerHostPorts() map[string][]network.HostPort {
	servers := make(map[string][]network.HostPort)
	for _, m := range w.machineTrackers {
		hostPorts := network.AddressesWithPort(m.Addresses(), w.config.APIPort)
		if len(hostPorts) == 0 {
			continue
		}
		servers[m.Id()] = hostPorts
	}
	return servers
}
883303
func (mp MemberMapping) ServerCertificates() StringSet {
	res := make(StringSet)
	for _, member := range mp {
		res[string(member.ServerTLSCert)] = struct{}{}
	}
	return res
}
1050350
func Convert_example_ReplicaSet_To_v1_ReplicaSet(in *example.ReplicaSet, out *ReplicaSet, s conversion.Scope) error {
	return autoConvert_example_ReplicaSet_To_v1_ReplicaSet(in, out, s)
}
75207
func (c *Conn) ListGroupsV1(request ListGroupsRequestV1) (ListGroupsResponseV1, error) {
	var response ListGroupsResponseV1

	err := c.readOperation(
		func(deadline time.Time, id int32) error {
			return c.writeRequest(listGroupsRequest, v1, 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 ListGroupsResponseV1{}, err
	}
	if response.ErrorCode != 0 {
		return ListGroupsResponseV1{}, Error(response.ErrorCode)
	}

	return response, nil
}