github.com/micro/go-micro/v2@v2.9.1/sync/options.go (about)

     1  package sync
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // Nodes sets the addresses to use
     8  func Nodes(a ...string) Option {
     9  	return func(o *Options) {
    10  		o.Nodes = a
    11  	}
    12  }
    13  
    14  // Prefix sets a prefix to any lock ids used
    15  func Prefix(p string) Option {
    16  	return func(o *Options) {
    17  		o.Prefix = p
    18  	}
    19  }
    20  
    21  // LockTTL sets the lock ttl
    22  func LockTTL(t time.Duration) LockOption {
    23  	return func(o *LockOptions) {
    24  		o.TTL = t
    25  	}
    26  }
    27  
    28  // LockWait sets the wait time
    29  func LockWait(t time.Duration) LockOption {
    30  	return func(o *LockOptions) {
    31  		o.Wait = t
    32  	}
    33  }