// NewV3MailInit ...
164840
func NewV3MailInit(from *Email, subject string, to *Email, content ...*Content) *SGMailV3 {
	m := new(SGMailV3)
	m.SetFrom(from)
	m.Subject = subject
	p := NewPersonalization()
	p.AddTos(to)
	m.AddPersonalizations(p)
	m.AddContent(content...)
	return m
}
175965
func NewInitMessage(clientName string, user string, password string) InitMessage {
	var authToken map[string]interface{}
	if user == "" {
		authToken = map[string]interface{}{
			"scheme": "none",
		}
	} else {
		authToken = map[string]interface{}{
			"scheme":      "basic",
			"principal":   user,
			"credentials": password,
		}
	}

	return InitMessage{
		clientName: clientName,
		authToken:  authToken,
	}
}
521827
func (nc *Conn) initNewResp() {
	// _INBOX wildcard
	nc.respSub = fmt.Sprintf("%s.*", NewInbox())
	nc.respMap = make(map[string]chan *Msg)
	nc.respRand = rand.New(rand.NewSource(time.Now().UnixNano()))
}
654129
func (m *DummyMailbox) NewMessage() Message {
	return &DummyMessage{
		sequenceNumber: 0,
		uid:            0,
		header:         make(textproto.MIMEHeader),
		internalDate:   time.Now(),
		flags:          types.Flags(0),
		mailstore:      m.mailstore,
		mailboxID:      m.ID,
		body:           "",
	}
}
467833
func (p *peer) sendInitMsg() error {
	msg := lnwire.NewInitMessage(
		p.server.globalFeatures.RawFeatureVector,
		p.localFeatures,
	)

	return p.writeMessage(msg)
}
99363
func NewEmailValidator(apiKey string) *EmailValidatorImpl {
	isPublicKey := false

	// Did the user pass in a public key?
	if strings.HasPrefix(apiKey, "pubkey-") {
		isPublicKey = true
	}

	return &EmailValidatorImpl{
		client:      http.DefaultClient,
		isPublicKey: isPublicKey,
		apiBase:     APIBase,
		apiKey:      apiKey,
	}
}
868710
func NewV3(ns *UUID, name []byte) (u *UUID, err error) {
	if ns == nil {
		err = errors.New("Invalid namespace UUID")
		return
	}
	u = new(UUID)
	// Set all bits to MD5 hash generated from namespace and name.
	u.setBytesFromHash(md5.New(), ns[:], name)
	u.setVariant(ReservedRFC4122)
	u.setVersion(3)
	return
}
836427
func NewMessage(to []string, subject, body string) *Message {
	return NewMessageFrom(to, setting.MailService.From, subject, body)
}
1158383
func (c *Client) SendMailV31(data *MessagesV31) (*ResultsV31, error) {
	url := c.apiBase + ".1/send"
	req, err := createRequest("POST", url, data, nil)
	if err != nil {
		return nil, err
	}

	req.Header.Set("Content-Type", "application/json")
	req.SetBasicAuth(c.APIKeyPublic(), c.APIKeyPrivate())

	r, err := c.httpClient.SendMailV31(req)
	if err != nil {
		return nil, err
	}

	decoder := json.NewDecoder(r.Body)

	switch r.StatusCode {
	case http.StatusOK:

		var res ResultsV31
		if err := decoder.Decode(&res); err != nil {
			return nil, err
		}
		return &res, nil

	case http.StatusBadRequest, http.StatusForbidden:

		var apiFeedbackErr APIFeedbackErrorsV31
		if err := decoder.Decode(&apiFeedbackErr); err != nil {
			return nil, err
		}
		return nil, &apiFeedbackErr

	default:

		var errInfo ErrorInfoV31
		if err := decoder.Decode(&errInfo); err != nil {
			return nil, err
		}
		return nil, &errInfo
	}
}
636095
func NewPremailerFromFile(filename string, options *Options) (Premailer, error) {
	fd, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer fd.Close()
	d, err := goquery.NewDocumentFromReader(fd)
	if err != nil {
		return nil, err
	}
	return NewPremailer(d, options), nil
}
721442
func NewFacadeV3(context facade.Context) (*CloudAPIV3, error) {
	v4, err := NewFacadeV4(context)
	if err != nil {
		return nil, err
	}
	return &CloudAPIV3{v4}, nil
}
977304
func (s *JobOperation) SetS3InitiateRestoreObject(v *S3InitiateRestoreObjectOperation) *JobOperation {
	s.S3InitiateRestoreObject = v
	return s
}
1254194
func (factory *EmailBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := EmailBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
423621
func (nc *Conn) newRespInbox() string {
	if nc.respMap == nil {
		nc.initNewResp()
	}
	var b [respInboxPrefixLen + replySuffixLen]byte
	pres := b[:respInboxPrefixLen]
	copy(pres, nc.respSub)
	rn := nc.respRand.Int63()
	for i, l := respInboxPrefixLen, rn; i < len(b); i++ {
		b[i] = rdigits[l%base]
		l /= base
	}
	return string(b[:])
}
474073
func NewDomainInvitesEmailExistingUsersType(Description string) *DomainInvitesEmailExistingUsersType {
	s := new(DomainInvitesEmailExistingUsersType)
	s.Description = Description
	return s
}
39258
func NewEmailMessage(l level.Priority, e Email) Composer {
	m := MakeEmailMessage(e)
	_ = m.SetPriority(l)

	return m
}
361643
func Init() error {
	var err error
	family, err = netlink.Family(familyName)
	if err != nil {
		return err
	}

	return netlink.SendMessageUnmarshal(C.IPVS_CMD_GET_INFO, family, 0, &info)
}