code: func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) {
  	if opts.Key == "" {
  		return nil, fmt.Errorf("missing key")
  	}
  	if opts.SessionName == "" {
  		opts.SessionName = DefaultLockSessionName
  	}
  	if opts.SessionTTL == "" {
  		opts.SessionTTL = DefaultLockSessionTTL
  	} else {
  		if _, err := time.ParseDuration(opts.SessionTTL); err != nil {
  			return nil, fmt.Errorf("invalid SessionTTL: %v", err)
  		}
  	}
  	if opts.MonitorRetryTime == 0 {
  		opts.MonitorRetryTime = DefaultMonitorRetryTime
  	}
  	if opts.LockWaitTime == 0 {
  		opts.LockWaitTime = DefaultLockWaitTime
  	}
  	l := &Lock{
  		c:    c,
  		opts: opts,
  	}
  	return l, nil
  }
docs: // LockOpts returns a handle to a lock struct which can be used
  // to acquire and release the mutex. The key used must have
  // write permissions.