feat: initial commit
This commit is contained in:
49
reach/client/protocol/set_base.go
Normal file
49
reach/client/protocol/set_base.go
Normal file
@ -0,0 +1,49 @@
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user