base

package
v0.0.0-...-1746241 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 3 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	App    core.App
	Logger *slog.Logger
}

Deps captures the common runtime dependencies shared by most services.

type Descriptor

type Descriptor struct {
	Name         string
	Purpose      string
	Dependencies []string
	RuntimeState []string
	Operations   []string
}

Descriptor defines a compact, repeatable way to describe a service package.

The intent is architectural clarity rather than runtime behavior. Packages can expose a package-level `Descriptor` value to document their role, key dependencies and public operations in a uniform format.

type Service

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

Service provides a small reusable base for app-bound services.

Services can embed it to get consistent accessors for App/Dao/Logger without introducing a heavy lifecycle framework.

func New

func New(deps Deps) Service

New creates a base service from the provided dependencies.

func NewWithApp

func NewWithApp(app core.App) Service

NewWithApp creates a base service using the app and its logger.

func (*Service) App

func (s *Service) App() core.App

App returns the bound app instance.

func (*Service) Dao

func (s *Service) Dao() *daos.Dao

Dao returns the primary dao instance, or nil when the app is unset.

func (*Service) Logger

func (s *Service) Logger() *slog.Logger

Logger returns the bound logger.

func (*Service) SetApp

func (s *Service) SetApp(app core.App)

SetApp rebinds the service to a different app and refreshes the logger if it wasn't explicitly overridden.

Directories

Path Synopsis
Package models implements various services used for request data validation and applying changes to existing DB models through the app Dao.
Package models implements various services used for request data validation and applying changes to existing DB models through the app Dao.
Package models implements all PocketBase DB models and DTOs.
Package models implements all PocketBase DB models and DTOs.

Jump to

Keyboard shortcuts

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