Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache manages per-policy OCI Layout stores under ~/.complytime/policies/{policy-id}/.
func (*Cache) ListPolicies ¶
func (*Cache) NewPolicyStore ¶
NewPolicyStore creates or opens an OCI Layout store for the given policy ID.
func (*Cache) PolicyStoreExists ¶
func (*Cache) PolicyStorePath ¶
type PolicySource ¶
type PolicySource interface {
DefinitionVersion(ctx context.Context, policyID string) (digest string, version string, err error)
CopyPolicy(ctx context.Context, policyID, tag string, dst *ocistore.Store) (ocispec.Descriptor, error)
}
PolicySource abstracts remote policy access for sync operations.
type PolicyState ¶
type PolicyState struct {
Version string `json:"version"`
Digest string `json:"digest"`
LastUpdated time.Time `json:"last_updated"`
}
PolicyState holds version, digest, and timestamp for a single cached policy.
type RegistrySource ¶
type RegistrySource struct {
// contains filtered or unexported fields
}
RegistrySource wraps a registry.Client to implement PolicySource. Uses oras.Copy() for atomic remote-to-local transfer with digest verification.
func NewRegistrySource ¶
func NewRegistrySource(client *registry.Client) *RegistrySource
func (*RegistrySource) CopyPolicy ¶
func (s *RegistrySource) CopyPolicy(ctx context.Context, policyID, tag string, dst *ocistore.Store) (ocispec.Descriptor, error)
func (*RegistrySource) DefinitionVersion ¶
type State ¶
type State struct {
LastSync time.Time `json:"last_sync"`
Policies map[string]PolicyState `json:"policies"`
}
State tracks sync metadata for all cached policies, persisted as state.json.
func (*State) GetPolicyState ¶
func (s *State) GetPolicyState(policyID string) (PolicyState, bool)
func (*State) UpdatePolicyState ¶
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync provides incremental sync using oras.Copy() for remote-to-local transfer.
func (*Sync) SyncPolicy ¶
SyncPolicy performs incremental synchronization of a policy. Compares local digest against remote manifest digest; if they match, sync is skipped. On failure, the OCI Layout store retains its previous state.