Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FailOnRouterPortConflicts = false
View Source
var InvalidPortError = errors.New("Port must be between 1024 and 65535")
View Source
var ReservedSystemComponentPorts = []uint16{}
Functions ¶
This section is empty.
Types ¶
type ModificationTag ¶
type ModificationTag struct { Guid string `gorm:"column:modification_guid" json:"guid"` Index uint32 `gorm:"column:modification_index" json:"index"` }
func NewModificationTag ¶
func NewModificationTag() (ModificationTag, error)
func (*ModificationTag) Increment ¶
func (t *ModificationTag) Increment()
func (*ModificationTag) SucceededBy ¶
func (m *ModificationTag) SucceededBy(other *ModificationTag) bool
type ReservablePorts ¶
type ReservablePorts string
func (ReservablePorts) Parse ¶
func (p ReservablePorts) Parse() (Ranges, error)
func (*ReservablePorts) UnmarshalYAML ¶
func (p *ReservablePorts) UnmarshalYAML(unmarshal func(interface{}) error) error
func (ReservablePorts) Validate ¶
func (p ReservablePorts) Validate() error
type Route ¶
type Route struct { Model ExpiresAt time.Time `json:"-"` RouteEntity }
func NewRouteWithModel ¶
func (*Route) SetDefaults ¶
type RouteEntity ¶
type RouteEntity struct { Route string `gorm:"not null; unique_index:idx_route" json:"route"` Port uint16 `gorm:"not null; unique_index:idx_route" json:"port"` IP string `gorm:"not null; unique_index:idx_route" json:"ip"` TTL *int `json:"ttl"` LogGuid string `json:"log_guid"` RouteServiceUrl string `gorm:"not null; unique_index:idx_route" json:"route_service_url,omitempty"` ModificationTag `json:"modification_tag"` }
type RouterGroup ¶
type RouterGroup struct { Model Guid string `json:"guid"` Name string `json:"name"` Type RouterGroupType `json:"type"` ReservablePorts ReservablePorts `json:"reservable_ports" yaml:"reservable_ports"` }
func (RouterGroup) Validate ¶
func (g RouterGroup) Validate() error
type RouterGroupDB ¶
func NewRouterGroupDB ¶
func NewRouterGroupDB(routerGroup RouterGroup) RouterGroupDB
func (RouterGroupDB) TableName ¶
func (RouterGroupDB) TableName() string
func (*RouterGroupDB) ToRouterGroup ¶
func (rg *RouterGroupDB) ToRouterGroup() RouterGroup
type RouterGroupType ¶
type RouterGroupType string
const ( RouterGroup_TCP RouterGroupType = "tcp" RouterGroup_HTTP RouterGroupType = "http" )
type RouterGroups ¶
type RouterGroups []RouterGroup
func (RouterGroups) Validate ¶
func (g RouterGroups) Validate() error
type RouterGroupsDB ¶
type RouterGroupsDB []RouterGroupDB
func (RouterGroupsDB) ToRouterGroups ¶
func (rgs RouterGroupsDB) ToRouterGroups() RouterGroups
type TcpMappingEntity ¶
type TcpMappingEntity struct { RouterGroupGuid string `gorm:"not null; unique_index:idx_tcp_route" json:"router_group_guid"` HostPort uint16 `gorm:"not null; unique_index:idx_tcp_route; type:int" json:"backend_port"` HostTLSPort int `gorm:"default:null; unique_index:idx_tcp_route; type:int" json:"backend_tls_port"` HostIP string `gorm:"not null; unique_index:idx_tcp_route" json:"backend_ip"` SniHostname *string `gorm:"default:null; unique_index:idx_tcp_route" json:"backend_sni_hostname,omitempty"` // We don't add uniqueness on InstanceId so that if a route is attempted to be created with the same detals but // different InstanceId, we fail uniqueness and prevent stale/duplicate routes. If this fails a route, the // TTL on the old record should expire + allow the new route to be created eventually. InstanceId string `gorm:"null; default:null;" json:"instance_id"` ExternalPort uint16 `gorm:"not null; unique_index:idx_tcp_route; type: int" json:"port"` ModificationTag `json:"modification_tag"` TTL *int `json:"ttl,omitempty"` IsolationSegment string `json:"isolation_segment"` }
IMPORTANT!! when adding a new field here that is part of the unique index for
a tcp route, make sure to update not only the logic for Matches(), but also the SqlDb.FindExistingTcpRouteMapping() function's custom WHERE filter to include the new field
type TcpRouteMapping ¶
type TcpRouteMapping struct { Model ExpiresAt time.Time `json:"-"` TcpMappingEntity }
func NewTcpRouteMapping ¶
func NewTcpRouteMapping( routerGroupGuid string, externalPort uint16, hostIP string, hostPort uint16, hostTlsPort int, instanceId string, sniHostname *string, ttl int, modTag ModificationTag, ) TcpRouteMapping
func NewTcpRouteMappingWithModel ¶
func NewTcpRouteMappingWithModel(tcpMapping TcpRouteMapping) (TcpRouteMapping, error)
func (TcpRouteMapping) Matches ¶
func (m TcpRouteMapping) Matches(other TcpRouteMapping) bool
func (*TcpRouteMapping) SetDefaults ¶
func (t *TcpRouteMapping) SetDefaults(maxTTL int)
func (TcpRouteMapping) String ¶
func (m TcpRouteMapping) String() string
func (TcpRouteMapping) TableName ¶
func (TcpRouteMapping) TableName() string
Click to show internal directories.
Click to hide internal directories.