skillpg

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 14 Imported by: 0 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

Overview

Package skillpg stores Skills and their versions in PostgreSQL. Version archives are sealed with the credential key and bound to their tenant, Skill, version ID and number.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the Skills storage and Reader.

func New

func New(pool *pgunit.Pool, cipher *credentialcrypto.Cipher) *Store

New builds the Skill store. Without a cipher, uploads and content reads fail with credentialcrypto.ErrUnavailable and metadata reads still work.

func (*Store) CreateSkill

func (s *Store) CreateSkill(ctx context.Context, in skills.NewSkill) (skills.Skill, error)

func (*Store) CreateVersion

func (s *Store) CreateVersion(ctx context.Context, in skills.NewVersion) (skills.Version, error)

func (*Store) DefaultVersionContent

func (s *Store) DefaultVersionContent(ctx context.Context, tenantID string, skillID uuid.UUID) (skills.Content, error)

func (*Store) DeleteSkill

func (s *Store) DeleteSkill(ctx context.Context, tenantID string, skillID uuid.UUID) error

func (*Store) SetDefaultVersion

func (s *Store) SetDefaultVersion(ctx context.Context, tenantID string, skillID uuid.UUID, version int64) (skills.Skill, error)

func (*Store) Skill

func (s *Store) Skill(ctx context.Context, tenantID string, id uuid.UUID) (skills.Skill, error)

func (*Store) Skills

func (s *Store) Skills(ctx context.Context, tenantID string, page skills.SkillPageQuery) (skills.Page, error)

func (*Store) Version

func (s *Store) Version(ctx context.Context, tenantID string, skillID uuid.UUID, version int64) (skills.Version, error)

func (*Store) VersionByID

func (s *Store) VersionByID(ctx context.Context, tenantID string, id uuid.UUID) (skills.Version, error)

func (*Store) VersionContent

func (s *Store) VersionContent(ctx context.Context, tenantID string, skillID uuid.UUID, version int64) (skills.Content, error)

func (*Store) Versions

func (s *Store) Versions(ctx context.Context, tenantID string, skillID uuid.UUID, page skills.VersionPageQuery) (skills.VersionPage, error)

func (*Store) WithVersionDeletion

func (s *Store) WithVersionDeletion(ctx context.Context, tenantID string, skillID uuid.UUID, apply func(skills.VersionDeletionTx) error) error

Jump to

Keyboard shortcuts

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