Documentation
¶
Index ¶
Constants ¶
View Source
const (
// ConfigEnvPrefix is the prefix applied to environment variables for configuring the content extractor.
ConfigEnvPrefix = "EXTRACTOR_"
)
Variables ¶
View Source
var ErrInvalidFormat = errors.New("invalid format")
ErrInvalidFormat indicates that format specified or requested is invalid.
View Source
var LoadConfig = sync.OnceValues(func() (*Config, error) { if err := config.Load(ConfigEnvPrefix, &cfg); err != nil { return nil, fmt.Errorf("load config: %w", err) } if err := validation.Validate.Struct(cfg); err != nil { return nil, fmt.Errorf("validate config: %w", err) } return &cfg, nil })
LoadConfig loads the content extractor configuration and ensures this is only done one time, no matter how many times it is called.
Functions ¶
func GenerateExtractorURL ¶
GenerateExtractorURL takes the given URL and generates a new URL to proxy the request through the content extractor service.
Types ¶
type Config ¶
type Config struct {
Key string `koanf:"key" validate:"required,base64rawurl"`
Salt string `koanf:"salt" validate:"required,base64rawurl"`
BaseURL string `koanf:"baseurl" validate:"required,url"`
TokenTTL string `koanf:"token_ttl_seconds" validate:"omitempty"`
}
Config contains the content extractor configuration options.
Click to show internal directories.
Click to hide internal directories.