Documentation
¶
Index ¶
Constants ¶
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 ¶
var Version = "(untracked)"
Version of nextbase
Functions ¶
func New ¶
func New() *nextbase
New creates a new nextbase 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 nextbase.Start is executed. If you want to initialize the application before calling nextbase.Start, then you'll have to manually call nextbase.Bootstrap.
func NewWithConfig ¶
func NewWithConfig(config Config) *nextbase
NewWithConfig creates a new nextbase 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 nextbase.Start is executed. If you want to initialize the application before calling nextbase.Start, then you'll have to manually call nextbase.Bootstrap.
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 "./pb_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 nextbase initialization config struct.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package core is the backbone of nextbase.
|
Package core is the backbone of nextbase. |
|
validators
Package validators implements some common custom nextbase validators.
|
Package validators implements some common custom nextbase 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 nextbase executable with the latest GitHub release.
|
Package ghupdate implements a new command to selfupdate the current nextbase executable with the latest GitHub release. |
|
jsvm
Package jsvm implements pluggable utilities for binding a JS goja runtime to the nextbase instance (loading migrations, attaching to app hooks, etc.).
|
Package jsvm implements pluggable utilities for binding a JS goja runtime to the nextbase instance (loading migrations, attaching to app hooks, etc.). |
|
jsvm/internal/types
command
|
|
|
migratecmd
Package migratecmd adds a new "migrate" command support to a nextbase instance.
|
Package migratecmd adds a new "migrate" command support to a nextbase instance. |
|
Package tests provides common helpers and mocks used in nextbase application tests.
|
Package tests provides common helpers and mocks used in nextbase 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. |
|
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 nextbase Superuser frontend embedding.
|
Package ui handles the nextbase Superuser frontend embedding. |