feat(CorrectionInput): method to configure the source of correction data

This commit is contained in:
2025-06-11 12:07:51 +02:00
parent abebc7d8c6
commit f560465364
7 changed files with 318 additions and 0 deletions

View 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
}
}