Documentation ¶
Index ¶
- type AdminServices
- type CrawledUrl
- type SearchIndex
- type SearchIndexServices
- type SearchSettings
- type SearchSettingsServices
- type UrlServices
- func (u *UrlServices) GetNextCrawlUrls(limit uint) ([]CrawledUrl, error)
- func (u *UrlServices) GetNotIndexed() ([]CrawledUrl, error)
- func (u *UrlServices) Save(input *CrawledUrl) error
- func (u *UrlServices) SetIndexedTrue(urls []CrawledUrl) error
- func (u *UrlServices) UpdateUrl(input CrawledUrl) error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminServices ¶
func NewAdminServices ¶
func NewAdminServices(u User, aStore *gorm.DB) AdminServices
func (*AdminServices) CreateAdmin ¶
func (as *AdminServices) CreateAdmin(u User) error
func (*AdminServices) LoginAsAdmin ¶
func (as *AdminServices) LoginAsAdmin(email, password string) (User, error)
type CrawledUrl ¶
type CrawledUrl struct { ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"` Url string `gorm:"unique;not null" json:"url"` Success bool `gorm:"default:null" json:"success"` CrawlDuration time.Duration `json:"crawlDuration"` ResponseCode int `gorm:"type:smallint" json:"responseCode"` PageTitle string `json:"pageTitle"` PageDescription string `json:"pageDescription"` Headings string `json:"headings"` LastTested *time.Time `json:"lastTested"` // Use pointer so this value can be nil Indexed bool `json:"indexed" gorm:"default:false"` CreatedAt time.Time `gorm:"datetime:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` UpdatedAt time.Time `gorm:"datetime:timestamp" json:"updatedAt"` DeletedAt gorm.DeletedAt `gorm:"index"` }
type SearchIndex ¶
type SearchIndex struct { ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"` Value string Urls []CrawledUrl `gorm:"many2many:token_urls;"` CreatedAt time.Time `gorm:"datetime:timestamp;default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `gorm:"datetime:timestamp"` DeletedAt gorm.DeletedAt `gorm:"index"` }
func (*SearchIndex) TableName ¶
func (si *SearchIndex) TableName() string
Gorm override table name (↓ SEE NOTE BELOW ↓)
type SearchIndexServices ¶
type SearchIndexServices struct { Index SearchIndex IndexStore *gorm.DB }
func NewSearchIndexServices ¶
func NewSearchIndexServices( i SearchIndex, iStore *gorm.DB, ) SearchIndexServices
func (*SearchIndexServices) Save ¶
func (sis *SearchIndexServices) Save( i map[string][]string, crUrls []CrawledUrl, ) error
func (*SearchIndexServices) SearchFullText ¶
func (sis *SearchIndexServices) SearchFullText(v string) ([]CrawledUrl, error)
type SearchSettings ¶
type SearchSettingsServices ¶
type SearchSettingsServices struct { SearchSettings SearchSettings SearchSettingsStore *gorm.DB }
func NewSearchSettingsServices ¶
func NewSearchSettingsServices( ss SearchSettings, sstore *gorm.DB, ) SearchSettingsServices
func (*SearchSettingsServices) Get ¶
func (sss *SearchSettingsServices) Get() (SearchSettings, error)
type UrlServices ¶
type UrlServices struct { Url CrawledUrl UrlStore *gorm.DB }
func NewUrlServices ¶
func NewUrlServices(u CrawledUrl, uStore *gorm.DB) UrlServices
func (*UrlServices) GetNextCrawlUrls ¶
func (u *UrlServices) GetNextCrawlUrls(limit uint) ([]CrawledUrl, error)
func (*UrlServices) GetNotIndexed ¶
func (u *UrlServices) GetNotIndexed() ([]CrawledUrl, error)
func (*UrlServices) Save ¶
func (u *UrlServices) Save(input *CrawledUrl) error
func (*UrlServices) SetIndexedTrue ¶
func (u *UrlServices) SetIndexedTrue(urls []CrawledUrl) error
func (*UrlServices) UpdateUrl ¶
func (u *UrlServices) UpdateUrl(input CrawledUrl) error
type User ¶
type User struct { ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"` Email string `gorm:"unique" json:"email"` Password string `json:"-"` IsAdmin bool `gorm:"default:false" json:"isAdmin"` CreatedAt time.Time `gorm:"datetime:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` UpdatedAt time.Time `gorm:"datetime:timestamp" json:"updatedAt"` }
Click to show internal directories.
Click to hide internal directories.