Documentation
¶
Overview ¶
Package project manages projects and their contract-bound eras.
Index ¶
- Constants
- Variables
- type CreateParams
- type Era
- type Project
- type Store
- func (s *Store) Archive(ctx context.Context, reference string) (Project, error)
- func (s *Store) ArchiveAs(ctx context.Context, reference, actorID string) (Project, error)
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, params CreateParams) (Project, error)
- func (s *Store) Get(ctx context.Context, reference string) (Project, error)
- func (s *Store) List(ctx context.Context) ([]Project, error)
Constants ¶
View Source
const ( StatusActive = "active" StatusArchived = "archived" EraStatusActive = "active" EraStatusClosed = "closed" )
Variables ¶
View Source
var ( ErrContractNotFound = errors.New("contract version is not installed") ErrProjectNotFound = errors.New("project not found") ErrProjectKeyConflict = errors.New("project key is already in use") ErrProjectNameConflict = errors.New("project name is already in use") ErrProjectArchived = errors.New("project is already archived") )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type CreateParams struct {
Key string
Name string
ContractID string
ContractVersion int
Actor string
}
CreateParams defines a project's immutable identity and initial contract.
type Era ¶
type Era struct {
ID int64
Number int
ContractID string
ContractVersion int
Status string
OpenedAt time.Time
ClosedAt *time.Time
}
Era is one period of a project governed by one contract version.
type Project ¶
type Project struct {
ID int64
Key string
Name string
Status string
Revision int
CreatedAt time.Time
ArchivedAt *time.Time
ActiveEra Era
}
Project is the current project snapshot with its active era.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns project persistence in the shared Pitcrew database.
func OpenReadOnly ¶ added in v0.32.0
OpenReadOnly opens an existing project store without applying migrations. Read-only callers use this to validate an association at request time.
func (*Store) ArchiveAs ¶
ArchiveAs marks a project as archived and attributes the mutation to actorID.
func (*Store) Create ¶
Create atomically creates a project, its first active era, and an audit event.
Click to show internal directories.
Click to hide internal directories.