store

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package store holds the panel's PostgreSQL queries.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDomainTaken = errors.New("domain already in use")
	ErrLimit       = errors.New("plan limit reached")
)

Website errors.

View Source
var ErrCodeTaken = errors.New("coupon code taken")

ErrCodeTaken means another coupon has the code.

View Source
var ErrConflict = errors.New("already exists")

ErrConflict is returned when a unique value is already taken (e.g. an allocation port).

View Source
var ErrCouponUsedUp = errors.New("coupon used up")

ErrCouponUsedUp means the coupon reached its use limit meanwhile.

View Source
var ErrEmailTaken = errors.New("email already in use")

ErrEmailTaken is returned when another user already has the email address.

View Source
var ErrInUse = errors.New("in use")

ErrInUse is returned when a row cannot be removed because something still uses it.

View Source
var ErrInsufficientCredit = errors.New("insufficient credit")

ErrInsufficientCredit means the balance would go below zero.

View Source
var ErrInvalidEmail = errors.New("invalid email address")

ErrInvalidEmail is returned for malformed email addresses.

View Source
var ErrInvalidToken = errors.New("invalid or expired join token")

ErrInvalidToken is returned for unknown, used or expired join tokens.

View Source
var ErrKVFull = errors.New("extension storage is full")

ErrKVFull means an extension reached its key limit.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when a row does not exist.

View Source
var ErrPasskeyExists = errors.New("passkey already registered")

ErrPasskeyExists means the credential is registered already.

View Source
var ErrSameAsOther = errors.New("this egg file is already imported as another blueprint")

ErrSameAsOther means an update's file is already stored as another blueprint.

View Source
var ErrTokenInvalid = errors.New("invalid or expired link")

ErrTokenInvalid means the link is unknown, used or expired.

Functions

func NormalizeEmail

func NormalizeEmail(email string) (string, error)

NormalizeEmail trims and validates an address. Case is preserved for display; uniqueness and lookup are case-insensitive.

func NormalizeLocale

func NormalizeLocale(l string) string

NormalizeLocale maps a language tag to a supported email locale.

Types

type Allocation

type Allocation struct {
	ID        string  `json:"id"`
	NodeID    string  `json:"node_id"`
	IP        string  `json:"ip"`
	Port      int     `json:"port"`
	ServiceID *string `json:"service_id"`
}

Allocation is an IP:port on a node.

type Blueprint

type Blueprint struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Author      string        `json:"author"`
	Description string        `json:"description"`
	Format      egg.Format    `json:"format"`
	UpdateURL   string        `json:"update_url"`
	SourceURL   string        `json:"source_url"`
	Warnings    []egg.Warning `json:"warnings"`
	CreatedAt   time.Time     `json:"created_at"`
	UpdatedAt   time.Time     `json:"updated_at"`
	// Egg is the normalised egg; only filled by GetBlueprint.
	Egg *egg.Egg `json:"egg,omitempty"`
}

Blueprint is an imported egg.

type Coupon

type Coupon struct {
	ID         string     `json:"id"`
	Code       string     `json:"code"`
	Kind       string     `json:"kind"` // percent | fixed
	Value      int64      `json:"value"`
	Recurring  bool       `json:"recurring"`
	ProductIDs []string   `json:"product_ids"`
	MaxUses    int        `json:"max_uses"`
	Uses       int        `json:"uses"`
	ExpiresAt  *time.Time `json:"expires_at"`
	Active     bool       `json:"active"`
	CreatedAt  time.Time  `json:"created_at"`
}

Coupon is a discount code.

type CreditTransaction

type CreditTransaction struct {
	ID        string    `json:"id"`
	Amount    int64     `json:"amount"`
	Currency  string    `json:"currency"`
	Reason    string    `json:"reason"` // admin, invoice, downgrade
	Note      string    `json:"note"`
	InvoiceID *string   `json:"invoice_id"`
	CreatedAt time.Time `json:"created_at"`
}

CreditTransaction is one movement of account credit.

type DNSZone

type DNSZone struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	OwnerID     string    `json:"owner_id"`
	OwnerEmail  string    `json:"owner_email"`
	Provider    string    `json:"provider"`
	RemoteID    string    `json:"-"`
	Nameservers []string  `json:"nameservers"`
	CreatedAt   time.Time `json:"created_at"`
}

DNSZone is a zone hosted at the DNS provider.

type Extension

type Extension struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Version     string            `json:"version"`
	Manifest    json.RawMessage   `json:"manifest"`
	Package     []byte            `json:"-"`
	Signer      string            `json:"signer"`
	Enabled     bool              `json:"enabled"`
	Settings    map[string]string `json:"-"`
	LastError   string            `json:"last_error"`
	LastErrorAt *time.Time        `json:"last_error_at"`
	InstalledAt time.Time         `json:"installed_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
}

Extension is an installed extension.

type ExtensionKV

type ExtensionKV struct{ S *Store }

ExtensionKV implements extensions.KV on the database.

func (ExtensionKV) Get

func (k ExtensionKV) Get(ctx context.Context, ext, key string) ([]byte, bool, error)

Get reads a key.

func (ExtensionKV) Set

func (k ExtensionKV) Set(ctx context.Context, ext, key string, value []byte) error

Set writes a key (new keys only while the extension has fewer than 1000).

type Invoice

type Invoice struct {
	ID        string        `json:"id"`
	Number    string        `json:"number"`
	UserID    string        `json:"user_id"`
	UserEmail string        `json:"user_email"`
	Status    string        `json:"status"`
	Currency  string        `json:"currency"`
	Total     int64         `json:"total"`
	DueAt     time.Time     `json:"due_at"`
	PaidAt    *time.Time    `json:"paid_at"`
	CreatedAt time.Time     `json:"created_at"`
	Items     []InvoiceItem `json:"items,omitempty"`
}

Invoice is a bill with its items.

type InvoiceItem

type InvoiceItem struct {
	ID             string     `json:"id"`
	SubscriptionID *string    `json:"subscription_id"`
	Kind           string     `json:"kind"`
	Description    string     `json:"description"`
	Amount         int64      `json:"amount"`
	PeriodStart    *time.Time `json:"period_start"`
	PeriodEnd      *time.Time `json:"period_end"`
	// Change is the plan change a "change" line applies once paid.
	Change json.RawMessage `json:"-"`
}

InvoiceItem is one line of an invoice.

type MailDomain

type MailDomain struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	OwnerID      string    `json:"owner_id"`
	OwnerEmail   string    `json:"owner_email"`
	RemoteID     string    `json:"-"`
	MaxMailboxes int       `json:"max_mailboxes"`
	MaxQuotaMB   int       `json:"max_quota_mb"`
	Mailboxes    int       `json:"mailbox_count"`
	CreatedAt    time.Time `json:"created_at"`
}

MailDomain is an email domain hosted on the mail server.

type Mailbox

type Mailbox struct {
	ID        string    `json:"id"`
	DomainID  string    `json:"domain_id"`
	LocalPart string    `json:"local_part"`
	RemoteID  string    `json:"-"`
	QuotaMB   int       `json:"quota_mb"`
	Aliases   []string  `json:"aliases"`
	CreatedAt time.Time `json:"created_at"`
}

Mailbox is one address with a login.

type NewOrder

type NewOrder struct {
	UserID, ProductID, PlanID, Name, Cycle string
	Options                                map[string]int
	MemoryMB, CPUPercent, DiskMB           int
	Amount, FirstTotal                     int64
	Currency, Description                  string
	// Coupon (optional): its use is counted in the order's transaction.
	CouponID            *string
	Discount            int64
	DiscountDescription string
}

NewOrder is a checkout: the subscription to create and its first invoice line.

type NewService

type NewService struct {
	Name, OwnerID, NodeID, BlueprintID, AllocationID string
	Image, Startup                                   string
	Variables                                        map[string]string
	MemoryMB, CPUPercent, DiskMB                     int
}

NewService holds the validated input for CreateService.

type NewWebsite

type NewWebsite struct {
	OwnerID, NodeID, Name, PHPVersion, Domain, TLS string
	DiskMB, MemoryMB, CPUPercent, Processes        int
	MaxDomains, MaxDatabases                       int
}

NewWebsite is what is needed to create a website.

type Node

type Node struct {
	ID            string          `json:"id"`
	Name          string          `json:"name"`
	Address       string          `json:"address"`
	Joined        bool            `json:"joined"`
	CertExpiresAt *time.Time      `json:"cert_expires_at"`
	JoinExpiresAt *time.Time      `json:"join_expires_at"`
	AgentVersion  string          `json:"agent_version"`
	Info          json.RawMessage `json:"info"`
	LastSeenAt    *time.Time      `json:"last_seen_at"`
	CreatedAt     time.Time       `json:"created_at"`
}

Node is a machine running ammonode-agent.

type Passkey

type Passkey struct {
	ID             string     `json:"id"`
	UserID         string     `json:"-"`
	CredentialID   []byte     `json:"-"`
	PublicKey      []byte     `json:"-"`
	Alg            int64      `json:"-"`
	SignCount      uint32     `json:"-"`
	BackupEligible bool       `json:"synced"`
	Name           string     `json:"name"`
	CreatedAt      time.Time  `json:"created_at"`
	LastUsedAt     *time.Time `json:"last_used_at"`
}

Passkey is a registered WebAuthn credential.

type Payment

type Payment struct {
	Gateway   string    `json:"gateway"`
	Amount    int64     `json:"amount"`
	Currency  string    `json:"currency"`
	CreatedAt time.Time `json:"created_at"`
}

Payment is money received for an invoice.

type PaymentHook

type PaymentHook func(ctx context.Context, tx pgx.Tx, invoiceID string) error

PaymentHook runs inside RecordPayment's transaction when an invoice becomes paid (used to enqueue processing in the same transaction).

type Product

type Product struct {
	ID            string          `json:"id"`
	Kind          string          `json:"kind"` // service | website | external
	Name          string          `json:"name"`
	Description   string          `json:"description"`
	BlueprintID   string          `json:"blueprint_id"`
	BlueprintName string          `json:"blueprint_name"`
	NodeIDs       []string        `json:"node_ids"`
	Active        bool            `json:"active"`
	Sort          int             `json:"sort"`
	Plans         []ProductPlan   `json:"plans"`
	Options       []ProductOption `json:"options"`
	CreatedAt     time.Time       `json:"created_at"`
	// Provisioner is the extension that delivers an external product, with its settings.
	Provisioner         string            `json:"provisioner"`
	ProvisionerSettings map[string]string `json:"provisioner_settings"`
}

Product is something customers can buy, with its plans and options.

type ProductOption

type ProductOption struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Resource     string `json:"resource"`
	Step         int    `json:"step"`
	MaxSteps     int    `json:"max_steps"`
	PriceMonthly int64  `json:"price_monthly"`
	Sort         int    `json:"sort"`
}

ProductOption is a configurable extra.

type ProductPlan

type ProductPlan struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	MemoryMB     int    `json:"memory_mb"`
	CPUPercent   int    `json:"cpu_percent"`
	DiskMB       int    `json:"disk_mb"`
	PriceMonthly int64  `json:"price_monthly"`
	SetupFee     int64  `json:"setup_fee"`
	Sort         int    `json:"sort"`
	// Website plans only.
	MaxDomains   int `json:"max_domains"`
	MaxDatabases int `json:"max_databases"`
}

ProductPlan is a size of a product.

type ResellerLimits

type ResellerLimits struct {
	MaxCustomers   int `json:"max_customers"`
	MaxWebsites    int `json:"max_websites"`
	MaxDiskMB      int `json:"max_disk_mb"`
	MaxMemoryMB    int `json:"max_memory_mb"`
	MaxMailDomains int `json:"max_mail_domains"`
}

ResellerLimits cap what a reseller may hand out to their customers.

type ResellerUsage

type ResellerUsage struct {
	Customers   int `json:"customers"`
	Websites    int `json:"websites"`
	DiskMB      int `json:"disk_mb"`
	MemoryMB    int `json:"memory_mb"`
	MailDomains int `json:"mail_domains"`
}

ResellerUsage is what a reseller's customers use now.

type Service

type Service struct {
	ID            string            `json:"id"`
	Name          string            `json:"name"`
	OwnerID       string            `json:"owner_id"`
	OwnerEmail    string            `json:"owner_email"`
	NodeID        string            `json:"node_id"`
	NodeName      string            `json:"node_name"`
	NodeAddress   string            `json:"node_address"`
	BlueprintID   string            `json:"blueprint_id"`
	BlueprintName string            `json:"blueprint_name"`
	Features      []string          `json:"features"` // egg features, e.g. "eula"
	AllocationID  string            `json:"allocation_id"`
	IP            string            `json:"ip"`
	Port          int               `json:"port"`
	Image         string            `json:"image"`
	Startup       string            `json:"startup"`
	Variables     map[string]string `json:"variables"`
	MemoryMB      int               `json:"memory_mb"`
	CPUPercent    int               `json:"cpu_percent"`
	DiskMB        int               `json:"disk_mb"`
	State         string            `json:"state"`
	StateDetail   string            `json:"state_detail"`
	StateAt       time.Time         `json:"state_at"`
	SFTPPort      int               `json:"sftp_port"`
	Suspended     bool              `json:"suspended"`
	CreatedAt     time.Time         `json:"created_at"`
	// SkipInstall: imported from another panel; the node adopts the existing files.
	SkipInstall bool `json:"skip_install"`
}

Service is a game server or bot.

type Store

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

Store runs queries against the panel database.

func New

func New(pool *pgxpool.Pool) *Store

New wraps a connection pool.

func (*Store) ActivateTheme

func (s *Store) ActivateTheme(ctx context.Context, id string) error

ActivateTheme makes one theme active; an empty id goes back to the default.

func (*Store) ActiveTheme

func (s *Store) ActiveTheme(ctx context.Context) (Theme, error)

ActiveTheme returns the active theme (ErrNotFound = the built-in default).

func (*Store) AddPasskey

func (s *Store) AddPasskey(ctx context.Context, p Passkey) (Passkey, error)

AddPasskey stores a verified credential.

func (*Store) AddWebsiteCron

func (s *Store) AddWebsiteCron(ctx context.Context, websiteID, schedule, command string) error

AddWebsiteCron adds a cron job (at most 20 per website).

func (*Store) AddWebsiteDatabase

func (s *Store) AddWebsiteDatabase(ctx context.Context, websiteID, name string) (WebsiteDatabase, error)

AddWebsiteDatabase records a database within the website's limit.

func (*Store) AddWebsiteDomain

func (s *Store) AddWebsiteDomain(ctx context.Context, websiteID string, d WebsiteDomain) error

AddWebsiteDomain adds a domain within the website's limit.

func (*Store) AdjustCredit

func (s *Store) AdjustCredit(ctx context.Context, userID string, amount int64, currency, reason, note string, by *string) (int64, error)

AdjustCredit adds (or with a negative amount removes) account credit and logs it.

func (*Store) ApplySubscriptionChange

func (s *Store) ApplySubscriptionChange(ctx context.Context, sub Subscription, c SubscriptionChange, credit int64, note string) error

ApplySubscriptionChange resizes a subscription and its service (limits apply on the next start), and cancels an unpaid renewal so the next one is billed at the new price. A credit (downgrade refund) is added in the same transaction.

func (*Store) BlueprintExport

func (s *Store) BlueprintExport(ctx context.Context, id string) (name string, raw []byte, err error)

BlueprintExport returns the egg export exactly as it was imported.

func (*Store) BlueprintRaw

func (s *Store) BlueprintRaw(ctx context.Context, id string) ([]byte, error)

BlueprintRaw returns the stored egg export of a blueprint.

func (*Store) CancelOpenInvoices

func (s *Store) CancelOpenInvoices(ctx context.Context, subID string) error

CancelOpenInvoices cancels a subscription's unpaid invoices (on termination).

func (*Store) ConsumeEmailToken

func (s *Store) ConsumeEmailToken(ctx context.Context, tokenHash []byte, purpose string) (User, error)

ConsumeEmailToken deletes a valid token and returns its user. The link is only valid while the account still has the address it was sent to.

func (*Store) CountAdmins

func (s *Store) CountAdmins(ctx context.Context) (int, error)

CountAdmins returns the number of admin accounts.

func (*Store) CouponByCode

func (s *Store) CouponByCode(ctx context.Context, code string) (Coupon, error)

CouponByCode finds a coupon case-insensitively (whether usable or not).

func (*Store) CreateAllocations

func (s *Store) CreateAllocations(ctx context.Context, nodeID, ip string, ports []int) (int, error)

CreateAllocations adds ports on a node, skipping ones that already exist. It returns how many were added.

func (*Store) CreateChangeInvoice

func (s *Store) CreateChangeInvoice(ctx context.Context, sub Subscription, c SubscriptionChange, amount int64, description string) (string, error)

CreateChangeInvoice bills an upgrade; the change is applied when the invoice is paid. Earlier unpaid change invoices of the subscription are cancelled.

func (*Store) CreateCustomer

func (s *Store) CreateCustomer(ctx context.Context, email, name, passwordHash, locale string) (User, error)

CreateCustomer inserts a self sign-up whose email still has to be verified.

func (*Store) CreateDNSZone

func (s *Store) CreateDNSZone(ctx context.Context, z DNSZone) (DNSZone, error)

CreateDNSZone records a zone; ErrConflict when the name is taken.

func (*Store) CreateEmailToken

func (s *Store) CreateEmailToken(ctx context.Context, tokenHash []byte, userID, purpose, email string, ttl time.Duration) error

CreateEmailToken stores the hash of a one-time link. Older links of the same purpose stop working, so only the newest email counts.

func (*Store) CreateMailDomain

func (s *Store) CreateMailDomain(ctx context.Context, d MailDomain) (MailDomain, error)

CreateMailDomain records a hosted mail domain; ErrConflict when taken.

func (*Store) CreateMailbox

func (s *Store) CreateMailbox(ctx context.Context, m Mailbox) (Mailbox, error)

CreateMailbox records a mailbox; ErrLimit when the domain is full (checked in the same statement).

func (*Store) CreateNode

func (s *Store) CreateNode(ctx context.Context, name, address string, tokenHash []byte, tokenExpires time.Time) (Node, error)

CreateNode adds a node together with its first join token (stored as a hash).

func (*Store) CreateOrder

func (s *Store) CreateOrder(ctx context.Context, o NewOrder) (Invoice, error)

CreateOrder stores a pending subscription and its first (unpaid) invoice.

func (*Store) CreateRenewal

func (s *Store) CreateRenewal(ctx context.Context, sub Subscription, description string, periodStart, periodEnd time.Time) (string, error)

CreateRenewal adds an unpaid renewal invoice for the next period of a subscription.

func (*Store) CreateResellerCustomer

func (s *Store) CreateResellerCustomer(ctx context.Context, resellerID, email, name, passwordHash string) (User, error)

CreateResellerCustomer creates a verified customer that belongs to a reseller. The customer limit is checked in the same statement.

func (*Store) CreateService

func (s *Store) CreateService(ctx context.Context, in NewService) (Service, error)

CreateService inserts a service and claims its allocation in one transaction. ErrConflict means the allocation is taken or belongs to another node.

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, tokenHash []byte, userID, userAgent, ip string, expires time.Time) error

CreateSession stores a session for the token hash.

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, email, name, passwordHash string, isAdmin bool) (User, error)

CreateUser inserts a user with an already hashed password. Accounts created by an admin (or the CLI) count as verified.

func (*Store) CreateWebsite

func (s *Store) CreateWebsite(ctx context.Context, n NewWebsite) (Website, error)

CreateWebsite creates a website with its primary domain.

func (*Store) CreditHistory

func (s *Store) CreditHistory(ctx context.Context, userID string) ([]CreditTransaction, error)

CreditHistory returns the latest credit movements of a user.

func (*Store) DNSZoneByName

func (s *Store) DNSZoneByName(ctx context.Context, name string) (DNSZone, error)

DNSZoneByName loads a zone by its fully qualified name.

func (*Store) DeleteAllocation

func (s *Store) DeleteAllocation(ctx context.Context, nodeID, id string) error

DeleteAllocation removes an unused allocation of a node.

func (*Store) DeleteBlueprint

func (s *Store) DeleteBlueprint(ctx context.Context, id string) error

DeleteBlueprint removes a blueprint.

func (*Store) DeleteCoupon

func (s *Store) DeleteCoupon(ctx context.Context, id string) error

DeleteCoupon removes a coupon; subscriptions that used it keep their price.

func (*Store) DeleteDNSZone

func (s *Store) DeleteDNSZone(ctx context.Context, id string) error

DeleteDNSZone removes a zone record.

func (*Store) DeleteExtension

func (s *Store) DeleteExtension(ctx context.Context, id string) error

DeleteExtension removes an extension and its stored data.

func (*Store) DeleteMailDomain

func (s *Store) DeleteMailDomain(ctx context.Context, id string) error

DeleteMailDomain removes a domain and its mailboxes.

func (*Store) DeleteMailbox

func (s *Store) DeleteMailbox(ctx context.Context, domainID, id string) error

DeleteMailbox removes a mailbox record.

func (*Store) DeleteNode

func (s *Store) DeleteNode(ctx context.Context, id string) error

DeleteNode removes a node; its certificate stops being accepted immediately.

func (*Store) DeletePasskey

func (s *Store) DeletePasskey(ctx context.Context, userID, id string) error

DeletePasskey removes one of the user's passkeys.

func (*Store) DeleteProduct

func (s *Store) DeleteProduct(ctx context.Context, id string) error

DeleteProduct removes a product (ErrInUse while subscriptions reference it).

func (*Store) DeleteService

func (s *Store) DeleteService(ctx context.Context, id string) error

DeleteService removes a service and frees its allocation.

func (*Store) DeleteSession

func (s *Store) DeleteSession(ctx context.Context, tokenHash []byte) error

DeleteSession signs a session out.

func (*Store) DeleteTheme

func (s *Store) DeleteTheme(ctx context.Context, id string) error

DeleteTheme removes a theme (the default takes over if it was active).

func (*Store) DeleteWebsite

func (s *Store) DeleteWebsite(ctx context.Context, id string) error

DeleteWebsite removes a website record.

func (*Store) DeleteWebsiteCron

func (s *Store) DeleteWebsiteCron(ctx context.Context, websiteID, id string) error

DeleteWebsiteCron removes a cron job.

func (*Store) DeleteWebsiteDatabase

func (s *Store) DeleteWebsiteDatabase(ctx context.Context, websiteID, dbID string) (string, error)

DeleteWebsiteDatabase forgets a database and returns its name.

func (*Store) DeleteWebsiteDomain

func (s *Store) DeleteWebsiteDomain(ctx context.Context, websiteID, domainID string) error

DeleteWebsiteDomain removes a domain (never the last one).

func (*Store) DisableTOTP

func (s *Store) DisableTOTP(ctx context.Context, id string) error

DisableTOTP turns 2FA off and forgets the recovery codes.

func (*Store) DomainGitHook

func (s *Store) DomainGitHook(ctx context.Context, domainID string, tokenHash []byte) (websiteID string, d WebsiteDomain, err error)

DomainGitHook finds the website of a domain whose push-to-deploy secret matches.

func (*Store) DomainTaken

func (s *Store) DomainTaken(ctx context.Context, name string) (bool, error)

DomainTaken reports whether a host name is used by a website (as domain or alias).

func (*Store) EnableTOTP

func (s *Store) EnableTOTP(ctx context.Context, id string, step int64, recoveryHashes [][]byte) error

EnableTOTP activates the pending secret and replaces the recovery codes.

func (*Store) FindFreeAllocation

func (s *Store) FindFreeAllocation(ctx context.Context, nodeIDs []string, skip []string) (allocID, nodeID string, err error)

FindFreeAllocation picks a free allocation on one of nodeIDs (any node when empty), preferring nodes that run the fewest services.

func (*Store) GetBlueprint

func (s *Store) GetBlueprint(ctx context.Context, id string) (Blueprint, error)

GetBlueprint returns one blueprint including the normalised egg.

func (*Store) GetCoupon

func (s *Store) GetCoupon(ctx context.Context, id string) (Coupon, error)

GetCoupon returns a coupon by ID.

func (*Store) GetDNSZone

func (s *Store) GetDNSZone(ctx context.Context, id string) (DNSZone, error)

GetDNSZone loads one zone.

func (*Store) GetExtension

func (s *Store) GetExtension(ctx context.Context, id string) (Extension, error)

GetExtension returns one extension with its package.

func (*Store) GetInvoice

func (s *Store) GetInvoice(ctx context.Context, id string) (Invoice, error)

GetInvoice returns an invoice with its items.

func (*Store) GetMailDomain

func (s *Store) GetMailDomain(ctx context.Context, id string) (MailDomain, error)

GetMailDomain loads one domain.

func (*Store) GetMailbox

func (s *Store) GetMailbox(ctx context.Context, domainID, id string) (Mailbox, error)

GetMailbox loads a mailbox of a domain.

func (*Store) GetNode

func (s *Store) GetNode(ctx context.Context, id string) (Node, error)

GetNode returns one node.

func (*Store) GetProduct

func (s *Store) GetProduct(ctx context.Context, id string) (Product, error)

GetProduct returns one product.

func (*Store) GetResellerLimits

func (s *Store) GetResellerLimits(ctx context.Context, userID string) (ResellerLimits, error)

GetResellerLimits loads a reseller's limits.

func (*Store) GetService

func (s *Store) GetService(ctx context.Context, id string) (Service, error)

GetService returns one service.

func (*Store) GetSetting

func (s *Store) GetSetting(ctx context.Context, key string, out any) error

GetSetting decodes a setting into out; ErrNotFound if it was never saved.

func (*Store) GetSubscription

func (s *Store) GetSubscription(ctx context.Context, id string) (Subscription, error)

GetSubscription returns one subscription.

func (*Store) GetWebsite

func (s *Store) GetWebsite(ctx context.Context, id string) (Website, error)

GetWebsite returns a website with its domains, databases and cron jobs.

func (*Store) ImportBlueprint

func (s *Store) ImportBlueprint(ctx context.Context, raw []byte, e *egg.Egg, warnings []egg.Warning, sourceURL string) (b Blueprint, created bool, err error)

ImportBlueprint stores an egg export that egg.Parse accepted. Importing the exact same bytes again returns the existing blueprint with created == false, refreshing its normalised egg and warnings so improvements to pkg/egg reach eggs imported earlier. sourceURL records where the file came from (empty for uploads).

func (*Store) ListAllocations

func (s *Store) ListAllocations(ctx context.Context, nodeID string) ([]Allocation, error)

ListAllocations returns a node's allocations ordered by IP and port.

func (*Store) ListBlueprints

func (s *Store) ListBlueprints(ctx context.Context) ([]Blueprint, error)

ListBlueprints returns every blueprint ordered by name, without the egg body.

func (*Store) ListCoupons

func (s *Store) ListCoupons(ctx context.Context) ([]Coupon, error)

ListCoupons returns every coupon, newest first.

func (*Store) ListDNSZones

func (s *Store) ListDNSZones(ctx context.Context, ownerID string) ([]DNSZone, error)

ListDNSZones lists zones of an owner ("" = all).

func (*Store) ListExtensions

func (s *Store) ListExtensions(ctx context.Context) ([]Extension, error)

ListExtensions returns installed extensions (without their packages).

func (*Store) ListInvoices

func (s *Store) ListInvoices(ctx context.Context, userID string) ([]Invoice, error)

ListInvoices returns a user's invoices, or all when userID is empty.

func (*Store) ListMailDomains

func (s *Store) ListMailDomains(ctx context.Context, ownerID string) ([]MailDomain, error)

ListMailDomains lists domains of an owner ("" = all).

func (*Store) ListMailboxes

func (s *Store) ListMailboxes(ctx context.Context, domainID string) ([]Mailbox, error)

ListMailboxes lists a domain's mailboxes.

func (*Store) ListNodes

func (s *Store) ListNodes(ctx context.Context) ([]Node, error)

ListNodes returns all nodes ordered by name.

func (*Store) ListPasskeys

func (s *Store) ListPasskeys(ctx context.Context, userID string) ([]Passkey, error)

ListPasskeys returns a user's passkeys.

func (*Store) ListPayments

func (s *Store) ListPayments(ctx context.Context, invoiceID string) ([]Payment, error)

ListPayments returns an invoice's payments, oldest first.

func (*Store) ListProducts

func (s *Store) ListProducts(ctx context.Context, activeOnly bool) ([]Product, error)

ListProducts returns products (only active ones when activeOnly) with plans and options.

func (*Store) ListResellerCustomers

func (s *Store) ListResellerCustomers(ctx context.Context, resellerID string) ([]User, error)

ListResellerCustomers lists a reseller's customers.

func (*Store) ListServices

func (s *Store) ListServices(ctx context.Context, ownerID, nodeID string) ([]Service, error)

ListServices returns services, optionally only those owned by ownerID or placed on nodeID.

func (*Store) ListSubscriptions

func (s *Store) ListSubscriptions(ctx context.Context, userID string) ([]Subscription, error)

ListSubscriptions returns a user's subscriptions, or all when userID is empty.

func (*Store) ListThemes

func (s *Store) ListThemes(ctx context.Context) ([]Theme, error)

ListThemes returns every theme.

func (*Store) ListUsers

func (s *Store) ListUsers(ctx context.Context) ([]UserSummary, error)

ListUsers returns all users ordered by email.

func (*Store) ListWebsites

func (s *Store) ListWebsites(ctx context.Context, ownerID, nodeID string) ([]Website, error)

ListWebsites returns websites of an owner ("" = all), optionally on one node.

func (*Store) ListWebsitesOfReseller

func (s *Store) ListWebsitesOfReseller(ctx context.Context, resellerID string) ([]Website, error)

ListWebsitesOfReseller lists the websites of a reseller's customers.

func (*Store) LoadOrCreateCA

func (s *Store) LoadOrCreateCA(ctx context.Context, create func() (certPEM, keyPEM []byte, err error)) (certPEM, keyPEM []byte, err error)

LoadOrCreateCA returns the stored CA PEMs, creating them with create on first use. Concurrent first starts are safe: only one row can win, and everyone reads it back.

func (*Store) MailDomainByName

func (s *Store) MailDomainByName(ctx context.Context, name string) (MailDomain, error)

MailDomainByName loads a domain by name.

func (*Store) MailNameTaken

func (s *Store) MailNameTaken(ctx context.Context, domainID, local, exceptMailbox string) (bool, error)

MailNameTaken reports whether a local part is used as a mailbox or alias in a domain.

func (*Store) NodeByCert

func (s *Store) NodeByCert(ctx context.Context, fingerprint []byte) (Node, error)

NodeByCert finds the node a client certificate belongs to.

func (*Store) OpenRenewal

func (s *Store) OpenRenewal(ctx context.Context, subID string, periodStart time.Time) (string, error)

OpenRenewal returns the unpaid renewal invoice for a subscription period, if any.

func (*Store) PasskeyByCredential

func (s *Store) PasskeyByCredential(ctx context.Context, credID []byte) (Passkey, error)

PasskeyByCredential finds a passkey by its credential ID.

func (*Store) PasskeyUsed

func (s *Store) PasskeyUsed(ctx context.Context, id string, oldCount, newCount uint32) error

PasskeyUsed records a sign-in. The counter only moves forward (conditional update), so two parallel uses of the same assertion cannot both succeed.

func (*Store) PayWithCredit

func (s *Store) PayWithCredit(ctx context.Context, invoiceID, userID string, onPaid PaymentHook) error

PayWithCredit pays a whole unpaid invoice from the owner's credit, atomically.

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

Ping checks that the database answers.

func (*Store) Pool

func (s *Store) Pool() *pgxpool.Pool

Pool exposes the connection pool (for the job queue).

func (*Store) PutSetting

func (s *Store) PutSetting(ctx context.Context, key string, value any) error

PutSetting stores a setting.

func (*Store) RecordNodeHello

func (s *Store) RecordNodeHello(ctx context.Context, id, agentVersion string, info json.RawMessage) error

RecordNodeHello stores what the agent reported when it connected.

func (*Store) RecordPayment

func (s *Store) RecordPayment(ctx context.Context, invoiceID, gateway, ref string, amount int64, currency, note string, onPaid PaymentHook) (bool, error)

RecordPayment stores a payment idempotently: the same (gateway, ref) is recorded once. It marks the invoice paid when the amount covers it and reports whether this call did so.

func (*Store) RecoveryCodesLeft

func (s *Store) RecoveryCodesLeft(ctx context.Context, id string) (int, error)

RecoveryCodesLeft counts unused recovery codes.

func (*Store) RedeemJoinToken

func (s *Store) RedeemJoinToken(ctx context.Context, tokenHash []byte,
	sign func(nodeID string) (fingerprint []byte, expires time.Time, err error)) (Node, error)

RedeemJoinToken consumes a join token. sign is called inside the transaction with the node ID and must return the issued certificate's fingerprint and expiry; the token is cleared and the fingerprint replaces any previous certificate (revoking it).

func (*Store) RemoveReseller

func (s *Store) RemoveReseller(ctx context.Context, userID string) error

RemoveReseller ends reseller status; their customers become normal customers.

func (*Store) RenewNodeCert

func (s *Store) RenewNodeCert(ctx context.Context, nodeID string, fingerprint []byte, expires time.Time, grace time.Duration) error

RenewNodeCert installs a renewed certificate. The previous one keeps working for grace, in case the agent fails to store the new one.

func (*Store) ResellerUsage

func (s *Store) ResellerUsage(ctx context.Context, resellerID, exceptWebsite string) (ResellerUsage, error)

ResellerUsage sums the resources of a reseller's customers (websites except one, when a website is being resized).

func (*Store) SaveCoupon

func (s *Store) SaveCoupon(ctx context.Context, c Coupon) (Coupon, error)

SaveCoupon creates (empty ID) or updates a coupon. Uses are never changed here.

func (*Store) SaveExtension

func (s *Store) SaveExtension(ctx context.Context, e Extension) (Extension, error)

SaveExtension installs or updates an extension. An update keeps enabled and settings.

func (*Store) SaveProduct

func (s *Store) SaveProduct(ctx context.Context, p Product) (Product, error)

SaveProduct creates (empty ID) or replaces a product with its plans and options in one transaction. Plans and options keep their IDs; ones missing from p are deleted, which fails with ErrInUse while subscriptions use them.

func (*Store) SaveTheme

func (s *Store) SaveTheme(ctx context.Context, t Theme) (Theme, error)

SaveTheme creates (empty ID) or updates a theme.

func (*Store) ServiceOnNodeBySuffix

func (s *Store) ServiceOnNodeBySuffix(ctx context.Context, nodeID, suffix string) (Service, error)

ServiceOnNodeBySuffix finds a service on a node by the last 8 characters of its ID (the suffix in SFTP usernames).

func (*Store) SessionUser

func (s *Store) SessionUser(ctx context.Context, tokenHash []byte) (User, error)

SessionUser returns the user of a live session and refreshes its last-seen time (at most once a minute, to avoid a write on every request).

func (*Store) SetCancelAtPeriodEnd

func (s *Store) SetCancelAtPeriodEnd(ctx context.Context, subID string, cancel bool) error

SetCancelAtPeriodEnd asks for (or withdraws) cancellation at the next due date. Asking cancels an unpaid renewal invoice.

func (*Store) SetEmailVerified

func (s *Store) SetEmailVerified(ctx context.Context, userID string) error

SetEmailVerified marks the user's current address as verified.

func (*Store) SetExtensionEnabled

func (s *Store) SetExtensionEnabled(ctx context.Context, id string, enabled bool) error

SetExtensionEnabled turns an extension on or off.

func (*Store) SetExtensionError

func (s *Store) SetExtensionError(ctx context.Context, id, msg string) error

SetExtensionError records the latest failure ("" clears it).

func (*Store) SetExtensionSettings

func (s *Store) SetExtensionSettings(ctx context.Context, id string, settings map[string]string) error

SetExtensionSettings stores the admin's settings.

func (*Store) SetJoinToken

func (s *Store) SetJoinToken(ctx context.Context, id string, tokenHash []byte, expires time.Time) (Node, error)

SetJoinToken issues a new join token for a node (e.g. to re-install the agent). The current certificate keeps working until the new token is used.

func (*Store) SetLocale

func (s *Store) SetLocale(ctx context.Context, userID, locale string) error

SetLocale stores the language for the user's emails.

func (*Store) SetPassword

func (s *Store) SetPassword(ctx context.Context, userID, passwordHash string) error

SetPassword replaces a user's password hash and signs out all their sessions.

func (*Store) SetPendingTOTP

func (s *Store) SetPendingTOTP(ctx context.Context, id string, secret []byte) error

SetPendingTOTP stores a secret being set up (2FA is not active until EnableTOTP).

func (*Store) SetReseller

func (s *Store) SetReseller(ctx context.Context, userID string, l ResellerLimits) error

SetReseller makes a user a reseller with limits (or updates them).

func (*Store) SetServiceState

func (s *Store) SetServiceState(ctx context.Context, id, state, detail string) error

SetServiceState records a state reported by the agent (or set by the panel).

func (*Store) SetServiceStateOnNode

func (s *Store) SetServiceStateOnNode(ctx context.Context, nodeID, id, state, detail string) error

SetServiceStateOnNode records a state reported by a node's agent; services on other nodes are ignored (ErrNotFound), so an agent can only update its own services.

func (*Store) SetServiceSuspended

func (s *Store) SetServiceSuspended(ctx context.Context, id string, suspended bool) error

SetServiceSuspended flags a service as suspended for billing (or lifts it).

func (*Store) SetSubscriptionExternal

func (s *Store) SetSubscriptionExternal(ctx context.Context, id, externalID string, info json.RawMessage) error

SetSubscriptionExternal stores what a provisioner created.

func (*Store) SetSubscriptionStatus

func (s *Store) SetSubscriptionStatus(ctx context.Context, id, status, note string, serviceID *string, nextDue *time.Time) error

SetSubscriptionStatus updates status and note (and the service / due date when given).

func (*Store) SetSubscriptionWebsite

func (s *Store) SetSubscriptionWebsite(ctx context.Context, id, websiteID string, nextDue time.Time) error

SetSubscriptionWebsite links a provisioned website and activates the subscription.

func (*Store) SetWebsiteDomainGit

func (s *Store) SetWebsiteDomainGit(ctx context.Context, websiteID, domainID, repo, branch string, tokenHash []byte) error

SetWebsiteDomainGit stores a domain's Git source; tokenHash nil keeps the webhook secret.

func (*Store) SetWebsiteState

func (s *Store) SetWebsiteState(ctx context.Context, id, state, detail string, diskBytes int64) error

SetWebsiteState records the node's answer.

func (*Store) SetWebsiteSuspended

func (s *Store) SetWebsiteSuspended(ctx context.Context, id string, suspended bool) error

SetWebsiteSuspended suspends or resumes a website.

func (*Store) SubscriptionForService

func (s *Store) SubscriptionForService(ctx context.Context, serviceID string) (Subscription, error)

SubscriptionForService finds the subscription that owns a service, if any.

func (*Store) SubscriptionsDue

func (s *Store) SubscriptionsDue(ctx context.Context, before time.Time) ([]Subscription, error)

SubscriptionsDue lists active or suspended subscriptions whose due date is before t, plus pending ones whose first invoice is paid (waiting for capacity).

func (*Store) TouchNode

func (s *Store) TouchNode(ctx context.Context, id string) error

TouchNode records that the node was seen (heartbeat).

func (*Store) UpdateBlueprint

func (s *Store) UpdateBlueprint(ctx context.Context, id string, raw []byte, e *egg.Egg, warnings []egg.Warning) (Blueprint, error)

UpdateBlueprint replaces a blueprint's egg in place (services use it from their next start or reinstall). The previous file is not kept.

func (*Store) UpdateMailDomainLimits

func (s *Store) UpdateMailDomainLimits(ctx context.Context, id string, maxMailboxes, maxQuotaMB int) error

UpdateMailDomainLimits changes a domain's limits (admins).

func (*Store) UpdateMailbox

func (s *Store) UpdateMailbox(ctx context.Context, m Mailbox) error

UpdateMailbox stores quota and aliases.

func (*Store) UpdateNode

func (s *Store) UpdateNode(ctx context.Context, id, name, address string) (Node, error)

UpdateNode changes the editable fields.

func (*Store) UpdatePasswordHash

func (s *Store) UpdatePasswordHash(ctx context.Context, userID, oldHash, newHash string) error

UpdatePasswordHash replaces a hash with an equivalent one (same password, newer algorithm) without signing anyone out. It only applies while the old hash is current.

func (*Store) UpdateServiceSettings

func (s *Store) UpdateServiceSettings(ctx context.Context, id, name string, memoryMB, cpuPercent, diskMB int) error

UpdateServiceSettings changes the name and resource limits (admin).

func (*Store) UpdateServiceStartup

func (s *Store) UpdateServiceStartup(ctx context.Context, id, image string, vars map[string]string) error

UpdateServiceStartup stores a new image and variable values.

func (*Store) UpdateWebsiteDomain

func (s *Store) UpdateWebsiteDomain(ctx context.Context, websiteID string, d WebsiteDomain) error

UpdateWebsiteDomain changes a domain's aliases, document root and TLS mode.

func (*Store) UpdateWebsiteLimits

func (s *Store) UpdateWebsiteLimits(ctx context.Context, id string, l WebsiteLimits) error

UpdateWebsiteLimits sets the resources and plan limits.

func (*Store) UpdateWebsitePHP

func (s *Store) UpdateWebsitePHP(ctx context.Context, id, version string, php map[string]string) error

UpdateWebsitePHP sets the PHP version and php.ini overrides.

func (*Store) UseRecoveryCode

func (s *Store) UseRecoveryCode(ctx context.Context, id string, hash []byte) (bool, error)

UseRecoveryCode consumes a recovery code; false if it does not exist (or was used).

func (*Store) UseTOTPStep

func (s *Store) UseTOTPStep(ctx context.Context, id string, step int64) (bool, error)

UseTOTPStep records an accepted time step; false if it (or a later one) was used already, which stops two concurrent logins from using the same code.

func (*Store) UserByEmail

func (s *Store) UserByEmail(ctx context.Context, email string) (User, error)

UserByEmail looks a user up case-insensitively.

func (*Store) UserByID

func (s *Store) UserByID(ctx context.Context, id string) (User, error)

UserByID loads a user.

func (*Store) UserByWebAuthnID

func (s *Store) UserByWebAuthnID(ctx context.Context, handle []byte) (User, error)

UserByWebAuthnID finds the user of a WebAuthn handle.

func (*Store) WebAuthnID

func (s *Store) WebAuthnID(ctx context.Context, userID string) ([]byte, error)

WebAuthnID returns the user's opaque WebAuthn handle, creating it on first use.

func (*Store) WebsiteOnNodeBySuffix

func (s *Store) WebsiteOnNodeBySuffix(ctx context.Context, nodeID, suffix string) (Website, error)

WebsiteOnNodeBySuffix finds a website on a node by the last 8 characters of its ID (SFTP).

type Subscription

type Subscription struct {
	ID          string         `json:"id"`
	UserID      string         `json:"user_id"`
	UserEmail   string         `json:"user_email"`
	ProductID   string         `json:"product_id"`
	ProductName string         `json:"product_name"`
	PlanID      string         `json:"plan_id"`
	PlanName    string         `json:"plan_name"`
	Name        string         `json:"name"`
	Cycle       string         `json:"cycle"`
	Options     map[string]int `json:"options"`
	MemoryMB    int            `json:"memory_mb"`
	CPUPercent  int            `json:"cpu_percent"`
	DiskMB      int            `json:"disk_mb"`
	Amount      int64          `json:"amount"`
	Currency    string         `json:"currency"`
	Status      string         `json:"status"`
	StatusNote  string         `json:"status_note"`
	ServiceID   *string        `json:"service_id"`
	NextDueAt   *time.Time     `json:"next_due_at"`
	CreatedAt   time.Time      `json:"created_at"`
	CouponID    *string        `json:"coupon_id"`
	WebsiteID   *string        `json:"website_id"`
	ProductKind string         `json:"product_kind"`
	// CancelAtPeriodEnd: no renewal; the service is removed at the next due date.
	CancelAtPeriodEnd bool `json:"cancel_at_period_end"`
	// ExternalID / ExternalInfo: what a provisioner extension created for an external product.
	ExternalID   string          `json:"-"`
	ExternalInfo json.RawMessage `json:"external_info"`
}

Subscription is a customer's purchase.

type SubscriptionChange

type SubscriptionChange struct {
	PlanID     string         `json:"plan_id"`
	Options    map[string]int `json:"options"`
	MemoryMB   int            `json:"memory_mb"`
	CPUPercent int            `json:"cpu_percent"`
	DiskMB     int            `json:"disk_mb"`
	Amount     int64          `json:"amount"`
}

SubscriptionChange is a new size for a subscription (plan + options) and its new price.

type Theme

type Theme struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Tokens    json.RawMessage `json:"tokens"`
	CSS       string          `json:"css"`
	Active    bool            `json:"active"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

Theme is a set of design tokens and custom CSS.

type User

type User struct {
	ID           string    `json:"id"`
	Email        string    `json:"email"`
	Name         string    `json:"name"`
	IsAdmin      bool      `json:"is_admin"`
	CreatedAt    time.Time `json:"created_at"`
	PasswordHash string    `json:"-"`
	// TwoFactor is true once TOTP is enabled.
	TwoFactor    bool   `json:"two_factor"`
	TOTPSecret   []byte `json:"-"`
	TOTPPending  []byte `json:"-"`
	TOTPLastStep int64  `json:"-"`
	// EmailVerified is false for self sign-ups until they follow the emailed link.
	EmailVerified bool   `json:"email_verified"`
	Locale        string `json:"locale"`
	// Credit is the account balance in the panel currency.
	Credit int64 `json:"credit"`
	// IsReseller: the user creates and manages their own customers.
	IsReseller bool `json:"is_reseller"`
	// ResellerID is the reseller this customer belongs to.
	ResellerID *string `json:"reseller_id"`
}

User is an account. PasswordHash never leaves the server.

type UserSummary

type UserSummary struct {
	User
	Services int `json:"services"`
}

UserSummary is a user with the number of services they own.

type Website

type Website struct {
	ID           string            `json:"id"`
	OwnerID      string            `json:"owner_id"`
	OwnerEmail   string            `json:"owner_email"`
	NodeID       string            `json:"node_id"`
	NodeName     string            `json:"node_name"`
	NodeAddress  string            `json:"node_address"`
	Name         string            `json:"name"`
	Username     string            `json:"username"`
	PHPVersion   string            `json:"php_version"`
	PHP          map[string]string `json:"php"`
	DiskMB       int               `json:"disk_mb"`
	MemoryMB     int               `json:"memory_mb"`
	CPUPercent   int               `json:"cpu_percent"`
	Processes    int               `json:"processes"`
	MaxDomains   int               `json:"max_domains"`
	MaxDatabases int               `json:"max_databases"`
	BackupsKeep  int               `json:"backups_keep"`
	State        string            `json:"state"`
	StateDetail  string            `json:"state_detail"`
	Suspended    bool              `json:"suspended"`
	DiskBytes    int64             `json:"disk_bytes"`
	CreatedAt    time.Time         `json:"created_at"`
	Domains      []WebsiteDomain   `json:"domains"`
	Databases    []WebsiteDatabase `json:"databases"`
	Cron         []WebsiteCron     `json:"cron"`
}

Website is a hosting account on a node.

type WebsiteCron

type WebsiteCron struct {
	ID        string    `json:"id"`
	Schedule  string    `json:"schedule"`
	Command   string    `json:"command"`
	CreatedAt time.Time `json:"created_at"`
}

WebsiteCron is a cron job.

type WebsiteDatabase

type WebsiteDatabase struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
}

WebsiteDatabase is a MariaDB database of a website.

type WebsiteDomain

type WebsiteDomain struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Aliases   []string  `json:"aliases"`
	Root      string    `json:"root"`
	TLS       string    `json:"tls"`
	GitRepo   string    `json:"git_repo"`
	GitBranch string    `json:"git_branch"`
	GitHook   bool      `json:"git_hook"` // a push-to-deploy secret exists
	CreatedAt time.Time `json:"created_at"`
}

WebsiteDomain is a site of a website.

type WebsiteLimits

type WebsiteLimits struct {
	Name                                    string
	DiskMB, MemoryMB, CPUPercent, Processes int
	MaxDomains, MaxDatabases, BackupsKeep   int
}

WebsiteLimits are the resources of a website.

Jump to

Keyboard shortcuts

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