(bucketName core.BucketName, key string, value []byte, flag DataFlag, timestamp uint64, options ...MessageOptions)
| 71 | } |
| 72 | |
| 73 | func NewMessage(bucketName core.BucketName, key string, value []byte, flag DataFlag, timestamp uint64, options ...MessageOptions) *Message { |
| 74 | var priority MessagePriority |
| 75 | // default priority is medium |
| 76 | priority = MessagePriorityMedium |
| 77 | |
| 78 | if len(options) > 0 { |
| 79 | priority = options[0].Priority |
| 80 | } |
| 81 | |
| 82 | return &Message{ |
| 83 | BucketName: bucketName, |
| 84 | Key: key, |
| 85 | Value: value, |
| 86 | Flag: flag, |
| 87 | Timestamp: timestamp, |
| 88 | priority: priority, |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func NewWatchOptions() *WatchOptions { |
| 93 | return &WatchOptions{ |
no outgoing calls