Documentation
¶
Index ¶
- Constants
- Variables
- func LimitsForTier(tier webx.PlanTier) webx.PlanLimits
- func SetupRoutes(r chi.Router, opts ...Option)
- type Option
- func WithBillingProvider(b webx.BillingProvider) Option
- func WithDevMode(dev bool) Option
- func WithMembershipStore(s webx.MembershipStore) Option
- func WithPro(pro bool) Option
- func WithProviderStore(s webx.ProviderStore) Option
- func WithRegionStore(s webx.RegionStore) Option
- func WithRoleStore(s webx.RoleStore) Option
- func WithSendMagicLink(fn login.SendMagicLinkFunc) Option
- func WithSessionStore(s webx.SessionStore) Option
- func WithSubscriptionStore(s webx.SubscriptionStore) Option
- func WithTokenStore(s webx.TokenStore) Option
- func WithUserSessionStore(s session.SessionStore) Option
- func WithWorkspaceStore(s webx.WorkspaceStore) Option
- type SeedResult
Constants ¶
const ( PlanFree webx.PlanTier = "free" PlanPro webx.PlanTier = "pro" PlanEnterprise webx.PlanTier = "enterprise" )
App-specific plan tiers.
const ( ProviderManaged webx.ProviderType = "managed" ProviderSelfHosted webx.ProviderType = "selfhosted" )
App-specific provider types.
const DefaultRegionID = "reg_aws_use1"
DefaultRegionID is the region used when none is specified.
Variables ¶
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 ¶
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 ¶
WithDevMode sets the dev-mode flag (defaults to true).
func WithMembershipStore ¶
func WithMembershipStore(s webx.MembershipStore) Option
WithMembershipStore sets the membership store.
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 WithSendMagicLink ¶
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 |