gitlab.com/evatix-go/core@v1.3.55/regexnew/newCreator.go (about)

     1  package regexnew
     2  
     3  import "regexp"
     4  
     5  type newCreator struct {
     6  	LazyRegex newLazyRegexCreator
     7  }
     8  
     9  // Lazy
    10  //
    11  //  used to create from vars
    12  func (it newCreator) Lazy(pattern string) *LazyRegex {
    13  	return it.LazyRegex.New(pattern)
    14  }
    15  
    16  // LazyLock
    17  //
    18  //  used from method inside to create
    19  func (it newCreator) LazyLock(pattern string) *LazyRegex {
    20  	return it.LazyRegex.NewLock(pattern)
    21  }
    22  
    23  func (it newCreator) Default(pattern string) (*regexp.Regexp, error) {
    24  	return Create(pattern)
    25  }
    26  
    27  func (it newCreator) DefaultLock(pattern string) (*regexp.Regexp, error) {
    28  	return CreateLock(pattern)
    29  }
    30  
    31  func (it newCreator) DefaultLockIf(
    32  	isLock bool,
    33  	pattern string,
    34  ) (*regexp.Regexp, error) {
    35  	return CreateLockIf(
    36  		isLock,
    37  		pattern)
    38  }
    39  
    40  func (it newCreator) DefaultApplicableLock(pattern string) (
    41  	regEx *regexp.Regexp,
    42  	err error,
    43  	isApplicable bool,
    44  ) {
    45  	return CreateApplicableLock(pattern)
    46  }