mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Add Route DB model
This commit is contained in:
		
							parent
							
								
									99e33181b2
								
							
						
					
					
						commit
						e88ff0f7d9
					
				
							
								
								
									
										14
									
								
								routes.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								routes.go
									
									
									
									
									
								
							@ -3,12 +3,26 @@ package headscale
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
 | 
			
		||||
	"gorm.io/gorm"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	ErrRouteIsNotAvailable = Error("route is not available")
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Route struct {
 | 
			
		||||
	gorm.Model
 | 
			
		||||
 | 
			
		||||
	MachineID uint64
 | 
			
		||||
	Machine   Machine
 | 
			
		||||
	Prefix    IPPrefix
 | 
			
		||||
 | 
			
		||||
	Advertised bool
 | 
			
		||||
	Enabled    bool
 | 
			
		||||
	IsPrimary  bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Deprecated: use machine function instead
 | 
			
		||||
// GetAdvertisedNodeRoutes returns the subnet routes advertised by a node (identified by
 | 
			
		||||
// namespace and node name).
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user