internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlanFree       webx.PlanTier = "free"
	PlanPro        webx.PlanTier = "pro"
	PlanEnterprise webx.PlanTier = "enterprise"
)

App-specific plan tiers.

View Source
const (
	ProviderManaged    webx.ProviderType = "managed"
	ProviderSelfHosted webx.ProviderType = "selfhosted"
)

App-specific provider types.

View Source
const DefaultRegionID = "reg_aws_use1"

DefaultRegionID is the region used when none is specified.

Variables

View Source
var PlanLimits = map[webx.PlanTier]webx.PlanLimits{
	PlanFree: {
		MaxWorkspaces:   1,
		MaxMembers:      5,
		MaxStorageBytes: 1 << 30,
		MaxTokens:       100,
		AllowSelfHost:   false,
		AllowedRegions:  []string{"reg_aws_use1"},
	},
	PlanPro: {
		MaxWorkspaces:   5,
		MaxMembers:      25,
		MaxStorageBytes: 10 << 30,
		MaxTokens:       1000,
		AllowSelfHost:   false,
		AllowedRegions:  []string{"reg_aws_use1", "reg_aws_euw1", "reg_gcp_usc1"},
	},
	PlanEnterprise: {
		MaxWorkspaces:   0,
		MaxMembers:      0,
		MaxStorageBytes: 0,
		MaxTokens:       0,
		AllowSelfHost:   true,
		AllowedRegions:  nil,
	},
}

PlanLimits maps each tier to its resource limits.

Functions

func LimitsForTier

func LimitsForTier(tier webx.PlanTier) webx.PlanLimits

LimitsForTier returns the limits for the given tier. Falls back to Free limits for unknown tiers.

func SetupRoutes

func SetupRoutes(r chi.Router, opts ...Option)

Types

type Option

type Option func(*config)

Option configures SetupRoutes.

func WithBillingProvider

func WithBillingProvider(b webx.BillingProvider) Option

WithBillingProvider sets the billing provider.

func WithDevMode

func WithDevMode(dev bool) Option

WithDevMode sets the dev-mode flag (defaults to true).

func WithMembershipStore

func WithMembershipStore(s webx.MembershipStore) Option

WithMembershipStore sets the membership store.

func WithPro

func WithPro(pro bool) Option

WithPro enables Datastar Pro mode.

func WithProviderStore

func WithProviderStore(s webx.ProviderStore) Option

WithProviderStore sets the provider store.

func WithRegionStore

func WithRegionStore(s webx.RegionStore) Option

WithRegionStore sets the region store.

func WithRoleStore

func WithRoleStore(s webx.RoleStore) Option

WithRoleStore sets the role store.

func WithSendMagicLink(fn login.SendMagicLinkFunc) Option

WithSendMagicLink sets the function used to deliver magic links.

func WithSessionStore

func WithSessionStore(s webx.SessionStore) Option

WithSessionStore sets the framework-level session store (CSRF tokens, etc.).

func WithSubscriptionStore

func WithSubscriptionStore(s webx.SubscriptionStore) Option

WithSubscriptionStore sets the subscription store.

func WithTokenStore

func WithTokenStore(s webx.TokenStore) Option

WithTokenStore sets the magic link token store.

func WithUserSessionStore

func WithUserSessionStore(s session.SessionStore) Option

WithUserSessionStore sets the user session store.

func WithWorkspaceStore

func WithWorkspaceStore(s webx.WorkspaceStore) Option

WithWorkspaceStore sets the workspace store.

type SeedResult

type SeedResult struct {
	SessionID string // cookie value for auto-login
	UserID    string
	Email     string
}

SeedResult holds the output of a dev seed so the caller can set up auto-login or log the session details.

func SeedDevData

func SeedDevData(
	workspaces webx.WorkspaceStore,
	memberships webx.MembershipStore,
	roles webx.RoleStore,
	sessions session.SessionStore,
	providers webx.ProviderStore,
	regions webx.RegionStore,
) (*SeedResult, error)

SeedDevData populates stores with test data for local development.

Directories

Path Synopsis
login
templ: version: v0.3.977
templ: version: v0.3.977
auth/templates
templ: version: v0.3.977
templ: version: v0.3.977
dashboard/templates
templ: version: v0.3.977
templ: version: v0.3.977

Jump to

Keyboard shortcuts

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