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

Commit

Permalink
add link durability and expiry session to target
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmaersk authored and vcabbage committed Nov 20, 2019
1 parent babf16c commit 0dbbfb4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions client.go
Expand Up @@ -1756,6 +1756,43 @@ func LinkMaxMessageSize(size uint64) LinkOption {
}
}

// LinkTargetDurability sets the target durability policy.
//
// Default: DurabilityNone.
func LinkTargetDurability(d Durability) LinkOption {
return func(l *link) error {
if d > DurabilityUnsettledState {
return errorErrorf("invalid Durability %d", d)
}

if l.target == nil {
l.target = new(target)
}
l.target.Durable = d

return nil
}
}

// LinkTargetExpiryPolicy sets the link expiration policy.
//
// Default: ExpirySessionEnd.
func LinkTargetExpiryPolicy(p ExpiryPolicy) LinkOption {
return func(l *link) error {
err := p.validate()
if err != nil {
return err
}

if l.target == nil {
l.target = new(target)
}
l.target.ExpiryPolicy = p

return nil
}
}

// LinkSourceDurability sets the source durability policy.
//
// Default: DurabilityNone.
Expand Down

0 comments on commit 0dbbfb4

Please sign in to comment.