mediacmd

package
v0.60.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupAssetsCommand

type CleanupAssetsCommand struct {
	Bindings media.BindingSet `json:"bindings"`
	DryRun   bool             `json:"dry_run,omitempty"`
}

CleanupAssetsCommand invalidates cached media bindings so downstream resolvers refresh state.

func (CleanupAssetsCommand) Type

Type implements command.Message.

func (CleanupAssetsCommand) Validate

func (m CleanupAssetsCommand) Validate() error

Validate ensures the command payload contains the references to invalidate.

type CleanupAssetsHandler

type CleanupAssetsHandler struct {
	// contains filtered or unexported fields
}

CleanupAssetsHandler invalidates media bindings.

func NewCleanupAssetsHandler

func NewCleanupAssetsHandler(service media.Service, logger interfaces.Logger, gates FeatureGates, opts ...CleanupAssetsOption) *CleanupAssetsHandler

NewCleanupAssetsHandler constructs a handler wired to the provided media service.

func (*CleanupAssetsHandler) Execute

Execute satisfies command.Commander[CleanupAssetsCommand].

type CleanupAssetsOption added in v0.3.0

type CleanupAssetsOption func(*CleanupAssetsHandler)

CleanupAssetsOption customises the cleanup handler.

func CleanupAssetsWithTimeout added in v0.3.0

func CleanupAssetsWithTimeout(timeout time.Duration) CleanupAssetsOption

CleanupAssetsWithTimeout overrides the default execution timeout.

type FeatureGates

type FeatureGates struct {
	// MediaLibraryEnabled returns true when the media library feature is active.
	MediaLibraryEnabled func() bool
}

FeatureGates exposes the runtime toggles required by media command handlers. Calling code can inject closures that read from cms.Config to avoid concrete dependencies while still honouring feature flags.

type ImportAssetsCommand

type ImportAssetsCommand struct {
	Bindings            media.BindingSet `json:"bindings"`
	IncludeSignedURLs   bool             `json:"include_signed_urls,omitempty"`
	SignedURLTTLSeconds *int             `json:"signed_url_ttl_seconds,omitempty"`
	CacheTTLSeconds     *int             `json:"cache_ttl_seconds,omitempty"`
}

ImportAssetsCommand resolves media bindings to warm caches or prefetch assets.

func (ImportAssetsCommand) Type

func (ImportAssetsCommand) Type() string

Type implements command.Message.

func (ImportAssetsCommand) Validate

func (m ImportAssetsCommand) Validate() error

Validate ensures the command payload contains at least one binding with a valid reference.

type ImportAssetsHandler

type ImportAssetsHandler struct {
	// contains filtered or unexported fields
}

ImportAssetsHandler resolves media bindings.

func NewImportAssetsHandler

func NewImportAssetsHandler(service media.Service, logger interfaces.Logger, gates FeatureGates, opts ...ImportAssetsOption) *ImportAssetsHandler

NewImportAssetsHandler constructs a handler wired to the provided media service.

func (*ImportAssetsHandler) Execute

Execute satisfies command.Commander[ImportAssetsCommand].

type ImportAssetsOption added in v0.3.0

type ImportAssetsOption func(*ImportAssetsHandler)

ImportAssetsOption customises the import handler.

func ImportAssetsWithTimeout added in v0.3.0

func ImportAssetsWithTimeout(timeout time.Duration) ImportAssetsOption

ImportAssetsWithTimeout overrides the default execution timeout.

Jump to

Keyboard shortcuts

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