Documentation
¶
Index ¶
- type ImagorConfig
- type ImagorMode
- type Provider
- func (p *Provider) GenerateURL(imagePath string, params imagorpath.Params) (string, error)
- func (p *Provider) GetConfig() *ImagorConfig
- func (p *Provider) GetHandler() http.Handler
- func (p *Provider) InitializeWithConfig(cfg *config.Config) error
- func (p *Provider) IsRestartRequired() bool
- func (p *Provider) ReloadFromRegistry() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImagorConfig ¶
type ImagorConfig struct { Mode ImagorMode // embedded or external BaseURL string // External URL or "/imagor" for embedded Secret string // Secret key for URL signing Unsafe bool // Enable unsafe URLs for development SignerType string // Hash algorithm: "sha1", "sha256", "sha512" (for external mode) SignerTruncate int // Signature truncation length (for external mode) }
ImagorConfig holds imagor configuration
type ImagorMode ¶
type ImagorMode string
ImagorMode represents the imagor operation mode
const ( ImagorModeEmbedded ImagorMode = "embedded" ImagorModeExternal ImagorMode = "external" )
func (ImagorMode) String ¶
func (m ImagorMode) String() string
String returns the string representation of the mode
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider handles imagor configuration with state management
func New ¶
func New(logger *zap.Logger, registryStore registrystore.Store, cfg *config.Config, storageProvider *storageprovider.Provider) *Provider
New creates a new imagor provider
func (*Provider) GenerateURL ¶
GenerateURL generates an imagor URL for the given image path and parameters
func (*Provider) GetConfig ¶
func (p *Provider) GetConfig() *ImagorConfig
GetConfig returns the current imagor configuration
func (*Provider) GetHandler ¶
GetHandler returns the HTTP handler for embedded mode (nil for external/disabled)
func (*Provider) InitializeWithConfig ¶
InitializeWithConfig initializes imagor with the given configuration
func (*Provider) IsRestartRequired ¶
IsRestartRequired checks if a restart is required due to imagor configuration changes
func (*Provider) ReloadFromRegistry ¶
ReloadFromRegistry forces a reload of imagor configuration from registry