management

package
v0.0.0-...-6da63fb Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudEnabled

func CloudEnabled(orgStore org.OrgStore, spaceStore space.SpaceStore) bool

func InviteEnabled

func InviteEnabled(orgStore org.OrgStore, spaceStore space.SpaceStore, inviteStore space.SpaceInviteStore, inviteSender space.InviteSender) bool

func OrgEnabled

func OrgEnabled(store org.OrgStore) bool

func SpaceEnabled

func SpaceEnabled(store space.SpaceStore) bool

Types

type AuthRoutesRegistrar

type AuthRoutesRegistrar func(mux *http.ServeMux, cfg OAuthConfig, services CloudHTTPServices)

type AutoMigrationConfig

type AutoMigrationConfig struct {
	DatabaseURL      string
	ForceAutoMigrate bool
}

type AutoMigrationRunner

type AutoMigrationRunner func(db *bun.DB, cfg AutoMigrationConfig, logger *zap.Logger) error

type BillingServiceFactory

type BillingServiceFactory func(cfg CloudConfig, logger *zap.Logger, orgStore org.OrgStore, spaceStore space.SpaceStore) (billing.Service, error)

type CloudConfig

type CloudConfig struct {
	InternalAPISecret                    string
	GoogleClientID                       string
	GoogleClientSecret                   string
	SESRegion                            string
	SESFromEmail                         string
	SESReplyToEmail                      string
	AppAPIURL                            string
	StripeSecretKey                      string
	StripeWebhookSecret                  string
	StripeStarterPriceID                 string
	StripeProPriceID                     string
	StripeTeamPriceID                    string
	StripeBillingPortalConfigurationID   string
	ProcessingURLTemplate                string
	ManagementJobsEnabled                bool
	ProcessingUsageBatchCleanupRetention time.Duration
	ProcessingUsageBatchCleanupInterval  time.Duration
	PlatformS3Bucket                     string
	PlatformS3Region                     string
	PlatformS3Endpoint                   string
	PlatformS3AccessKeyID                string
	PlatformS3SecretKey                  string
	PlatformS3UsePathStyle               bool
	PlatformS3Prefix                     string
	PlatformConfigVersion                int64
}

type CloudConfigLoader

type CloudConfigLoader func(args []string) (CloudConfig, error)

type CloudFactories

type CloudFactories struct {
	ConfigLoader             CloudConfigLoader
	Stores                   CloudStoresFactory
	InviteSender             InviteSenderFactory
	SignupVerification       SignupVerificationFactory
	AutoMigration            AutoMigrationRunner
	AuthRoutes               AuthRoutesRegistrar
	InternalRoutes           InternalRoutesRegistrar
	ProcessingOriginResolver ProcessingOriginResolverFactory
	TemplatePreviewRenderer  TemplatePreviewRenderClientFactory
	BillingService           BillingServiceFactory
}

type CloudHTTPServices

type CloudHTTPServices struct {
	TokenManager         *auth.TokenManager
	UserStore            shareduser.OAuthStore
	OrgStore             org.OrgStore
	SpaceStore           space.SpaceStore
	SpaceInviteStore     space.SpaceInviteStore
	HostedStorageStore   HostedStorageStore
	ProcessingUsageStore ProcessingUsageStore
	BillingService       billing.Service
	SignupVerification   sharedsignup.Runtime
	CloudConfig          CloudConfig
	GlobalImagor         ImagorSigningConfig
	InternalAPISecret    string
	Logger               *zap.Logger
}

type CloudStoresConfig

type CloudStoresConfig struct {
	InternalAPISecret string
}

type CloudWorkerRunner

type CloudWorkerRunner func(ctx context.Context, services CloudWorkerServices, cfg CloudConfig) error

type CloudWorkerServices

type CloudWorkerServices struct {
	DB                   *bun.DB
	UserStore            shareduser.OAuthStore
	OrgStore             org.OrgStore
	SpaceStore           space.SpaceStore
	SpaceInviteStore     space.SpaceInviteStore
	HostedStorageStore   HostedStorageStore
	ProcessingUsageStore ProcessingUsageStore
	BillingService       billing.Service
	SignupVerification   sharedsignup.Runtime
	CloudConfig          CloudConfig
	Logger               *zap.Logger
}

type HostedStorageObject

type HostedStorageObject struct {
	OrgID     string
	SpaceID   string
	ObjectKey string
	Status    string
	SizeBytes int64
	CreatedAt time.Time
	UpdatedAt time.Time
	ExpiresAt time.Time
}

type HostedStorageStore

type HostedStorageStore interface {
	BeginPendingUpload(ctx context.Context, orgID, spaceID, objectKey string, expiresAt time.Time) error
	FinalizePendingUpload(ctx context.Context, spaceID, objectKey string, sizeBytes int64) (bool, error)
	DeleteReadyObject(ctx context.Context, spaceID, objectKey string) (int64, error)
	MoveReadyObject(ctx context.Context, spaceID, fromKey, toKey string) error
	CopyReadyObject(ctx context.Context, sourceSpaceID, sourceKey, destOrgID, destSpaceID, destKey string) (int64, error)
	GetObject(ctx context.Context, spaceID, objectKey string) (*HostedStorageObject, error)
	GetUsageBytes(ctx context.Context, orgID, spaceID string) (int64, error)
}

type HostedStorageUsageAggregator

type HostedStorageUsageAggregator interface {
	ListUsageBytesBySpace(ctx context.Context, orgID string, spaceIDs []string) (map[string]int64, error)
}

type ImagorSigningConfig

type ImagorSigningConfig struct {
	Secret         string
	SignerType     string
	SignerTruncate int
}

type InternalRoutesRegistrar

type InternalRoutesRegistrar func(mux *http.ServeMux, services CloudHTTPServices)

type InviteSenderConfig

type InviteSenderConfig = sharedinvite.Config

type InviteSenderFactory

type InviteSenderFactory func(cfg InviteSenderConfig) (space.InviteSender, error)

type OAuthConfig

type OAuthConfig struct {
	GoogleClientID     string
	GoogleClientSecret string
	AppURL             string
	AppAPIURL          string
}

type ProcessingOriginResolverFactory

type ProcessingOriginResolverFactory func(cfg CloudConfig, spaceStore space.SpaceStore) space.ProcessingOriginResolver

type ProcessingUsageStore

type ProcessingUsageStore interface {
	ApplyUsageBatch(ctx context.Context, batch processing.UsageBatch) (*processing.UsageBatchApplyResult, error)
	CleanupUsageBatches(ctx context.Context, olderThan time.Time) error
	GetCurrentUsageSummary(ctx context.Context, orgID string) (*ProcessingUsageSummary, error)
}

type ProcessingUsageSummary

type ProcessingUsageSummary struct {
	PeriodStart           time.Time
	PeriodEnd             time.Time
	TotalProcessedCount   int64
	ProcessedCountBySpace map[string]int64
}

type SignupVerificationConfig

type SignupVerificationConfig = sharedsignup.Config

type SignupVerificationServices

type SignupVerificationServices struct {
	DB               *bun.DB
	UserStore        shareduser.PasswordSignupStore
	OrgStore         org.OrgStore
	SpaceStore       space.SpaceStore
	SpaceInviteStore space.SpaceInviteStore
	Logger           *zap.Logger
}

type TemplatePreviewRenderClientFactory

type TemplatePreviewRenderClientFactory func(cfg CloudConfig) processing.TemplatePreviewRenderClient

Jump to

Keyboard shortcuts

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