caveman

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

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 15 Imported by: 0

README

Basic things to implement

  • Merge dafault routes and assets directory with the main one

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrations

func RunMigrations(app app.App) error

Types

type Caveman

type Caveman struct {
	*app.App

	RootCmd         *cobra.Command
	StartupSettings models.Config
}

Caveman defines a Caveman apppplication It embeds the App methods (providing all kinds of low-level access) But here are some higher-level methods given for convenience. Also, the user can give a custom settings struct to run the app with, that optionally can be saved as the most recent settings into the DB.

func New

func New() *Caveman

Creates a new Caveman instance with either the - latest settings from the DB - or the default settings if no settings are found.

func NewWithSettings

func NewWithSettings(settings models.Config) *Caveman

NewWithSettings creates a new Caveman 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 [Start()] is executed. If you want to initialize the application before calling [Start()], then you'll have to manually call [Bootstrap()].

func (*Caveman) Execute

func (cm *Caveman) Execute() error

func (*Caveman) Start

func (cm *Caveman) Start() error

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

Directories

Path Synopsis
Package migratecmd adds a new "migrate" command support to a PocketBase instance.
Package migratecmd adds a new "migrate" command support to a PocketBase instance.
db
Package ui handles the caveman Admin frontend embedding.
Package ui handles the caveman Admin frontend embedding.
tools
lcg
templates
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.
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.

Jump to

Keyboard shortcuts

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