func (e *Envelope) SetExpire(exp time.Duration) {
	e.Expire = exp
}
SetExpire implements EnvelopeAPI.SetExpire.
package proto
import (
	"context"
	"fmt"
	"time"
	"github.com/pkg/errors"
	"github.com/SQLess/SQLess/crypto/hash"
)
type EnvelopeAPI interface {
	GetVersion() string
	GetTTL() time.Duration
	GetExpire() time.Duration
	GetNodeID() *RawNodeID
	GetContext() context.Context
	SetVersion(string)
	SetTTL(time.Duration)
	SetExpire(time.Duration)
	SetNodeID(*RawNodeID)
	SetContext(context.Context)
}
type Envelope struct {
	Version string        `json:"v"`
	TTL     time.Duration `json:"t"`
	Expire  time.Duration `json:"e"`
	NodeID  *RawNodeID    `json:"id"`
	_ctx    context.Context
}
type PingReq struct {
	Node Node
	Envelope
}
type PingResp struct {
	Msg string
	Envelope
}
type UploadMetricsReq struct {
	MFBytes [][]byte
	Envelope
}
type UploadMetricsResp struct {
	Msg string
	Envelope
}
type FindNeighborReq struct {
	ID    NodeID
	Roles []ServerRole
	Count int
	Envelope
}
type FindNeighborResp struct {
	Nodes []Node
	Msg   string
	Envelope
}
type FindNodeReq struct {
	ID NodeID
	Envelope
}
type FindNodeResp struct {
	Node *Node
	Msg  string
	Envelope
}
func (e *Envelope) GetVersion() string {
	return e.Version
}
func (e *Envelope) GetTTL() time.Duration {
	return e.TTL
}
func (e *Envelope) GetExpire() time.Duration {
	return e.Expire
}
func (e *Envelope) GetNodeID() *RawNodeID {
	return e.NodeID
}
func (e *Envelope) GetContext() context.Context {
	if e._ctx == nil {
		return context.Background()
	}
	return e._ctx
}
func (e *Envelope) SetVersion(ver string) {
	e.Version = ver
}
func (e *Envelope) SetTTL(ttl time.Duration) {
	e.TTL = ttl
}