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 = "baseModerncDepsCheck" )
Variables ¶
var Version = "(untracked)"
Version of Base
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
core.App
// RootCmd is the main console command
RootCmd *cobra.Command
// contains filtered or unexported fields
}
Base defines a Base app launcher.
It implements core.App via embedding and all of the app interface methods could be accessed directly through the instance (eg. Base.DataDir()).
func New ¶
func New() *Base
New creates a new Base 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 Base.Start is executed. If you want to initialize the application before calling Base.Start, then you'll have to manually call [Base.Bootstrap].
func NewWithConfig ¶
NewWithConfig creates a new Base 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 Base.Start is executed. If you want to initialize the application before calling Base.Start, then you'll have to manually call [Base.Bootstrap].
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 "./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 Base initialization config struct.
Directories
¶
| Path | Synopsis |
|---|---|
|
typegen
command
Command typegen generates TypeScript type definitions from a running Hanzo Base instance.
|
Command typegen generates TypeScript type definitions from a running Hanzo Base instance. |
|
Package core is the backbone of Base.
|
Package core is the backbone of Base. |
|
validators
Package validators implements some common custom Base validators.
|
Package validators implements some common custom Base 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
|
|
|
cloudsql
Package cloudsql implements Hanzo Cloud SQL — a serverless PostgreSQL integration plugin for Hanzo Base.
|
Package cloudsql implements Hanzo Cloud SQL — a serverless PostgreSQL integration plugin for Hanzo Base. |
|
functions
Package functions implements serverless function management for Hanzo Base via OpenFaaS. It provides per-tenant function deployment, invocation, and lifecycle management through the Base API surface.
|
Package functions implements serverless function management for Hanzo Base via OpenFaaS. It provides per-tenant function deployment, invocation, and lifecycle management through the Base API surface. |
|
ghupdate
Package ghupdate implements a new command to selfupdate the current Base executable with the latest GitHub release.
|
Package ghupdate implements a new command to selfupdate the current Base executable with the latest GitHub release. |
|
jsvm
Package jsvm implements pluggable utilities for binding a JS goja runtime to the Base instance (loading migrations, attaching to app hooks, etc.).
|
Package jsvm implements pluggable utilities for binding a JS goja runtime to the Base instance (loading migrations, attaching to app hooks, etc.). |
|
jsvm/internal/types
command
|
|
|
kms
Package kms provides a zero-knowledge encrypted secret management plugin for Hanzo Base with FHE query support.
|
Package kms provides a zero-knowledge encrypted secret management plugin for Hanzo Base with FHE query support. |
|
migratecmd
Package migratecmd adds a new "migrate" command support to a Base instance.
|
Package migratecmd adds a new "migrate" command support to a Base instance. |
|
platform
OrgService provides per-org configuration, credential resolution, and customer identity management.
|
OrgService provides per-org configuration, credential resolution, and customer identity management. |
|
scheduler
Package scheduler implements a scheduled function execution plugin for Base.
|
Package scheduler implements a scheduled function execution plugin for Base. |
|
tasks
Package tasks implements a durable task execution plugin for Base.
|
Package tasks implements a durable task execution plugin for Base. |
|
zap
Package zap provides a ZAP binary protocol transport for Hanzo Base.
|
Package zap provides a ZAP binary protocol transport for Hanzo Base. |
|
Package tests provides common helpers and mocks used in Base application tests.
|
Package tests provides common helpers and mocks used in Base application tests. |
|
tools
|
|
|
auth/internal/jwk
Package jwk implements some common utilities for interacting with JWKs (mostly used with OIDC providers).
|
Package jwk implements some common utilities for interacting with JWKs (mostly used with OIDC providers). |
|
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 Base Superuser frontend embedding.
|
Package ui handles the Base Superuser frontend embedding. |