Documentation ¶
Index ¶
- Variables
- func GenerateHostSearch(hosts []string) (string, []string)
- type Manager
- func (m *Manager) Compile()
- func (m *Manager) DeleteRedirect(source string) error
- func (m *Manager) DeleteRoute(source string) error
- func (m *Manager) GetAllRedirects(hosts []string) ([]target.RedirectWithActive, error)
- func (m *Manager) GetAllRoutes(hosts []string) ([]target.RouteWithActive, error)
- func (m *Manager) InsertRedirect(redirect target.RedirectWithActive) error
- func (m *Manager) InsertRoute(route target.RouteWithActive) error
- func (m *Manager) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- type Router
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = logger.Logger.WithPrefix("Violet Manager")
Functions ¶
func GenerateHostSearch ¶ added in v0.0.12
GenerateHostSearch this should help improve performance TODO(Melon) discover how to implement this correctly
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a database and mutex wrap around router allowing it to be dynamically regenerated after updating the database of routes.
func NewManager ¶
func NewManager(db *database.Queries, proxy *proxy.HybridTransport) *Manager
NewManager create a new manager, initialises the routes and redirects tables in the database and runs a first time compile.
func (*Manager) DeleteRedirect ¶
func (*Manager) DeleteRoute ¶
func (*Manager) GetAllRedirects ¶
func (m *Manager) GetAllRedirects(hosts []string) ([]target.RedirectWithActive, error)
func (*Manager) GetAllRoutes ¶
func (m *Manager) GetAllRoutes(hosts []string) ([]target.RouteWithActive, error)
func (*Manager) InsertRedirect ¶
func (m *Manager) InsertRedirect(redirect target.RedirectWithActive) error
func (*Manager) InsertRoute ¶
func (m *Manager) InsertRoute(route target.RouteWithActive) error
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func New ¶
func New(proxy *proxy.HybridTransport) *Router
func (*Router) AddRedirect ¶
Click to show internal directories.
Click to hide internal directories.