// Add exposes the ability for each versioned client to register itself for use
500227
func Add(v string, constraint version.Constraints, creator Creator) {
	Clients[v] = &VersionedClient{constraint, creator}
}
1113371
func (c *DbClient) Add(path string, entry *decoder.FileDataEntry) {
	c.Lock()
	defer c.Unlock()

	if entry == nil {
		return
	}

	fileData, ok := c.db[path]
	if ok {
		value, ok := fileData[entry.Key]
		if ok {
			if !bytes.Equal(value.data, entry.Value) {
				rev := value.rev + 1
				fileData[entry.Key] = &dbEntry{entry.Value, rev}
			}
		} else {
			fileData[entry.Key] = &dbEntry{entry.Value, initialRev}
		}
	} else {
		fileData = map[string]*dbEntry{entry.Key: {entry.Value, initialRev}}
	}

	c.db[path] = fileData
}
1369110
func (c *CollisionSystem) Add(basic *ecs.BasicEntity, collision *CollisionComponent, space *SpaceComponent) {
	c.entities = append(c.entities, collisionEntity{basic, collision, space})
}
863208
func (t *Manager) Add(api Definition) (err error) {
	if api.Name == "" || api.FullName == "" {
		name, fullname := t.NameGenerator(t, api)
		if api.Name == "" {
			api.Name = name
		}
		if api.FullName == "" {
			api.FullName = fullname
		}
	}
	if api.Method == "" {
		api.Method = t.MethodGenerator(t, api)
	}
	if api.Pattern == "" {
		api.Pattern = t.PatternGenerator(t, api)
	}
	key := t.GetMethodPatternKey(t, api)
	if _, exist := t.apiMethodPatternMap[key]; exist {
		return ErrorAPIRegisted2.New(nil, api.Method, api.Pattern)
	}
	t.apiMethodPatternMap[key] = api
	return
}
560769
func (r *ListenerRegistry) Add(key interface{}, listener func()) {
	if key == nil {
		key = new(int)
	}
	if _, ok := r.listeners[key]; ok {
		panic("duplicate listener key")
	}
	r.listeners[key] = listener
}
492558
func (s *Services) add(newServs []*apitypes.UserService) error {
	var err error
	// check if adding service conflict with existing ones
	exist := make(map[serviceKey]bool, s.size())
	for _, srv := range s.spec {
		exist[serviceKey{srv.ServiceIP, srv.ServicePort, srv.Protocol}] = true
	}
	for _, srv := range newServs {
		if exist[serviceKey{srv.ServiceIP, srv.ServicePort, srv.Protocol}] {
			err = fmt.Errorf("service %v conflicts with existing ones", newServs)
			s.Log(ERROR, err)
			return err
		}
		exist[serviceKey{srv.ServiceIP, srv.ServicePort, srv.Protocol}] = true
	}

	// if pod is running, convert service to patch and send to vm
	if s.p.IsRunning() {
		if err = s.commit(newServs, "add"); err != nil {
			return err
		}
	}
	s.spec = append(s.spec, newServs...)

	return nil
}
211831
func (l *ProviderList) Add(provider common.Provider) *ProviderList {
	l.providers = append(l.providers, provider)
	return l
}
765456
func (idm *IdentityManager) Add(identity *identity.Identity) {
	idm.mutex.Lock()
	defer idm.mutex.Unlock()
	idm.add(identity)
}
540340
func add(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
	if len(args) < 2 {
		return errAtLeastOneArgument("ADD")
	}
	var chown string
	last := len(args) - 1
	dest := makeAbsolute(args[last], b.RunConfig.WorkingDir)
	if len(flagArgs) > 0 {
		for _, arg := range flagArgs {
			switch {
			case strings.HasPrefix(arg, "--chown="):
				chown = strings.TrimPrefix(arg, "--chown=")
			default:
				return fmt.Errorf("ADD only supports the --chown=<uid:gid> flag")
			}
		}
	}
	b.PendingCopies = append(b.PendingCopies, Copy{Src: args[0:last], Dest: dest, Download: true, Chown: chown})
	return nil
}
5634
func (c *Client) Add(ctx context.Context, u *chronograf.User) (*chronograf.User, error) {
	_, err := c.Query(ctx, chronograf.Query{
		Command: fmt.Sprintf(`CREATE USER "%s" WITH PASSWORD '%s'`, u.Name, u.Passwd),
	})
	if err != nil {
		return nil, err
	}
	for _, p := range u.Permissions {
		if err := c.grantPermission(ctx, u.Name, p); err != nil {
			return nil, err
		}
	}
	return c.Get(ctx, chronograf.UserQuery{Name: &u.Name})
}
495110
func (b *FooJSONBuilder) Add(info *FooPropertyInfo) *FooJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
889825
func (b *multiErrBuilder) Add(err error) {
	if err != nil {
		b.errs = append(b.errs, err)
	}
}
1330678
func (s *service) Add(reqDTO rest.RequestDTOCreation) (resDTO rest.ResponseDTO, error *servicehelper.Error) {
	entity, err := createEntityFromDTO(reqDTO, true)
	if err != nil {
		return rest.ResponseDTO{}, err
	} else if s.repo.Create(entity) {
		return createDTOFromEntity(entity)
	}
	return rest.ResponseDTO{}, &servicehelper.Error{Detail: errors.New("could not be created"), Code: servicehelper.AlreadyExist}
}
1328553
func (r *keyring) Add(key AddedKey) error {
	r.mu.Lock()
	defer r.mu.Unlock()
	if r.locked {
		return errLocked
	}
	signer, err := ssh.NewSignerFromKey(key.PrivateKey)

	if err != nil {
		return err
	}

	if cert := key.Certificate; cert != nil {
		signer, err = ssh.NewCertSigner(cert, signer)
		if err != nil {
			return err
		}
	}

	r.keys = append(r.keys, privKey{signer, key.Comment})

	return nil
}
675617
func (b *batchAgg) Add(ev interface{}) {
	// from muster godoc: "The Batch does not need to be safe for concurrent
	// access; synchronization will be handled by the Client."
	if b.batches == nil {
		b.batches = map[string][]*Event{}
	}
	e := ev.(*Event)
	// collect separate buckets of events to send based on the trio of api/wk/ds
	// if all three of those match it's safe to send all the events in one batch
	key := fmt.Sprintf("%s_%s_%s", e.APIHost, e.APIKey, e.Dataset)
	b.batches[key] = append(b.batches[key], e)
}
52990
func (c *client) Add(key AddedKey) error {
	var constraints []byte

	if secs := key.LifetimeSecs; secs != 0 {
		constraints = append(constraints, agentConstrainLifetime)

		var secsBytes [4]byte
		binary.BigEndian.PutUint32(secsBytes[:], secs)
		constraints = append(constraints, secsBytes[:]...)
	}

	if key.ConfirmBeforeUse {
		constraints = append(constraints, agentConstrainConfirm)
	}

	if cert := key.Certificate; cert == nil {
		return c.insertKey(key.PrivateKey, key.Comment, constraints)
	} else {
		return c.insertCert(key.PrivateKey, cert, key.Comment, constraints)
	}
}
432540
func (s *ServersStore) Add(ctx context.Context, d chronograf.Server) (chronograf.Server, error) {
	err := validOrganization(ctx)
	if err != nil {
		return chronograf.Server{}, err
	}

	d.Organization = s.organization
	return s.store.Add(ctx, d)
}