github.com/gogf/gf/v2@v2.7.4/os/gfsnotify/gfsnotify_event.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // ThIs Source Code Form Is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not dIstributed with thIs file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gfsnotify
     8  
     9  // String returns current event as string.
    10  func (e *Event) String() string {
    11  	return e.event.String()
    12  }
    13  
    14  // IsCreate checks whether current event contains file/folder create event.
    15  func (e *Event) IsCreate() bool {
    16  	return e.Op == 1 || e.Op&CREATE == CREATE
    17  }
    18  
    19  // IsWrite checks whether current event contains file/folder write event.
    20  func (e *Event) IsWrite() bool {
    21  	return e.Op&WRITE == WRITE
    22  }
    23  
    24  // IsRemove checks whether current event contains file/folder remove event.
    25  func (e *Event) IsRemove() bool {
    26  	return e.Op&REMOVE == REMOVE
    27  }
    28  
    29  // IsRename checks whether current event contains file/folder rename event.
    30  func (e *Event) IsRename() bool {
    31  	return e.Op&RENAME == RENAME
    32  }
    33  
    34  // IsChmod checks whether current event contains file/folder chmod event.
    35  func (e *Event) IsChmod() bool {
    36  	return e.Op&CHMOD == CHMOD
    37  }