groups

package
v0.0.0-...-d25dbbd Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package groups implements the Groups domain — cross-type resource organisation.

A Group is a named label that can be assigned to any supported object type (server, secret, database, etc.) for visual organisation. Groups do not convey permissions or tenant boundaries.

Domain boundary: this package must not import backend/infra, backend/platform, or any concrete framework/IO package. Its only allowed dependencies are other domain packages and domain-owned interfaces.

Index

Constants

View Source
const (
	Collection      = "groups"
	ItemsCollection = "group_items"
)

Variables

This section is empty.

Functions

func LoadNamesForObjects

func LoadNamesForObjects(app core.App, objectType ObjectType, objectIDs []string) (map[string][]string, error)

LoadNamesForObjects returns a map of objectID → sorted group names for the given objectType and objectIDs.

Only the provided objectIDs are considered; the returned map contains an entry for every objectID that belongs to at least one group. IDs with no group membership are absent from the result.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group is the aggregate root for the Groups domain. It wraps a PocketBase record and exposes typed domain accessors. Callers should obtain a Group via From and use its methods for all domain-level decisions instead of inspecting raw Record fields directly.

func From

func From(rec *core.Record) *Group

From wraps a PocketBase record as a Group aggregate root.

func (*Group) CreatedBy

func (g *Group) CreatedBy() string

func (*Group) Description

func (g *Group) Description() string

func (*Group) ID

func (g *Group) ID() string

func (*Group) IsDefault

func (g *Group) IsDefault() bool

IsDefault reports whether this is the system-seeded default group. Default groups must not be deleted; this invariant must be enforced by route handlers before issuing any delete operation on a Group record.

func (*Group) Name

func (g *Group) Name() string

func (*Group) Record

func (g *Group) Record() *core.Record

Record returns the underlying PocketBase record for persistence operations.

type ObjectType

type ObjectType string

ObjectType identifies the domain type of a group member. Values must match the object_type strings stored in the group_items collection.

const (
	ObjectTypeServer       ObjectType = "server"
	ObjectTypeSecret       ObjectType = "secret"
	ObjectTypeEnvGroup     ObjectType = "env_group"
	ObjectTypeDatabase     ObjectType = "database"
	ObjectTypeCloudAccount ObjectType = "cloud_account"
	ObjectTypeCertificate  ObjectType = "certificate"
	ObjectTypeAIProvider   ObjectType = "ai_provider"
	ObjectTypeConnector    ObjectType = "connector"
	ObjectTypeScript       ObjectType = "script"
)

Jump to

Keyboard shortcuts

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