submissioncap

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package submissioncap tracks the per-user override on how many pending (unapproved) proposed changes a submitter may have open at once - checked at volume edit session finalize time (durable-volume-editing task 5.1, sweetrpg/platform#38).

Index

Constants

View Source
const CollectionName = "submission_cap_overrides"
View Source
const DefaultCapEnvVar = "SUBMISSION_CAP_DEFAULT"

DefaultCapEnvVar names the env var overriding defaultCap (the hardcoded fallback below).

Variables

This section is empty.

Functions

func CapFor

func CapFor(ctx context.Context, userID string) (int, error)

CapFor returns userID's effective cap: their override if one is set, otherwise Default().

func ClearOverride

func ClearOverride(ctx context.Context, userID string) error

ClearOverride removes userID's cap override, falling them back to Default().

func Default

func Default() int

Default returns the platform-wide default cap: SUBMISSION_CAP_DEFAULT if set and a valid non-negative integer, otherwise defaultCap.

func GetOverride

func GetOverride(ctx context.Context, userID string) (*int, error)

GetOverride returns userID's cap override, or nil if none is set.

func SetOverride

func SetOverride(ctx context.Context, userID string, capValue int) error

SetOverride sets userID's cap override, replacing any existing one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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