// MaxPayload returns the size limit that a message payload can have.
// This is set by the server configuration and delivered to the client
// upon connect.
511170
func (nc *Conn) MaxPayload() int64 {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.info.MaxPayload
}
1161380
func (msg *MsgFilterLoad) MaxPayloadLength(pver uint32) uint32 {
	// Num filter bytes (varInt) + filter + 4 bytes hash funcs +
	// 4 bytes tweak + 1 byte flags.
	return uint32(VarIntSerializeSize(MaxFilterLoadFilterSize)) +
		MaxFilterLoadFilterSize + 9
}
104288
func (c *ClosingSigned) MaxPayloadLength(uint32) uint32 {
	var length uint32

	// ChannelID - 32 bytes
	length += 32

	// FeeSatoshis - 8 bytes
	length += 8

	// Signature - 64 bytes
	length += 64

	return length
}
802550
func (o *PutServiceIDInvalidBackend) WithPayload(payload models.Error) *PutServiceIDInvalidBackend {
	o.Payload = payload
	return o
}
16770
func (o *GetMapNameOK) WithPayload(payload *models.BPFMap) *GetMapNameOK {
	o.Payload = payload
	return o
}
382619
func (o *PutServiceIDInvalidFrontend) WithPayload(payload models.Error) *PutServiceIDInvalidFrontend {
	o.Payload = payload
	return o
}
1223285
func (o *DeleteEndpointIDErrors) WithPayload(payload int64) *DeleteEndpointIDErrors {
	o.Payload = payload
	return o
}
725295
func (w *WebRTCSignalMessage) ParsePayload() (*Payload, error) {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.isParsed {
		return w.parsedPayload, nil
	}

	payload := &Payload{}
	if err := json.Unmarshal(w.Payload, payload); err != nil {
		return nil, err
	}

	w.parsedPayload = payload
	return payload, nil
}
949361
func (s *Sensu) postPayload(endpoint string, payload string) (map[string]interface{}, error) {
	url := fmt.Sprintf("%s/%s", s.URL, endpoint)

	req, err := http.NewRequest("POST", url, strings.NewReader(fmt.Sprintf("%s\n\n", payload)))

	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Content-Length", fmt.Sprintf("%d", len(payload)))

	if err != nil {
		return nil, fmt.Errorf("Parsing error: %q returned: %v", url, err)
	}
	res, err := s.doHTTP(req)
	if err != nil {
		return nil, fmt.Errorf("API call to %q returned: %v", url, err)
	}
	return s.doJSON(res)
}
34275
func (o *GetItemsOK) WithPayload(payload []models.Item) *GetItemsOK {
	o.Payload = payload
	return o
}
4549
func (o *PatchEndpointIDInvalid) WithPayload(payload models.Error) *PatchEndpointIDInvalid {
	o.Payload = payload
	return o
}
966049
func MaxSendMsgSize(m int) ServerOption {
	return newFuncServerOption(func(o *serverOptions) {
		o.maxSendMessageSize = m
	})
}
640612
func maxNetAddressPayload(pver uint32) uint32 {
	// Services 8 bytes + ip 16 bytes + port 2 bytes.
	plen := uint32(26)

	// NetAddressTimeVersion added a timestamp field.
	if pver >= NetAddressTimeVersion {
		// Timestamp 4 bytes.
		plen += 4
	}

	return plen
}
862738
func (s *Message) SetPayload(v []byte) *Message {
	s.Payload = v
	return s
}
1019755
func (nsPayloads_) asPayload(doc payloadDoc) payload.FullPayloadInfo {
	labels := make([]string, len(doc.Labels))
	copy(labels, doc.Labels)
	p := payload.FullPayloadInfo{
		Payload: payload.Payload{
			PayloadClass: charm.PayloadClass{
				Name: doc.Name,
				Type: doc.Type,
			},
			ID:     doc.RawID,
			Status: doc.State,
			Labels: labels,
			Unit:   doc.UnitID,
		},
		Machine: doc.MachineID,
	}
	return p
}
700680
func (g *gossipServiceImpl) AddPayload(chainID string, payload *gproto.Payload) error {
	g.lock.RLock()
	defer g.lock.RUnlock()
	return g.chains[chainID].AddPayload(payload)
}
43644
func MaxSendMsgSize(s int) client.Option {
	return func(o *client.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, maxSendMsgSizeKey{}, s)
	}
}