mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-09 07:15:15 +02:00
Add route selection to iOS (#1944)
This commit is contained in:
36
client/ios/NetBirdSDK/routes.go
Normal file
36
client/ios/NetBirdSDK/routes.go
Normal file
@ -0,0 +1,36 @@
|
||||
package NetBirdSDK
|
||||
|
||||
// RoutesSelectionInfoCollection made for Java layer to get non default types as collection
|
||||
type RoutesSelectionInfoCollection interface {
|
||||
Add(s string) RoutesSelectionInfoCollection
|
||||
Get(i int) string
|
||||
Size() int
|
||||
}
|
||||
|
||||
type RoutesSelectionDetails struct {
|
||||
All bool
|
||||
Append bool
|
||||
items []RoutesSelectionInfo
|
||||
}
|
||||
|
||||
type RoutesSelectionInfo struct {
|
||||
ID string
|
||||
Network string
|
||||
Selected bool
|
||||
}
|
||||
|
||||
// Add new PeerInfo to the collection
|
||||
func (array RoutesSelectionDetails) Add(s RoutesSelectionInfo) RoutesSelectionDetails {
|
||||
array.items = append(array.items, s)
|
||||
return array
|
||||
}
|
||||
|
||||
// Get return an element of the collection
|
||||
func (array RoutesSelectionDetails) Get(i int) *RoutesSelectionInfo {
|
||||
return &array.items[i]
|
||||
}
|
||||
|
||||
// Size return with the size of the collection
|
||||
func (array RoutesSelectionDetails) Size() int {
|
||||
return len(array.items)
|
||||
}
|
Reference in New Issue
Block a user