Documentation ¶
Index ¶
- type IndexedRedirects
- type Logger
- type RedirectManager
- func (rm *RedirectManager) DeleteOldRedirect(id string) error
- func (rm *RedirectManager) FetchRedirectsOverChannel(redirectsCh chan<- []api.Redirect, errCh chan<- error)
- func (rm *RedirectManager) HandleNewOrUpdatedRedirects(fetchedRedirects *[]api.Redirect)
- func (rm *RedirectManager) HandleOldRedirectsDeletion(fetchedRedirects *[]api.Redirect)
- func (rm *RedirectManager) PopulateMapsWithDataFromDB()
- func (rm *RedirectManager) SyncRedirects(redirectsCh <-chan []api.Redirect, errCh <-chan error)
- func (rm *RedirectManager) UpsertRedirect(r api.Redirect) error
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexedRedirects ¶ added in v0.1.8
type IndexedRedirects struct { LengthMap map[int]map[string][]*Rule DomainRules []*Rule // contains filtered or unexported fields }
func NewIndexedRedirects ¶ added in v0.1.8
func NewIndexedRedirects() *IndexedRedirects
func (*IndexedRedirects) Delete ¶ added in v0.1.8
func (idx *IndexedRedirects) Delete(pattern, fromDomain string)
func (*IndexedRedirects) IndexRule ¶ added in v0.1.8
func (idx *IndexedRedirects) IndexRule(pattern, fromDomain, target string)
func (*IndexedRedirects) Match ¶ added in v0.1.8
func (idx *IndexedRedirects) Match(url string) (string, bool)
Match matches the incoming requests against the redirect rules
func (*IndexedRedirects) Update ¶ added in v0.1.8
func (idx *IndexedRedirects) Update(pattern, fromDomain, target string)
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) LoadLoggedRequests ¶
LoadLoggedRequests loads the requestsMap with data from the .log file
func (*Logger) LogRequest ¶
LogRequest logs any incoming requests with dates to the .log file
func (*Logger) SendLogsWeekly ¶
func (l *Logger) SendLogsWeekly()
SendLogsWeekly starts a cron job to send request logs weekly
type RedirectManager ¶
type RedirectManager struct { IndexedRedirects *IndexedRedirects // contains filtered or unexported fields }
func NewRedirectManager ¶
func NewRedirectManager(db *sql.DB, gqlClient *api.GraphQLClient) *RedirectManager
func (*RedirectManager) DeleteOldRedirect ¶
func (rm *RedirectManager) DeleteOldRedirect(id string) error
func (*RedirectManager) FetchRedirectsOverChannel ¶
func (rm *RedirectManager) FetchRedirectsOverChannel(redirectsCh chan<- []api.Redirect, errCh chan<- error)
func (*RedirectManager) HandleNewOrUpdatedRedirects ¶
func (rm *RedirectManager) HandleNewOrUpdatedRedirects(fetchedRedirects *[]api.Redirect)
func (*RedirectManager) HandleOldRedirectsDeletion ¶
func (rm *RedirectManager) HandleOldRedirectsDeletion(fetchedRedirects *[]api.Redirect)
func (*RedirectManager) PopulateMapsWithDataFromDB ¶ added in v0.1.9
func (rm *RedirectManager) PopulateMapsWithDataFromDB()
func (*RedirectManager) SyncRedirects ¶
func (rm *RedirectManager) SyncRedirects(redirectsCh <-chan []api.Redirect, errCh <-chan error)
SyncRedirects synchronizes the fetched redirects with the redirects map and the sqlite records
func (*RedirectManager) UpsertRedirect ¶
func (rm *RedirectManager) UpsertRedirect(r api.Redirect) error
Click to show internal directories.
Click to hide internal directories.