pocketbase

package module
v0.0.0-...-addcafe Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT, MIT Imports: 18 Imported by: 0

README

pocketcms

PocketCMS is a publishing, memberships, subscriptions and newsletters platform based on PocketBase. All in 1 file.

Documentation

Index

Constants

View Source
const (

	// ModerncDepsCheckHookId is the id of the hook that performs the modernc.org/* deps checks.
	// It could be used for removing/unbinding the hook if you don't want the checks.
	ModerncDepsCheckHookId = "pbModerncDepsCheck"
)

Variables

View Source
var Version = "(untracked)"

Version of PocketBase

Functions

This section is empty.

Types

type Config

type Config struct {
	// hide the default console server info on app startup
	HideStartBanner bool

	// optional default values for the console flags
	DefaultDev           bool
	DefaultDataDir       string // if not set, it will fallback to "./pc_data"
	DefaultEncryptionEnv string
	DefaultQueryTimeout  time.Duration // default to core.DefaultQueryTimeout (in seconds)

	// optional DB configurations
	DataMaxOpenConns int                // default to core.DefaultDataMaxOpenConns
	DataMaxIdleConns int                // default to core.DefaultDataMaxIdleConns
	AuxMaxOpenConns  int                // default to core.DefaultAuxMaxOpenConns
	AuxMaxIdleConns  int                // default to core.DefaultAuxMaxIdleConns
	DBConnect        core.DBConnectFunc // default to core.dbConnect
}

Config is the PocketBase initialization config struct.

type PocketBase

type PocketBase struct {
	core.App

	// RootCmd is the main console command
	RootCmd *cobra.Command
	// contains filtered or unexported fields
}

PocketBase defines a PocketBase app launcher.

It implements core.App via embedding and all of the app interface methods could be accessed directly through the instance (eg. PocketBase.DataDir()).

func New

func New() *PocketBase

New creates a new PocketBase instance with the default configuration. Use NewWithConfig if you want to provide a custom configuration.

Note that the application will not be initialized/bootstrapped yet, aka. DB connections, migrations, app settings, etc. will not be accessible. Everything will be initialized when PocketBase.Start is executed. If you want to initialize the application before calling PocketBase.Start, then you'll have to manually call [PocketBase.Bootstrap].

func NewWithConfig

func NewWithConfig(config Config) *PocketBase

NewWithConfig creates a new PocketBase instance with the provided config.

Note that the application will not be initialized/bootstrapped yet, aka. DB connections, migrations, app settings, etc. will not be accessible. Everything will be initialized when PocketBase.Start is executed. If you want to initialize the application before calling PocketBase.Start, then you'll have to manually call [PocketBase.Bootstrap].

func (*PocketBase) Execute

func (pb *PocketBase) Execute() error

Execute initializes the application (if not already) and executes the pb.RootCmd with graceful shutdown support.

This method differs from pb.Start() by not registering the default system commands!

func (*PocketBase) Start

func (pb *PocketBase) Start() error

Start starts the application, aka. registers the default system commands (serve, superuser, version) and executes pb.RootCmd.

Directories

Path Synopsis
Package core is the backbone of PocketBase.
Package core is the backbone of PocketBase.
validators
Package validators implements some common custom PocketBase validators.
Package validators implements some common custom PocketBase validators.
examples
base command
Package mails implements various helper methods for sending common emails like forgotten password, verification, etc.
Package mails implements various helper methods for sending common emails like forgotten password, verification, etc.
plugins
ghupdate
Package ghupdate implements a new command to selfupdate the current PocketBase executable with the latest GitHub release.
Package ghupdate implements a new command to selfupdate the current PocketBase executable with the latest GitHub release.
jsvm
Package jsvm implements pluggable utilities for binding a JS goja runtime to the PocketBase instance (loading migrations, attaching to app hooks, etc.).
Package jsvm implements pluggable utilities for binding a JS goja runtime to the PocketBase instance (loading migrations, attaching to app hooks, etc.).
migratecmd
Package migratecmd adds a new "migrate" command support to a PocketBase instance.
Package migratecmd adds a new "migrate" command support to a PocketBase instance.
Package tests provides common helpers and mocks used in PocketBase application tests.
Package tests provides common helpers and mocks used in PocketBase application tests.
tools
cron
Package cron implements a crontab-like service to execute and schedule repeative tasks/jobs.
Package cron implements a crontab-like service to execute and schedule repeative tasks/jobs.
filesystem/blob
Package blob defines a lightweight abstration for interacting with various storage services (local filesystem, S3, etc.).
Package blob defines a lightweight abstration for interacting with various storage services (local filesystem, S3, etc.).
filesystem/internal/fileblob
Package fileblob provides a blob.Bucket driver implementation.
Package fileblob provides a blob.Bucket driver implementation.
filesystem/internal/s3blob
Package s3blob provides a blob.Bucket S3 driver implementation.
Package s3blob provides a blob.Bucket S3 driver implementation.
filesystem/internal/s3blob/s3
Package s3 implements a lightweight client for interacting with the REST APIs of any S3 compatible service.
Package s3 implements a lightweight client for interacting with the REST APIs of any S3 compatible service.
filesystem/internal/s3blob/s3/tests
Package tests contains various tests helpers and utilities to assist with the S3 client testing.
Package tests contains various tests helpers and utilities to assist with the S3 client testing.
template
Package template is a thin wrapper around the standard html/template and text/template packages that implements a convenient registry to load and cache templates on the fly concurrently.
Package template is a thin wrapper around the standard html/template and text/template packages that implements a convenient registry to load and cache templates on the fly concurrently.
tokenizer
Package tokenizer implements a rudimentary tokens parser of buffered io.Reader while respecting quotes and parenthesis boundaries.
Package tokenizer implements a rudimentary tokens parser of buffered io.Reader while respecting quotes and parenthesis boundaries.
types
Package types implements some commonly used db serializable types like datetime, json, etc.
Package types implements some commonly used db serializable types like datetime, json, etc.
Package ui handles the PocketBase Superuser frontend embedding.
Package ui handles the PocketBase Superuser frontend embedding.

Jump to

Keyboard shortcuts

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