Version: v0.17.0 Latest Latest

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 3 Imported by: 0




This section is empty.


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

	// DefaultCleanImageURL for cleaning image url.
	DefaultCleanImageURL = true

	// DefaultCleanVideoURL for cleaning video url.
	DefaultCleanVideoURL = true

	// DefaultVerbose for default verbose value.
	DefaultVerbose = mallogger.LevelZero

	// DefaultConfig for default malscraper config with its default field value.
	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

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

Config is config model for go-malscraper.

func (*Config) Init

func (c *Config) Init()

Init to initiate config value.

Jump to

Keyboard shortcuts

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