config

package
Version: v0.2.0 Latest Latest
Warning

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

Documentation

Index

Constants

This section is empty.

Variables

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

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

	// 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