// Add adds a new DNS zone
332854
func (z *zones) Add(newZone dnsprovider.Zone) (dnsprovider.Zone, error) {
	domainCreateRequest := &godo.DomainCreateRequest{
		Name:      newZone.Name(),
		IPAddress: ipPlaceholder,
	}

	domain, err := createDomain(z.client, domainCreateRequest)
	if err != nil {
		return nil, err
	}

	return &zone{
		name:   domain.Name,
		client: z.client,
	}, nil
}
989782
func (c *client) Add(s interface{}, cert *ssh.Certificate, comment string) error {
	if cert == nil {
		return c.insertKey(s, comment)
	} else {
		return c.insertCert(s, cert, comment)
	}
}
442205
func (s *ReactionsService) Add(name string) *ReactionsAddCall {
	var call ReactionsAddCall
	call.service = s
	call.name = name
	return &call
}
401009
func (c *LockCache) Add(l Lock) error {
	// Store reference in both directions
	// Path -> Lock
	c.kv.Set(l.Path, &l)
	// EncodedId -> Lock (encoded so we can easily identify)
	c.kv.Set(c.encodeIdKey(l.Id), &l)
	return nil
}
258398
func (d *Data) Add(key string, value string) {
	d.Values.Add(key, value)
}
407350
func (s *inMemStore) Add(sess Session) {
	s.mux.Lock()
	defer s.mux.Unlock()

	s.logPrintln("Session added:", sess.ID())
	s.sessions[sess.ID()] = sess
}
426780
func Add(c *deis.Client, appID string, addresses []string) (api.Whitelist, error) {
	u := fmt.Sprintf("/v2/apps/%s/whitelist/", appID)

	req := api.Whitelist{Addresses: addresses}
	body, err := json.Marshal(req)
	if err != nil {
		return api.Whitelist{}, err
	}
	res, reqErr := c.Request("POST", u, body)
	if reqErr != nil && !deis.IsErrAPIMismatch(reqErr) {
		return api.Whitelist{}, reqErr
	}
	defer res.Body.Close()

	d := api.Whitelist{}
	if err = json.NewDecoder(res.Body).Decode(&d); err != nil {
		return api.Whitelist{}, err
	}

	return d, reqErr
}
941475
func (a *AddrManager) AddAddress(addr, srcAddr *wire.NetAddress) {
	a.mtx.Lock()
	defer a.mtx.Unlock()

	a.updateAddress(addr, srcAddr)
}
582114
func (c *ServiceConfigs) Add(name string, service *ServiceConfig) {
	c.mu.Lock()
	c.m[name] = service
	c.mu.Unlock()
}
709345
func (s *VPCRouterSetting) AddDHCPServer(nicIndex int, rangeStart string, rangeStop string, dnsServers ...string) (int, *VPCRouterDHCPServerConfig) {
	if s.DHCPServer == nil {
		s.DHCPServer = &VPCRouterDHCPServer{
			Enabled: "True",
		}
	}
	if s.DHCPServer.Config == nil {
		s.DHCPServer.Config = []*VPCRouterDHCPServerConfig{}
	}

	nic := fmt.Sprintf("eth%d", nicIndex)
	c := &VPCRouterDHCPServerConfig{
		Interface:  nic,
		RangeStart: rangeStart,
		RangeStop:  rangeStop,
		DNSServers: dnsServers,
	}
	s.DHCPServer.Config = append(s.DHCPServer.Config, c)

	return len(s.DHCPServer.Config) - 1, c
}
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
}
729525
func (i *Uint32) Add(n uint32) uint32 {
	return atomic.AddUint32(&i.v, n)
}
260939
func (n *Net) AddCIDR(s string, value interface{}) (err error) {
	var r *net.IPNet
	if _, r, err = net.ParseCIDR(s); err == nil {
		n.Add(r, value)
	}
	return
}
23876
func (r *Router) Add(rt *Route, rid int) {
	path := rt.Path
	ppath := path        // Pristine path
	pnames := []string{} // Param names
	uri := new(bytes.Buffer)
	defer func() {
		rt.Format = uri.String()
		rt.Params = pnames
	}()
	for i, l := 0, len(path); i < l; i++ {
		if path[i] == ':' {
			uri.WriteString(`%v`)
			j := i + 1

			r.insert(rt.Method, path[:i], nil, skind, "", nil, -1)
			for ; i < l && path[i] != '/'; i++ {
			}

			pnames = append(pnames, path[j:i])
			path = path[:j] + path[i:]
			i, l = j, len(path)

			if i == l {
				r.insert(rt.Method, path[:i], rt.Handler, pkind, ppath, pnames, rid)
				return
			}
			r.insert(rt.Method, path[:i], nil, pkind, ppath, pnames, -1)
		} else if path[i] == '*' {
			uri.WriteString(`%v`)
			r.insert(rt.Method, path[:i], nil, skind, "", nil, -1)
			pnames = append(pnames, "*")
			r.insert(rt.Method, path[:i+1], rt.Handler, akind, ppath, pnames, rid)
			return
		}

		if i < l {
			uri.WriteByte(path[i])
		}
	}

	//static route
	if m, ok := r.static[path]; ok {
		m.addHandler(rt.Method, rt.Handler, rid)
	} else {
		m = &methodHandler{}
		m.addHandler(rt.Method, rt.Handler, rid)
		r.static[path] = m
	}
	//r.insert(method, path, h, skind, ppath, pnames, e)
	return
}
348746
func (ns *NamedStopwatch) Add(name string) error {
	ns.Lock()
	defer ns.Unlock()

	return ns.add(name)
}
933241
func (z *Zone) Create(zoneInfo Info) (status *CreateStatus, err error) {
	if debug {
		fmt.Printf("DEBUG: Create WILL SET SharingID=%v domain=%v\n", zoneInfo.SharingID, zoneInfo.Name)
	}
	_, err = z.Post(fmt.Sprintf("/zones?sharing_id=%s", zoneInfo.SharingID), zoneInfo, &status)
	return
}
804773
func (missingPvtDataInfo MissingPvtDataInfo) Add(blkNum, txNum uint64, ns, coll string) {
	missingBlockPvtDataInfo, ok := missingPvtDataInfo[blkNum]
	if !ok {
		missingBlockPvtDataInfo = make(MissingBlockPvtdataInfo)
		missingPvtDataInfo[blkNum] = missingBlockPvtDataInfo
	}

	if _, ok := missingBlockPvtDataInfo[txNum]; !ok {
		missingBlockPvtDataInfo[txNum] = []*MissingCollectionPvtDataInfo{}
	}

	missingBlockPvtDataInfo[txNum] = append(missingBlockPvtDataInfo[txNum],
		&MissingCollectionPvtDataInfo{
			Namespace:  ns,
			Collection: coll})
}