// NewuidmapPath returns an option func to configure a LinuxFactory with the
// provided ..
778981
func NewuidmapPath(newuidmapPath string) func(*LinuxFactory) error {
	return func(l *LinuxFactory) error {
		l.NewuidmapPath = newuidmapPath
		return nil
	}
}
616749
func (s *LDAPService) NewListLdapConfigurationsParams() *ListLdapConfigurationsParams {
	p := &ListLdapConfigurationsParams{}
	p.p = make(map[string]interface{})
	return p
}
1026465
func (s *BaremetalService) NewAddBaremetalDhcpParams(dhcpservertype string, password string, physicalnetworkid string, url string, username string) *AddBaremetalDhcpParams {
	p := &AddBaremetalDhcpParams{}
	p.p = make(map[string]interface{})
	p.p["dhcpservertype"] = dhcpservertype
	p.p["password"] = password
	p.p["physicalnetworkid"] = physicalnetworkid
	p.p["url"] = url
	p.p["username"] = username
	return p
}
769508
func (b *BoltCreator) NewHashMap(id string) (pinterface.IHashMap, error) {
	return NewHashMap(b.db, id)
}
916020
func MakeMapper(t TokenMapperFn, a AmountMapperFn) MapperFn {
	return func(r request.Request) (string, int64, error) {
		token, err := t(r)
		if err != nil {
			return "", -1, err
		}
		amount, err := a(r)
		if err != nil {
			return "", -1, err
		}
		return token, amount, nil
	}
}
202237
func (m *mapperDef) newMapper(c context.Context, j *mapper.Job, shardIdx int) (mapper.Mapper, error) {
	cfg := &api.JobConfig{}
	if err := proto.Unmarshal(j.Config.Params, cfg); err != nil {
		return nil, errors.Annotate(err, "failed to unmarshal JobConfig").Err()
	}
	return func(c context.Context, keys []*datastore.Key) error {
		return m.Func(c, j.ID, cfg, keys)
	}, nil
}
938449
func (s *VPNService) NewDeleteRemoteAccessVpnParams(publicipid string) *DeleteRemoteAccessVpnParams {
	p := &DeleteRemoteAccessVpnParams{}
	p.p = make(map[string]interface{})
	p.p["publicipid"] = publicipid
	return p
}
705558
func NewUUIDv4() (UUID, error) {
	uuid := UUID{}
	_, err := rand.Read([]byte(uuid[:]))
	if err != nil {
		return uuid, err
	}

	uuid.setVersion(UUIDv4)
	uuid.setVariant(UUIDVariantRFC4122)
	return uuid, nil
}
90566
func NewV5(ns *UUID, name []byte) (u *UUID, err error) {
	u = new(UUID)
	// Set all bits to truncated SHA1 hash generated from namespace
	// and name.
	u.setBytesFromHash(sha1.New(), ns[:], name)
	u.setVariant(ReservedRFC4122)
	u.setVersion(5)
	return
}
1356343
func NewMapper(opt Option) *Mapper {
	if opt.NameFunc == nil {
		opt.NameFunc = ToUpperCamelCase
	}
	if opt.TagName == "" {
		opt.TagName = "gluamapper"
	}
	return &Mapper{opt}
}
139003
func NewUUID(namespace, name string) ([]byte, error) {
	hash := md5.New()
	_, err := hash.Write([]byte(namespace))
	if err != nil {
		return nil, errors.Wrapf(err, "could not compute hash value for namespace %q", namespace)
	}
	_, err = hash.Write([]byte(name))
	if err != nil {
		return nil, errors.Wrapf(err, "could not compute hash value for name %q", name)
	}

	sum := hash.Sum(nil)

	uuid := make([]byte, 16)
	copy(uuid, sum)

	// set version(v3)
	internal.SetVersion(uuid, internal.VersionNameBasedMD5)
	// set layout(RFC4122)
	internal.SetLayout(uuid, internal.LayoutRFC4122)

	return uuid, nil
}
79529
func NewRawConfig(raw map[string]interface{}) (*RawConfig, error) {
	result := &RawConfig{Raw: raw}
	if err := result.init(); err != nil {
		return nil, err
	}

	return result, nil
}
213337
func NewMap(opts MapOptions) *Map {
	var (
		copyFn     CopyFn
		finalizeFn FinalizeFn
	)
	if pool := opts.KeyCopyPool; pool == nil {
		copyFn = func(k ident.ID) ident.ID {
			return ident.BytesID(append([]byte(nil), k.Bytes()...))
		}
	} else {
		copyFn = func(k ident.ID) ident.ID {
			bytes := k.Bytes()
			keyLen := len(bytes)
			pooled := pool.Get(keyLen)[:keyLen]
			copy(pooled, bytes)
			return ident.BytesID(pooled)
		}
		finalizeFn = func(k ident.ID) {
			if slice, ok := k.(ident.BytesID); ok {
				pool.Put(slice)
			}
		}
	}
	return mapAlloc(mapOptions{
		hash: func(id ident.ID) MapHash {
			return MapHash(xxhash.Sum64(id.Bytes()))
		},
		equals: func(x, y ident.ID) bool {
			return x.Equal(y)
		},
		copy:        copyFn,
		finalize:    finalizeFn,
		initialSize: opts.InitialSize,
	})
}
1216583
func NewMapInjector(tagname string, data map[string]interface{}) app.Injector {
	return app.Injector(MapInjector{
		tagname: tagname,
		data:    data,
	})
}
160962
func NewNameBasedSHA1(namespace, name string) (UUID, error) {
	u, err := sha1.NewUUID(namespace, name)
	if err != nil {
		return Nil, err
	}

	uuid := UUID{}
	copy(uuid[:], u)

	return uuid, nil
}
429477
func NewUUID() (*UUID, error) {
	u := &UUID{}
	if _, err := rand.Read(u[:]); err != nil {
		return nil, err
	}
	u.setVariant(reservedRFC4122)
	u.setVersion(4)
	return u, nil
}
1179474
func NewMap(name string) *Map {
	return &Map{
		Map: *bpf.NewMap(
			name,
			bpf.BPF_MAP_TYPE_LPM_TRIE,
			int(unsafe.Sizeof(Key{})),
			int(unsafe.Sizeof(RemoteEndpointInfo{})),
			MaxEntries,
			bpf.BPF_F_NO_PREALLOC, 0,
			func(key []byte, value []byte) (bpf.MapKey, bpf.MapValue, error) {
				k, v := Key{}, RemoteEndpointInfo{}

				if err := bpf.ConvertKeyValue(key, value, &k, &v); err != nil {
					return nil, nil, err
				}
				return &k, &v, nil
			},
		).WithCache(),
		deleteSupport: true,
	}
}