Skip to content
This repository was archived by the owner on Dec 14, 2020. It is now read-only.

Commit 0dbbfb4

Browse files
carlosmaerskvcabbage
authored andcommitted
add link durability and expiry session to target
1 parent babf16c commit 0dbbfb4

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

client.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,43 @@ func LinkMaxMessageSize(size uint64) LinkOption {
17561756
}
17571757
}
17581758

1759+
// LinkTargetDurability sets the target durability policy.
1760+
//
1761+
// Default: DurabilityNone.
1762+
func LinkTargetDurability(d Durability) LinkOption {
1763+
return func(l *link) error {
1764+
if d > DurabilityUnsettledState {
1765+
return errorErrorf("invalid Durability %d", d)
1766+
}
1767+
1768+
if l.target == nil {
1769+
l.target = new(target)
1770+
}
1771+
l.target.Durable = d
1772+
1773+
return nil
1774+
}
1775+
}
1776+
1777+
// LinkTargetExpiryPolicy sets the link expiration policy.
1778+
//
1779+
// Default: ExpirySessionEnd.
1780+
func LinkTargetExpiryPolicy(p ExpiryPolicy) LinkOption {
1781+
return func(l *link) error {
1782+
err := p.validate()
1783+
if err != nil {
1784+
return err
1785+
}
1786+
1787+
if l.target == nil {
1788+
l.target = new(target)
1789+
}
1790+
l.target.ExpiryPolicy = p
1791+
1792+
return nil
1793+
}
1794+
}
1795+
17591796
// LinkSourceDurability sets the source durability policy.
17601797
//
17611798
// Default: DurabilityNone.

0 commit comments

Comments
 (0)