imagorprovider

package
v0.0.0-...-68a02b1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

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

func (p *Provider) GenerateURL(imagePath string, params imagorpath.Params) (string, error)

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

func (p *Provider) GetHandler() http.Handler

GetHandler returns the HTTP handler for embedded mode (nil for external/disabled)

func (*Provider) InitializeWithConfig

func (p *Provider) InitializeWithConfig(cfg *config.Config) error

InitializeWithConfig initializes imagor with the given configuration

func (*Provider) IsRestartRequired

func (p *Provider) IsRestartRequired() bool

IsRestartRequired checks if a restart is required due to imagor configuration changes

func (*Provider) ReloadFromRegistry

func (p *Provider) ReloadFromRegistry() error

ReloadFromRegistry forces a reload of imagor configuration from registry

Jump to

Keyboard shortcuts

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