enqueuemanager

package
v0.0.0-...-732ec5d Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const TicketExpiration = 10 * time.Minute

Variables

This section is empty.

Functions

func DeductConcealedTicketPoints

func DeductConcealedTicketPoints(ctxCtx context.Context, pointsManager *pointsmanager.Manager, requestedBy auth.User, mediaID string) error

Types

type EnqueueTicket

type EnqueueTicket interface {
	media.EnqueueRequest
	ID() string
	CreatedAt() time.Time
	RequestedBy() auth.User
	PaymentAddress() string
	SerializeForAPI() *proto.EnqueueMediaTicket
	RequestPricing() pricer.EnqueuePricing
	SetPaid() error
	SetFailedDueToInsufficientPoints()
	Status() proto.EnqueueMediaTicketStatus
	StatusChanged() event.NoArgEvent
	ForceEnqueuing(proto.ForcedTicketEnqueueType)
	EnqueuingForced() (bool, proto.ForcedTicketEnqueueType)
}

EnqueueTicket is a request to enqueue media that is pending payment

type Manager

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

Manager manages requests for enqueuing that are pending payment

func New

func New(
	workerContext context.Context,
	log *log.Logger,
	statsClient *statsd.Client,
	mediaQueue *mediaqueue.MediaQueue,
	pricer *pricer.Pricer,
	paymentAccountPool *payment.PaymentAccountPool,
	rewardsHandler *rewards.Handler,
	pointsManager *pointsmanager.Manager,
	moderationStore moderation.Store,
	modLogWebhook api.WebhookClient) (*Manager, error)

New returns a new Manager

func (*Manager) GetTicket

func (e *Manager) GetTicket(id string) EnqueueTicket

func (*Manager) NewEntriesAlwaysUnskippableForFree

func (e *Manager) NewEntriesAlwaysUnskippableForFree() bool

func (*Manager) RegisterRequest

func (e *Manager) RegisterRequest(ctx context.Context, request media.EnqueueRequest, forceAnonymous bool) (EnqueueTicket, error)

func (*Manager) SetNewQueueEntriesAlwaysUnskippableForFree

func (e *Manager) SetNewQueueEntriesAlwaysUnskippableForFree(enabled bool)

func (*Manager) UserHasEnoughPointsToEnqueueConcealedEntry

func (e *Manager) UserHasEnoughPointsToEnqueueConcealedEntry(ctxCtx context.Context, user auth.User) (bool, error)

Jump to

Keyboard shortcuts

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