project

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	GetTranslation(ctx context.Context, projectID int, languageCode, format string) (trans *Translation, err error)
	PurgeTranslation(ctx context.Context, projectID int, languageCode string) (err error)
	PurgeProject(ctx context.Context, projectID int) (err error)
	RegisterChecks(h gosundheit.Health) (err error)
}

type ServiceImpl

type ServiceImpl struct {
	Logger            *logrus.Entry
	Client            poedit.Client
	Cache             cache.Cache
	RenewalThreshold  time.Duration
	PreFetchSemaphore *semaphore.Weighted
}

func NewService

func NewService(cli poedit.Client, cache cache.Cache, renewalThreshold time.Duration, entry *logrus.Entry) *ServiceImpl

func (*ServiceImpl) GetTranslation

func (s *ServiceImpl) GetTranslation(ctx context.Context, projectID int, languageCode, format string) (*Translation, error)

func (*ServiceImpl) PurgeProject

func (s *ServiceImpl) PurgeProject(ctx context.Context, projectID int) error

func (*ServiceImpl) PurgeTranslation

func (s *ServiceImpl) PurgeTranslation(ctx context.Context, projectID int, languageCode string) error

func (*ServiceImpl) RegisterChecks added in v0.4.0

func (s *ServiceImpl) RegisterChecks(h gosundheit.Health) error

type Translation added in v0.1.1

type Translation struct {
	TTL      time.Duration
	Checksum string
	Data     []byte
}

Jump to

Keyboard shortcuts

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