root

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Create(
		ctx context.Context,
		value Root,
	) error

	Get(
		ctx context.Context,
		id basespec.RootID,
	) (Root, error)

	List(ctx context.Context) ([]Root, error)

	Update(
		ctx context.Context,
		value Root,
		expectedRevision uint64,
	) error

	Retire(
		ctx context.Context,
		value Root,
		expectedRevision uint64,
	) error

	Purge(
		ctx context.Context,
		id basespec.RootID,
		expectedRevision uint64,
	) error
}

type Root

type Root struct {
	ID          basespec.RootID `json:"id"`
	DisplayName string          `json:"displayName"`
	Description string          `json:"description,omitempty"`
	Revision    uint64          `json:"revision"`
	CreatedAt   time.Time       `json:"createdAt"`
	ModifiedAt  time.Time       `json:"modifiedAt"`
	RetiredAt   *time.Time      `json:"retiredAt,omitempty"`
}

func (Root) Validate

func (r Root) Validate() error

type RootDraft

type RootDraft struct {
	ID          basespec.RootID `json:"id"                    required:"true"`
	DisplayName string          `json:"displayName"           required:"true"`
	Description string          `json:"description,omitempty"`
}

type RootUpdate

type RootUpdate struct {
	ExpectedRevision uint64 `json:"expectedRevision"`
	DisplayName      string `json:"displayName"`
	Description      string `json:"description,omitempty"`
}

type Service

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

func NewService

func NewService(
	repository Repository,
	timeClock clockutil.Clock,
	policy protection.RootPolicy,
) (*Service, error)

func (*Service) Create

func (s *Service) Create(
	ctx context.Context,
	draft RootDraft,
) (Root, error)

func (*Service) EnsureSystem added in v0.2.14

func (s *Service) EnsureSystem(
	ctx context.Context,
	draft RootDraft,
) (Root, error)

EnsureSystem is reserved for an application-owned protected-topology installer. Artifact Store does not assign any feature meaning to the Root.

func (*Service) Get

func (s *Service) Get(
	ctx context.Context,
	id basespec.RootID,
) (Root, error)

func (*Service) List

func (s *Service) List(ctx context.Context) ([]Root, error)

func (*Service) Purge added in v0.2.13

func (s *Service) Purge(
	ctx context.Context,
	id basespec.RootID,
	expectedRevision uint64,
) error

func (*Service) Retire added in v0.2.13

func (s *Service) Retire(
	ctx context.Context,
	id basespec.RootID,
	expectedRevision uint64,
) (Root, error)

func (*Service) Update

func (s *Service) Update(
	ctx context.Context,
	id basespec.RootID,
	update RootUpdate,
) (Root, error)

Jump to

Keyboard shortcuts

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