Version: v0.2.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 3 Imported by: 0




This section is empty.


View Source
var (
	// Default caching time is 1 day (24 hours) if redis client is set.
	DefaultCacheTime = 24 * time.Hour

	// Default value for cleaning image and video url.
	DefaultCleanImageURL = true
	DefaultCleanVideoURL = true

	// Default verbose boolean.
	DefaultVerbose = true

	// Default config.
	DefaultConfig = Config{
		RedisClient:   nil,
		RedisConfig:   nil,
		CacheTime:     0,
		CleanImageURL: DefaultCleanImageURL,
		CleanVideoURL: DefaultCleanVideoURL,
		Verbose:       DefaultVerbose,


This section is empty.


type Config

type Config struct {
	// Redis client and configuration for caching parsing data.
	// RedisClient will be assigned automatically if RedisConfig is set.
	// RedisClient can also be assigned directly without RedisConfig.
	// For more information, read ``.
	RedisClient *redis.Client
	RedisConfig *redis.Options

	// Expired time limit of the cached data (in seconds).
	CacheTime time.Duration

	// Does malscraper need to automatically clean any image url using
	// pkg/malscraper/utils.ImageURLCleaner() function.
	CleanImageURL bool

	// Does malscraper need to automatically clean any video url using
	// pkg/malscraper/utils.VideoURLCLeaner() function.
	CleanVideoURL bool

	// Not used...yet.
	Logging     bool
	LoggingPath string

	// Using or expressed in more detailed information to console.
	Verbose bool

Config is config model for go-malscraper.

func (*Config) Init

func (c *Config) Init()

Init to initiate config value.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL