Skip to content

Commit

Permalink
chore: add some comments for users
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina-Sakai committed Jan 15, 2025
1 parent 255c94f commit bfa6f2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/generic/thriftidl_provider_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func (o *thriftIDLProviderOptions) apply(opts []ThriftIDLProviderOption) {
}
}

// WithParseMode sets the parse mode.
// NOTE: when using WithIDLServiceName at the same time, parse mode will be ignored.
func WithParseMode(parseMode thrift.ParseMode) ThriftIDLProviderOption {
return ThriftIDLProviderOption{F: func(opt *thriftIDLProviderOptions) {
opt.parseMode = &parseMode
Expand All @@ -52,6 +54,8 @@ func WithGoTagDisabled(disable bool) ThriftIDLProviderOption {
}}
}

// WithIDLServiceName specifies the target IDL service to be parsed.
// NOTE: when using this option, the specified service is prioritized, and parse mode will be ignored.
func WithIDLServiceName(serviceName string) ThriftIDLProviderOption {
return ThriftIDLProviderOption{F: func(opt *thriftIDLProviderOptions) {
opt.serviceName = serviceName
Expand Down

0 comments on commit bfa6f2b

Please sign in to comment.