func NewWriteableLeaseFrame(ttl time.Duration, n uint32, metadata []byte) *WriteableLeaseFrame {
	var a, b [4]byte
	binary.BigEndian.PutUint32(a[:], uint32(common.ToMilliseconds(ttl)))
	binary.BigEndian.PutUint32(b[:], n)
	var flag core.FrameFlag
	if len(metadata) > 0 {
		flag |= core.FlagMetadata
	}
	h := core.NewFrameHeader(0, core.FrameTypeLease, flag)
	t := newWriteableFrame(h)
	return &WriteableLeaseFrame{
		writeableFrame: t,
		ttl:            a,
		n:              b,
		metadata:       metadata,
	}
}
NewWriteableLeaseFrame creates a new WriteableLeaseFrame.
package framing
import (
	"encoding/binary"
	"io"
	"time"
	"github.com/rsocket/rsocket-go/core"
	"github.com/rsocket/rsocket-go/internal/common"
)
type WriteableLeaseFrame struct {
	writeableFrame
	ttl      [4]byte
	n        [4]byte
	metadata []byte
}