config

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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 boolean 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,
	}
)

Functions

This section is empty.

Types

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 `github.com/go-redis/redis/v7`.
	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