57 lines
1.3 KiB
Go
57 lines
1.3 KiB
Go
|
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
|
||
|
}
|
||
|
}
|