pk-shared

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0

README

pk-shared

Part of PlatformKit — the open-source Go backend for multi-tenant SaaS.

Depends on. Nothing else in PlatformKit. It is a leaf of the dependency graph, so anything in the family can depend on it without creating a cycle.

Go Reference CI

pk-shared is the deliberately small, provider-neutral contract library for the OSS PlatformKit family (pk-core, pk-design, pk-modules, pk-apps). It owns only the cross-repo vocabulary — application composition descriptors, stable identifiers, neutral flow definitions, and a portable state-machine model — that cannot cleanly belong to a single owning repo. If a contract has a natural home, it lives there instead of becoming ambient shared state.

Install

go get github.com/septagon-oss/pk-shared@v0.1.0

Usage

package main

import (
	"fmt"

	"github.com/septagon-oss/pk-shared/pkg/composition"
)

func main() {
	app := &composition.Application{
		APIVersion: composition.APIVersionV1,
		Kind:       composition.KindApplication,
		Metadata:   composition.AppMetadata{Name: "demo"},
		Spec: composition.ApplicationSpec{
			Modules: []composition.ModuleRef{
				{Name: "user_management", Enabled: true},
			},
		},
	}

	catalog := []composition.ModuleCatalogEntry{{ID: "user_management"}}
	report := composition.Validate(app, catalog)
	fmt.Println("valid:", report.Valid)
	fmt.Println("enabled:", composition.EnabledModules(app))
}

Current Surface

  • pkg/composition: application, overlay, and topology-cell descriptors used to compose modules, surfaces, catalogs, and infrastructure blueprints, plus validation and Helm/config export helpers
  • pkg/contract: stable module identifiers and semantic version vocabulary
  • pkg/flowdef: neutral reusable flow definitions for UI/API coverage, authoring, and E2E/testkit bridges
  • pkg/pathsegment: canonical opaque-ID URL path-segment encoding with fail-closed decoding, so entity identifiers survive any HTTP stack
  • pkg/statemachine: declarative lifecycle definitions, structural validation, read-only traversal helpers, and Mermaid rendering

Verify

make verify   # go test + go vet + staticcheck + race

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
pkg
composition
Package composition defines provider-neutral PlatformKit application composition descriptors.
Package composition defines provider-neutral PlatformKit application composition descriptors.
contract
Package contract contains tiny shared vocabulary used across PlatformKit OSS repos.
Package contract contains tiny shared vocabulary used across PlatformKit OSS repos.
flowdef
Package flowdef defines neutral, reusable flow contracts.
Package flowdef defines neutral, reusable flow contracts.
pathsegment
Implements: REQ-004.
Implements: REQ-004.
statemachine
Package statemachine declares a portable, declarative state machine model.
Package statemachine declares a portable, declarative state machine model.

Jump to

Keyboard shortcuts

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