// OneInterface provides a mock function with given fields: a
179876
func (_m *RequesterVariadic) OneInterface(a ...interface{}) bool {
	var _ca []interface{}
	_ca = append(_ca, a...)
	ret := _m.Called(_ca...)

	var r0 bool
	if rf, ok := ret.Get(0).(func(...interface{}) bool); ok {
		r0 = rf(a...)
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}
559236
func addrsForInterface(iface *net.Interface) ([]net.IP, []net.IP) {
	var v4, v6, v6local []net.IP

	addrs, _ := iface.Addrs()
	for _, address := range addrs {
		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
			if ipnet.IP.To4() != nil {
				v4 = append(v4, ipnet.IP)
			} else {
				switch ip := ipnet.IP.To16(); ip != nil {
				case ip.IsGlobalUnicast():
					v6 = append(v6, ipnet.IP)
				case ip.IsLinkLocalUnicast():
					v6local = append(v6local, ipnet.IP)
				}
			}
		}
	}
	if len(v6) == 0 {
		v6 = v6local
	}
	return v4, v6
}
1184034
func (a *AttributeDefinition) IsInterface(attName string) bool {
	if !a.Type.IsObject() {
		panic("checking pointer field on non-object") // bug
	}
	att := a.Type.ToObject()[attName]
	if att == nil {
		return false
	}
	return att.Type.Kind() == AnyKind
}
62916
func (lf ListenerFunc) OnEvent(ctx context.Context, event Event) {
	lf(ctx, event)
}
470420
func (j *JsonQuery) Interface(s ...string) (interface{}, error) {
	val, err := rquery(j.blob, s...)
	if err != nil {
		return nil, err
	}
	return val, nil
}
76216
func findInterfaceNetwork(pIface *net.Interface, ip net.IP) (*net.Interface, *net.IPNet, error) {
	ifaces, err := vlanInterfaces(pIface)
	ifaces = append(ifaces, pIface)
	if err != nil {
		return nil, nil, err
	}
	for _, iface := range ifaces {
		if network, _ := findNetwork(iface, ip); network != nil {
			return iface, network, nil
		}
	}
	return nil, nil, fmt.Errorf("Failed to find IP %v on any interface", ip)
}
1092490
func (ns *NetworkSpec) newInterface(name string) *compute.NetworkInterface {
	var access []*compute.AccessConfig
	if name != "" {
		// This interface has an internet connection.
		access = append(access, &compute.AccessConfig{
			Name: name,
			Type: NetworkAccessOneToOneNAT,
			// NatIP (only set if using a reserved public IP)
		})
		// TODO(ericsnow) Will we need to support more access configs?
	}
	return &compute.NetworkInterface{
		Network:       ns.Path(),
		AccessConfigs: access,
	}
}
1201104
func GetInterfaces() (Interfaces, error) {
	interfaces, err := net.Interfaces()
	if err != nil {
		Logln("Can't get interfaces.", err)
		return nil, err
	}
	var ifaces Interfaces
	for _, iface := range interfaces {
		ifaces = append(ifaces, Interface(iface))
	}
	return ifaces, nil
}
1081351
func (env *maasEnviron) NetworkInterfaces(ctx context.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error) {
	inst, err := env.getInstance(ctx, instId)
	if err != nil {
		return nil, errors.Trace(err)
	}
	subnetsMap, err := env.subnetToSpaceIds(ctx)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if env.usingMAAS2() {
		dnsSearchDomains, err := env.Domains(ctx)
		if err != nil {
			return nil, errors.Trace(err)
		}
		return maas2NetworkInterfaces(ctx, inst.(*maas2Instance), subnetsMap, dnsSearchDomains...)
	} else {
		mi := inst.(*maas1Instance)
		return maasObjectNetworkInterfaces(ctx, mi.maasObject, subnetsMap)
	}
}
831038
func (s *Session) onInterface(i interface{}) {
	switch t := i.(type) {
	case *Ready:
		for _, g := range t.Guilds {
			setGuildIds(g)
		}
		s.onReady(t)
	case *GuildCreate:
		setGuildIds(t.Guild)
	case *GuildUpdate:
		setGuildIds(t.Guild)
	case *VoiceServerUpdate:
		go s.onVoiceServerUpdate(t)
	case *VoiceStateUpdate:
		go s.onVoiceStateUpdate(t)
	}
	err := s.State.OnInterface(s, i)
	if err != nil {
		s.log(LogDebug, "error dispatching internal event, %s", err)
	}
}
331649
func getInterface(c context.Context) config.Interface {
	return c.Value(&cfgKey).(config.Interface)
}
1007699
func (d *decodeState) arrayInterface() []interface{} {
	var v = make([]interface{}, 0)
	for {
		// Look ahead for ] - can only happen on first iteration.
		op := d.scanWhile(ScanSkipSpace)
		if op == ScanEndArray {
			break
		}

		// Back up so d.value can have the byte we just read.
		d.off--
		d.scan.undo(op)

		v = append(v, d.valueInterface())

		// Next token must be , or ].
		op = d.scanWhile(ScanSkipSpace)
		if op == ScanEndArray {
			break
		}
		if op != ScanArrayValue {
			d.error(errPhase)
		}
	}
	return v
}
319874
func (context *BaseContext) SetInterface(key string, value interface{}) {
	context.userData[key] = value
}
523942
func (address *Address) SetInterfaces(interfaces Interfaces) *Address {
	address.interfaces = interfaces
	return address
}
938327
func (context *BaseContext) GetInterface(
	key string, defaultValue ...interface{}) interface{} {
	if value, ok := context.userData[key]; ok {
		return value
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return nil
}
1251678
func ValidateInterface(v interface{}, ctx *Context) error {
	f := func(v string) (string, error) {
		return v, Validate(v, ctx)
	}

	walker := &renderWalker{
		F:       f,
		Replace: false,
	}
	err := reflectwalk.Walk(v, walker)
	if err != nil {
		return err
	}

	return nil
}
1013676
func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
	marshaled, err := json.Marshal(i)
	if err != nil {
		return e.AppendString(dst, fmt.Sprintf("marshaling error: %v", err))
	}
	return AppendEmbeddedJSON(dst, marshaled)
}