translations

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepositoryRequired = errors.New("admintranslations: repository is required")

ErrRepositoryRequired indicates the service was constructed without a repository.

Functions

This section is empty.

Types

type Option

type Option func(*Service)

Option mutates the service configuration.

func WithAuditRecorder

func WithAuditRecorder(recorder jobs.AuditRecorder) Option

WithAuditRecorder overrides the audit recorder dependency.

func WithClock

func WithClock(clock func() time.Time) Option

WithClock overrides the clock used for audit timestamps.

type Service

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

Service persists translation settings and emits audit records.

func NewService

func NewService(repo translationconfig.Repository, recorder jobs.AuditRecorder, opts ...Option) *Service

NewService constructs a translations admin service.

func (*Service) ApplySettings

func (s *Service) ApplySettings(ctx context.Context, settings translationconfig.Settings) error

ApplySettings stores translation settings and records an audit entry.

func (*Service) GetSettings

func (s *Service) GetSettings(ctx context.Context) (translationconfig.Settings, error)

GetSettings returns the stored translation settings.

func (*Service) Reset

func (s *Service) Reset(ctx context.Context) error

Reset clears translation settings from the repository.

Jump to

Keyboard shortcuts

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