github.com/glide-im/glide@v1.6.0/pkg/messages/actions.go (about)

     1  package messages
     2  
     3  import "strings"
     4  
     5  // Action is the type of action that is being performed.
     6  type Action string
     7  
     8  const (
     9  	ActionHello               Action = "hello"
    10  	ActionHeartbeat                  = "heartbeat"
    11  	ActionNotifyUnknownAction        = "notify.unknown.action"
    12  
    13  	ActionChatMessage       = "message.chat"
    14  	ActionChatMessageResend = "message.chat.resend"
    15  	ActionGroupMessage      = "message.group"
    16  
    17  	ActionAuthenticate          = "authenticate"
    18  	ActionNotifyError           = "notify.error"
    19  	ActionNotifySuccess         = "notify.success"
    20  	ActionNotifyKickOut         = "notify.kickout"
    21  	ActionNotifyForbidden       = "notify.forbidden"
    22  	ActionNotifyUnauthenticated = "notify.unauthenticated"
    23  
    24  	ActionInternalOnline  = "internal.online"
    25  	ActionInternalOffline = "internal.offline"
    26  )
    27  
    28  func (a Action) IsInternal() bool {
    29  	return strings.HasPrefix(string(a), "internal.")
    30  }