modules

package
v1.5.104 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package modules holds the named sets of collections an org installs into its Base: the CRM is one. A module is an import document with a name, and installing it is a grow (core.GrowCollections) — additive, so installing a module again, or a newer version of it, adds what is missing and changes nothing the org already has.

A binary offers the modules it links: each one registers itself in its package's init, and a binary blank-imports the ones it serves.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownModule = errors.New("unknown module")

ErrUnknownModule is returned for a module nothing registered.

Functions

func Install

func Install(app core.App, name string) (*core.Growth, error)

Install grows the named module into app and reports what changed.

func Register

func Register(m Module)

Register makes a module installable. Registering a name twice panics: two packages claiming one name is a build mistake, not a runtime condition.

Types

type Module

type Module struct {
	// Name is how the module is addressed (POST /v1/modules/{name}).
	Name string `json:"name"`

	// Title and Description are what a person reads about it.
	Title       string `json:"title"`
	Description string `json:"description"`

	// Collections are the module's collection documents, in the shape an
	// import takes. A relation names its collection by name.
	Collections []map[string]any `json:"collections"`
}

Module is a named set of collections.

func Get

func Get(name string) (Module, bool)

Get returns a copy of the named module.

func List

func List() []Module

List returns a copy of every registered module, by name.

func (Module) Installed

func (m Module) Installed(app core.App) bool

Installed reports whether app has every collection the module names.

func (Module) Names

func (m Module) Names() []string

Names returns the names of the module's collections, in order.

Directories

Path Synopsis
Package crm is the CRM as a Base module: the collections an org's sales, hiring and outreach run on, installed into the org's own Base.
Package crm is the CRM as a Base module: the collections an org's sales, hiring and outreach run on, installed into the org's own Base.

Jump to

Keyboard shortcuts

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