aboutsummaryrefslogtreecommitdiffstats
path: root/common/context/option.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/context/option.go')
-rw-r--r--common/context/option.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/common/context/option.go b/common/context/option.go
new file mode 100644
index 0000000..7c40cd4
--- /dev/null
+++ b/common/context/option.go
@@ -0,0 +1,27 @@
+package context
+
+type Option func(*Context)
+
+func WithIsDem(isDem bool) Option {
+ return func(ctx *Context) {
+ ctx.isDem = isDem
+ }
+}
+
+func WithIsQWD(isQWD bool) Option {
+ return func(ctx *Context) {
+ ctx.isQWD = isQWD
+ }
+}
+
+func WithIsMVD(isMVD bool) Option {
+ return func(ctx *Context) {
+ ctx.isMVD = isMVD
+ }
+}
+
+func WithProtocolVersion(protocolVersion uint32) Option {
+ return func(ctx *Context) {
+ ctx.protocolVersion = protocolVersion
+ }
+}