Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AllowedMimeTypesKey is the key to access the allowed mime types config AllowedMimeTypesKey = "allowed-mime-types" // ForbiddenHostnamesKey is the key to access the forbidden hostnames config ForbiddenHostnamesKey = "forbidden-hostnames" // RefreshDelayKey is the key to access the refresh delay config RefreshDelayKey = "refresh-delay" // BlackListConfigKey is the key to access the blacklist configuration BlackListConfigKey = "blacklist-config" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlackListConfig ¶
BlackListConfig is the config used for hostname blacklisting
type Client ¶
type Client interface {
GetAllowedMimeTypes() ([]MimeType, error)
GetForbiddenHostnames() ([]ForbiddenHostname, error)
GetRefreshDelay() (RefreshDelay, error)
GetBlackListConfig() (BlackListConfig, error)
Set(key string, value interface{}) error
}
Client is a nice client interface for the ConfigAPI
func NewConfigClient ¶
func NewConfigClient(configAPIURL string, subscriber event.Subscriber, keys []string) (Client, error)
NewConfigClient create a new client for the ConfigAPI.
type ForbiddenHostname ¶
type ForbiddenHostname struct {
Hostname string `json:"hostname"`
}
ForbiddenHostname is the hostnames who's crawling is forbidden
type MimeType ¶
type MimeType struct {
// The content-type
ContentType string `json:"content-type"`
// The list of associated extensions
Extensions []string `json:"extensions"`
}
MimeType is the mime type as represented in the config
type RefreshDelay ¶
RefreshDelay is the refresh delay for re-crawling
Click to show internal directories.
Click to hide internal directories.