aboutsummaryrefslogtreecommitdiff
path: root/backend/internal/ibd/options.go
blob: 2b54707e76751ecf605b2dcca369677eba3851a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package ibd

import "github.com/ansg191/ibd-trader/backend/internal/ibd/transport"

type optionFunc func(*options)

var defaultOptions = options{
	expectedStatuses: []int{200},
}

type options struct {
	expectedStatuses []int
	requiredProps    transport.Properties
}

func withExpectedStatuses(statuses ...int) optionFunc {
	return func(o *options) {
		o.expectedStatuses = append(o.expectedStatuses, statuses...)
	}
}

func withRequiredProps(props transport.Properties) optionFunc {
	return func(o *options) {
		o.requiredProps = props
	}
}