feat(CorrectionInput): method to configure the source of correction data
This commit is contained in:
56
reach/client/protocol/set_base_correction.go
Normal file
56
reach/client/protocol/set_base_correction.go
Normal file
@ -0,0 +1,56 @@
|
||||
package protocol
|
||||
|
||||
type SetBaseCorrectionsOptions struct {
|
||||
Address *string
|
||||
Port *int
|
||||
Username *string
|
||||
Password *string
|
||||
MountPoint *string
|
||||
SendPositionToBase *bool
|
||||
}
|
||||
|
||||
type SetBaseCorrectionsFunc func(opts *SetBaseCorrectionsOptions)
|
||||
|
||||
func NewSetBaseCorrectionsOptions(funcs ...SetBaseCorrectionsFunc) *SetBaseCorrectionsOptions {
|
||||
opts := &SetBaseCorrectionsOptions{}
|
||||
for _, fn := range funcs {
|
||||
fn(opts)
|
||||
}
|
||||
return opts
|
||||
}
|
||||
|
||||
func WithNTRIPAddress(value string) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.Address = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithNTRIPPort(value int) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.Port = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithNTRIPUsername(value string) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.Username = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithNTRIPPassword(value string) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.Password = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithNTRIPMountPoint(value string) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.MountPoint = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithSendPositionToBase(value bool) SetBaseCorrectionsFunc {
|
||||
return func(opts *SetBaseCorrectionsOptions) {
|
||||
opts.SendPositionToBase = &value
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user