aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/yandex/tvm/roles_parser_opts.go
blob: b9b0fb6819a201819bf6c93ff568b244ba020c6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package tvm

type RoleParserOption func(options *rolesParserOptions)
type rolesParserOptions struct {
	UseLightIndex bool
}

func newRolesParserOptions(opts ...RoleParserOption) *rolesParserOptions {
	options := &rolesParserOptions{}

	for _, opt := range opts {
		opt(options)
	}

	return options
}

func WithLightIndex() RoleParserOption {
	return func(options *rolesParserOptions) {
		options.UseLightIndex = true
	}
}