-
-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1807 from c9s/c9s/xalign/improvements
FEATURE: [livenote] object comparison, comments and mentions
- Loading branch information
Showing
7 changed files
with
519 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ exchangeStrategies: | |
livenote: | ||
symbol: BTCUSDT | ||
interval: 5m | ||
userID: U12345678 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,61 @@ | ||
package livenote | ||
|
||
import "time" | ||
|
||
type Option interface{} | ||
|
||
type Mention struct { | ||
User string | ||
type OptionChannel struct { | ||
Channel string | ||
} | ||
|
||
func Channel(channel string) *OptionChannel { | ||
return &OptionChannel{ | ||
Channel: channel, | ||
} | ||
} | ||
|
||
type OptionCompare struct { | ||
Value bool | ||
} | ||
|
||
func CompareObject(value bool) *OptionCompare { | ||
return &OptionCompare{Value: value} | ||
} | ||
|
||
type OptionOneTimeMention struct { | ||
Users []string | ||
} | ||
|
||
func OneTimeMention(users ...string) *OptionOneTimeMention { | ||
return &OptionOneTimeMention{Users: users} | ||
} | ||
|
||
type Comment struct { | ||
type OptionComment struct { | ||
Text string | ||
Users []string | ||
} | ||
|
||
func Comment(text string, users ...string) *OptionComment { | ||
return &OptionComment{ | ||
Text: text, | ||
Users: users, | ||
} | ||
} | ||
|
||
type OptionTimeToLive struct { | ||
Duration time.Duration | ||
} | ||
|
||
func TimeToLive(du time.Duration) *OptionTimeToLive { | ||
return &OptionTimeToLive{Duration: du} | ||
} | ||
|
||
type OptionPin struct { | ||
Value bool | ||
} | ||
|
||
func Pin(value bool) *OptionPin { | ||
return &OptionPin{ | ||
Value: value, | ||
} | ||
} |
Oops, something went wrong.