50 lines
997 B
Go
50 lines
997 B
Go
package protocol
|
|
|
|
type SetBaseOptions struct {
|
|
Mode *string
|
|
AntennaOffset *float64
|
|
Latitude *float64
|
|
Longitude *float64
|
|
Height *float64
|
|
}
|
|
|
|
type SetBaseOptionFunc func(opts *SetBaseOptions)
|
|
|
|
func NewSetBaseOptions(funcs ...SetBaseOptionFunc) *SetBaseOptions {
|
|
opts := &SetBaseOptions{}
|
|
for _, fn := range funcs {
|
|
fn(opts)
|
|
}
|
|
return opts
|
|
}
|
|
|
|
func WithBaseMode(value string) SetBaseOptionFunc {
|
|
return func(opts *SetBaseOptions) {
|
|
opts.Mode = &value
|
|
}
|
|
}
|
|
|
|
func WithBaseAntennaOffset(value float64) SetBaseOptionFunc {
|
|
return func(opts *SetBaseOptions) {
|
|
opts.AntennaOffset = &value
|
|
}
|
|
}
|
|
|
|
func WithBaseLatitude(value float64) SetBaseOptionFunc {
|
|
return func(opts *SetBaseOptions) {
|
|
opts.Latitude = &value
|
|
}
|
|
}
|
|
|
|
func WithBaseLongitude(value float64) SetBaseOptionFunc {
|
|
return func(opts *SetBaseOptions) {
|
|
opts.Longitude = &value
|
|
}
|
|
}
|
|
|
|
func WithBaseHeight(value float64) SetBaseOptionFunc {
|
|
return func(opts *SetBaseOptions) {
|
|
opts.Height = &value
|
|
}
|
|
}
|