Documentation ¶
Overview ¶
Package `fsoregistry` implements an event-sourced aggregate that contains FSO registries. See package `fsomain` for an oveview.
Registries manage lists of roots and lists of repos. Repo details are in separate entities, implemented by package `fsorepos`.
Index ¶
- Variables
- func WhichSubdirTracking(pol *pb.FsoRepoInitPolicy, globalPath string) (pb.SubdirTracking, error)
- type Advancer
- type Behavior
- type CmdAbortArchiveRepo
- type CmdAbortFreezeRepo
- type CmdAbortUnarchiveRepo
- type CmdAbortUnfreezeRepo
- type CmdBeginArchiveRepo
- type CmdBeginFreezeRepo
- type CmdBeginMoveRepo
- type CmdBeginUnarchiveRepo
- type CmdBeginUnfreezeRepo
- type CmdCommitArchiveRepo
- type CmdCommitFreezeRepo
- type CmdCommitMoveRepo
- type CmdCommitUnarchiveRepo
- type CmdCommitUnfreezeRepo
- type CmdConfirmRepo
- type CmdCreateSplitRootConfig
- type CmdDeleteRootArchiveRecipients
- type CmdDeleteRootShadowBackupRecipients
- type CmdDeleteSplitRootConfig
- type CmdDisableGitlab
- type CmdEnableDiscoveryPaths
- type CmdEnableEphemeralWorkflows
- type CmdEnableGitlab
- type CmdEnableGitlabRepo
- type CmdEnablePropagateRootAcls
- type CmdInitRegistry
- type CmdInitRepo
- type CmdInitRoot
- type CmdPatchRepoNaming
- type CmdPostShadowRepoMoveStarted
- type CmdReinitRepo
- type CmdRemoveRoot
- type CmdSetPathFlags
- type CmdSetRepoInitPolicy
- type CmdSetRepoNaming
- type CmdUnsetPathFlags
- type CmdUpdateRootArchiveRecipients
- type CmdUpdateRootShadowBackupRecipients
- type CmdUpdateSplitRootConfig
- type DepthPath
- type EnablePathRuleError
- type Event
- func (e *Event) Id() ulid.I
- func (e *Event) MarshalProto() ([]byte, error)
- func (e *Event) Parent() ulid.I
- func (e *Event) PbRegistryEvent() *pb.RegistryEvent
- func (e *Event) UnmarshalProto(data []byte) error
- func (e Event) WithId(id ulid.I) events.Event
- func (e Event) WithParent(parent ulid.I) events.Event
- type EventDetailsError
- type Info
- type InitRepoAllower
- type InitRepoDenyError
- type InternalError
- type Preconditions
- type Registry
- func (r *Registry) AbortArchiveRepo(id uuid.I, vid ulid.I, cmd *CmdAbortArchiveRepo) (ulid.I, error)
- func (r *Registry) AbortFreezeRepo(id uuid.I, vid ulid.I, cmd *CmdAbortFreezeRepo) (ulid.I, error)
- func (r *Registry) AbortUnarchiveRepo(id uuid.I, vid ulid.I, cmd *CmdAbortUnarchiveRepo) (ulid.I, error)
- func (r *Registry) AbortUnfreezeRepo(id uuid.I, vid ulid.I, cmd *CmdAbortUnfreezeRepo) (ulid.I, error)
- func (r *Registry) BeginArchiveRepo(id uuid.I, vid ulid.I, cmd *CmdBeginArchiveRepo) (ulid.I, error)
- func (r *Registry) BeginFreezeRepo(id uuid.I, vid ulid.I, cmd *CmdBeginFreezeRepo) (ulid.I, error)
- func (r *Registry) BeginMoveRepo(id uuid.I, vid ulid.I, cmd *CmdBeginMoveRepo) (ulid.I, error)
- func (r *Registry) BeginUnarchiveRepo(id uuid.I, vid ulid.I, cmd *CmdBeginUnarchiveRepo) (ulid.I, error)
- func (r *Registry) BeginUnfreezeRepo(id uuid.I, vid ulid.I, cmd *CmdBeginUnfreezeRepo) (ulid.I, error)
- func (r *Registry) CommitArchiveRepo(id uuid.I, vid ulid.I, cmd *CmdCommitArchiveRepo) (ulid.I, error)
- func (r *Registry) CommitFreezeRepo(id uuid.I, vid ulid.I, cmd *CmdCommitFreezeRepo) (ulid.I, error)
- func (r *Registry) CommitMoveRepo(id uuid.I, vid ulid.I, cmd *CmdCommitMoveRepo) (ulid.I, error)
- func (r *Registry) CommitUnarchiveRepo(id uuid.I, vid ulid.I, cmd *CmdCommitUnarchiveRepo) (ulid.I, error)
- func (r *Registry) CommitUnfreezeRepo(id uuid.I, vid ulid.I, cmd *CmdCommitUnfreezeRepo) (ulid.I, error)
- func (r *Registry) ConfirmRepo(id uuid.I, vid ulid.I, repoId uuid.I, repoEventId ulid.I) (ulid.I, error)
- func (r *Registry) CreateSplitRootConfig(id uuid.I, vid ulid.I, root string, cfg *SplitRootConfig) (*State, error)
- func (r *Registry) DeleteRootArchiveRecipients(id uuid.I, vid ulid.I, globalRoot string) (ulid.I, error)
- func (r *Registry) DeleteRootShadowBackupRecipients(id uuid.I, vid ulid.I, globalRoot string) (ulid.I, error)
- func (r *Registry) DeleteSplitRootConfig(id uuid.I, vid ulid.I, root string) (ulid.I, error)
- func (r *Registry) DisableGitlab(id uuid.I, vid ulid.I, root string) (ulid.I, error)
- func (r *Registry) EnableDiscoveryPaths(id uuid.I, vid ulid.I, globalRoot string, paths []DepthPath) (ulid.I, error)
- func (r *Registry) EnableEphemeralWorkflows(id uuid.I, vid ulid.I, ephemeralWorkflowsId uuid.I) (ulid.I, error)
- func (r *Registry) EnableGitlab(id uuid.I, vid ulid.I, cmd *CmdEnableGitlab) (ulid.I, error)
- func (r *Registry) EnableGitlabRepo(id uuid.I, vid ulid.I, repoId uuid.I, gitlabNamespace string) (ulid.I, error)
- func (r *Registry) EnablePropagateRootAcls(id uuid.I, vid ulid.I) (ulid.I, error)
- func (r *Registry) FindId(id uuid.I) (*State, error)
- func (r *Registry) Init(id uuid.I, info *Info) (ulid.I, error)
- func (r *Registry) InitRepo(id uuid.I, vid ulid.I, cmd *CmdInitRepo) (newVid ulid.I, repoId uuid.I, err error)
- func (r *Registry) InitRoot(id uuid.I, vid ulid.I, cmd *CmdInitRoot) (ulid.I, error)
- func (r *Registry) PatchRepoNaming(id uuid.I, vid ulid.I, namingPatch *pb.FsoRepoNaming) (ulid.I, error)
- func (r *Registry) PostShadowRepoMoveStarted(id uuid.I, vid ulid.I, repoId uuid.I, repoEventId ulid.I, workflowId uuid.I) (ulid.I, error)
- func (r *Registry) ReinitRepo(id uuid.I, vid ulid.I, cmd *CmdReinitRepo) (ulid.I, error)
- func (r *Registry) RemoveRoot(id uuid.I, vid ulid.I, root string) (ulid.I, error)
- func (r *Registry) SetPathFlags(id uuid.I, vid ulid.I, path string, flags uint32) (ulid.I, error)
- func (r *Registry) SetRepoInitPolicy(id uuid.I, vid ulid.I, policy *pb.FsoRepoInitPolicy) (ulid.I, error)
- func (r *Registry) SetRepoNaming(id uuid.I, vid ulid.I, naming *pb.FsoRepoNaming) (ulid.I, error)
- func (r *Registry) UnsetPathFlags(id uuid.I, vid ulid.I, path string, flags uint32) (ulid.I, error)
- func (r *Registry) UpdateRootArchiveRecipients(id uuid.I, vid ulid.I, globalRoot string, keys gpg.Fingerprints) (*State, error)
- func (r *Registry) UpdateRootShadowBackupRecipients(id uuid.I, vid ulid.I, globalRoot string, keys gpg.Fingerprints) (*State, error)
- func (r *Registry) UpdateSplitRootConfig(id uuid.I, vid ulid.I, root string, cfg *SplitRootConfig) (*State, error)
- type RepoInfo
- type RootInfo
- type SplitRootConfig
- type State
- func (*State) AggregateState()
- func (s *State) HasRoot(root string) bool
- func (s *State) Id() uuid.I
- func (st *State) MayArchiveRepo(repoId uuid.I) (ok bool, reason string)
- func (st *State) MayFreezeRepo(repoId uuid.I) (ok bool, reason string)
- func (st *State) MayUnarchiveRepo(repoId uuid.I) (ok bool, reason string)
- func (st *State) MayUnfreezeRepo(repoId uuid.I) (ok bool, reason string)
- func (s *State) Name() string
- func (s *State) NumRepos() int
- func (s *State) NumRoots() int
- func (s *State) PathFlagsPrefix(prefix string) map[string]uint32
- func (s *State) RepoAclPolicy(id uuid.I) (*pb.RepoAclPolicy, error)
- func (s *State) RepoById(id uuid.I) (*RepoInfo, bool)
- func (s *State) RepoByPath(path string) (*RepoInfo, bool)
- func (s *State) RepoRoot(id uuid.I) (*RootInfo, error)
- func (s *State) Repos() []*RepoInfo
- func (s *State) ReposPrefix(prefix string) []*RepoInfo
- func (s *State) Root(root string) (*RootInfo, bool)
- func (s *State) Roots() []*RootInfo
- func (s *State) SetVid(vid ulid.I)
- func (s *State) SplitRootConfig(root string) (*SplitRootConfig, bool)
- func (s *State) Vid() ulid.I
- type StorageTierCode
- type WorkflowIdChecker
- type WorkflowIdError
Constants ¶
This section is empty.
Variables ¶
var ErrCannotArchiveRepo = errors.New("cannot archive repo")
var ErrCannotFreezeRepo = errors.New("cannot freeze repo")
var ErrCannotMoveUnconfirmed = errors.New("cannot move unconfirmed repo")
var ErrCannotUnarchiveRepo = errors.New("cannot unarchive repo")
var ErrCannotUnfreezeRepo = errors.New("cannot unfreeze repo")
var ErrCommandUnknown = errors.New("unknown command")
var ErrConflictEphemeralWorkflowsId = errors.New("ephemeral workflows ID conflict")
var ErrConflictGitlabInit = errors.New("GitLab already initialized with conflicting namespace")
var ErrConflictInit = errors.New("init conflict")
var ErrConflictRepoInit = errors.New("repo already initialized at path")
var ErrConflictWorkflow = errors.New("workflow conflict")
var ErrCreatorEmailMissing = errors.New("missing creator email")
var ErrCreatorNameMissing = errors.New("missing creator name")
var ErrDuplicateGPGKeys = errors.New("duplicate GPG keys")
var ErrGitlabNamespaceMissingSlash = errors.New("Gitlab namespace missing slash")
var ErrInvalidSplitRootConfig = errors.New("invalid split root config")
var ErrMalformedEphemeralWorkflowsId = errors.New("malformed ephemeral workflows ID")
var ErrMalformedPath = errors.New("malformed path")
var ErrMalformedWorkflowId = errors.New("malformed workflow ID")
var ErrMismatchGlobalPath = errors.New("global path mismatch")
var ErrNamingRuleMismatch = errors.New("naming rule mismatch")
var ErrNoGPGKeys = errors.New("no GPG keys")
var ErrNoSplitRootConfig = errors.New("no split root config")
var ErrNotInitialized = errors.New("repo is not initialized")
var ErrParentRepoImmutable = errors.New("parent repo immutable")
var ErrPathChanged = errors.New("changed path")
var ErrPathDepthOutOfRange = errors.New("path depth out of range")
var ErrPathNotStrictlyBelow = errors.New("path not strictly below root")
var ErrPathUnchanged = errors.New("unchanged path")
var ErrReasonAlreadyApplied = errors.New("reason already applied")
var ErrReasonEmpty = errors.New("empty reason")
var ErrRepeatedPost = errors.New("repeated post")
var ErrRootWithoutInitPolicy = errors.New("root has no repo init policy")
var ErrRootWithoutRepoNaming = errors.New("root has no repo naming")
var ErrSplitRootConfigExists = errors.New("split root config already exists")
var ErrUninitialized = errors.New("uninitialized registry")
var ErrUnknownRepo = errors.New("unknown repo")
var ErrUnknownRoot = errors.New("unknown root")
var ErrWorkflowReuse = errors.New("workflow ID must not be reused")
var ErrWorkflowTerminated = errors.New("workflow has terminated")
var NoVC = events.NoVC
var RetryNoVC = events.RetryNoVC
Functions ¶
func WhichSubdirTracking ¶
func WhichSubdirTracking( pol *pb.FsoRepoInitPolicy, globalPath string, ) (pb.SubdirTracking, error)
Types ¶
type Advancer ¶
type Advancer struct {
// contains filtered or unexported fields
}
The `Advancer` maintains flags to indicate which sub-state has been touched. Each sub-state is cloned only once by each advancer in order to avoid unnecessary intermediate copies when processing a sequence of events. Loading from an event history is fast.
But adding repos one-by-one still takes O(n^2) time, because the repos map is duplicated during each insert. O(n^2) seems acceptable up to 10k repos. It may even be acceptable for a larger number, assuming that adding repos is rare and related operations are expensive, like creating the repo clones at various places.
If we wanted to optimize, we could switch to a map implementation that uses structural sharing, like <https://github.com/mediocregopher/seq>. Or we could use an ad hoc approach that stores new repos into a smaller map or list first and rebuilds the full map only every k inserts.
type Behavior ¶
type Behavior struct {
// contains filtered or unexported fields
}
func (*Behavior) NewAdvancer ¶
type CmdAbortArchiveRepo ¶
func (*CmdAbortArchiveRepo) AggregateCommand ¶
func (*CmdAbortArchiveRepo) AggregateCommand()
type CmdAbortFreezeRepo ¶
func (*CmdAbortFreezeRepo) AggregateCommand ¶
func (*CmdAbortFreezeRepo) AggregateCommand()
type CmdAbortUnarchiveRepo ¶
func (*CmdAbortUnarchiveRepo) AggregateCommand ¶
func (*CmdAbortUnarchiveRepo) AggregateCommand()
type CmdAbortUnfreezeRepo ¶
func (*CmdAbortUnfreezeRepo) AggregateCommand ¶
func (*CmdAbortUnfreezeRepo) AggregateCommand()
type CmdBeginArchiveRepo ¶
func (*CmdBeginArchiveRepo) AggregateCommand ¶
func (*CmdBeginArchiveRepo) AggregateCommand()
type CmdBeginFreezeRepo ¶
func (*CmdBeginFreezeRepo) AggregateCommand ¶
func (*CmdBeginFreezeRepo) AggregateCommand()
type CmdBeginMoveRepo ¶
type CmdBeginMoveRepo struct { RepoId uuid.I WorkflowId uuid.I NewGlobalPath string IsUnchangedGlobalPath bool }
func (*CmdBeginMoveRepo) AggregateCommand ¶
func (*CmdBeginMoveRepo) AggregateCommand()
type CmdBeginUnarchiveRepo ¶
func (*CmdBeginUnarchiveRepo) AggregateCommand ¶
func (*CmdBeginUnarchiveRepo) AggregateCommand()
type CmdBeginUnfreezeRepo ¶
func (*CmdBeginUnfreezeRepo) AggregateCommand ¶
func (*CmdBeginUnfreezeRepo) AggregateCommand()
type CmdCommitArchiveRepo ¶
func (*CmdCommitArchiveRepo) AggregateCommand ¶
func (*CmdCommitArchiveRepo) AggregateCommand()
type CmdCommitFreezeRepo ¶
func (*CmdCommitFreezeRepo) AggregateCommand ¶
func (*CmdCommitFreezeRepo) AggregateCommand()
type CmdCommitMoveRepo ¶
type CmdCommitMoveRepo struct { RepoId uuid.I WorkflowId uuid.I RepoEventId ulid.I GlobalPath string }
func (*CmdCommitMoveRepo) AggregateCommand ¶
func (*CmdCommitMoveRepo) AggregateCommand()
type CmdCommitUnarchiveRepo ¶
func (*CmdCommitUnarchiveRepo) AggregateCommand ¶
func (*CmdCommitUnarchiveRepo) AggregateCommand()
type CmdCommitUnfreezeRepo ¶
func (*CmdCommitUnfreezeRepo) AggregateCommand ¶
func (*CmdCommitUnfreezeRepo) AggregateCommand()
type CmdConfirmRepo ¶
func (*CmdConfirmRepo) AggregateCommand ¶
func (*CmdConfirmRepo) AggregateCommand()
type CmdCreateSplitRootConfig ¶
type CmdCreateSplitRootConfig struct { GlobalRoot string Config *SplitRootConfig }
func (*CmdCreateSplitRootConfig) AggregateCommand ¶
func (*CmdCreateSplitRootConfig) AggregateCommand()
type CmdDeleteRootArchiveRecipients ¶
type CmdDeleteRootArchiveRecipients struct {
GlobalRoot string
}
func (*CmdDeleteRootArchiveRecipients) AggregateCommand ¶
func (*CmdDeleteRootArchiveRecipients) AggregateCommand()
type CmdDeleteRootShadowBackupRecipients ¶
type CmdDeleteRootShadowBackupRecipients struct {
GlobalRoot string
}
func (*CmdDeleteRootShadowBackupRecipients) AggregateCommand ¶
func (*CmdDeleteRootShadowBackupRecipients) AggregateCommand()
type CmdDeleteSplitRootConfig ¶
type CmdDeleteSplitRootConfig struct {
GlobalRoot string
}
func (*CmdDeleteSplitRootConfig) AggregateCommand ¶
func (*CmdDeleteSplitRootConfig) AggregateCommand()
type CmdDisableGitlab ¶
type CmdDisableGitlab struct {
GlobalRoot string
}
func (*CmdDisableGitlab) AggregateCommand ¶
func (*CmdDisableGitlab) AggregateCommand()
type CmdEnableDiscoveryPaths ¶
func (*CmdEnableDiscoveryPaths) AggregateCommand ¶
func (*CmdEnableDiscoveryPaths) AggregateCommand()
type CmdEnableEphemeralWorkflows ¶
func (*CmdEnableEphemeralWorkflows) AggregateCommand ¶
func (*CmdEnableEphemeralWorkflows) AggregateCommand()
type CmdEnableGitlab ¶
func (*CmdEnableGitlab) AggregateCommand ¶
func (*CmdEnableGitlab) AggregateCommand()
type CmdEnableGitlabRepo ¶
func (*CmdEnableGitlabRepo) AggregateCommand ¶
func (*CmdEnableGitlabRepo) AggregateCommand()
type CmdEnablePropagateRootAcls ¶
type CmdEnablePropagateRootAcls struct{}
func (*CmdEnablePropagateRootAcls) AggregateCommand ¶
func (*CmdEnablePropagateRootAcls) AggregateCommand()
type CmdInitRegistry ¶
type CmdInitRegistry struct {
Name string
}
func (*CmdInitRegistry) AggregateCommand ¶
func (*CmdInitRegistry) AggregateCommand()
type CmdInitRepo ¶
type CmdInitRepo struct { // `Context` is used when calling `IsInitRepoAllowed()`. If // `IsInitRepoAllowed()` uses outgoing GRPC calls that require // authorization, `Context` must have the required metadata attached // with `NewOutgoingContext()`. Context context.Context Id uuid.I GlobalPath string CreatorName string CreatorEmail string }
func (*CmdInitRepo) AggregateCommand ¶
func (*CmdInitRepo) AggregateCommand()
type CmdInitRoot ¶
func (*CmdInitRoot) AggregateCommand ¶
func (*CmdInitRoot) AggregateCommand()
type CmdPatchRepoNaming ¶
type CmdPatchRepoNaming struct {
NamingPatch *pb.FsoRepoNaming
}
func (*CmdPatchRepoNaming) AggregateCommand ¶
func (*CmdPatchRepoNaming) AggregateCommand()
type CmdPostShadowRepoMoveStarted ¶
func (*CmdPostShadowRepoMoveStarted) AggregateCommand ¶
func (*CmdPostShadowRepoMoveStarted) AggregateCommand()
type CmdReinitRepo ¶
func (*CmdReinitRepo) AggregateCommand ¶
func (*CmdReinitRepo) AggregateCommand()
type CmdRemoveRoot ¶
type CmdRemoveRoot struct {
GlobalRoot string
}
func (*CmdRemoveRoot) AggregateCommand ¶
func (*CmdRemoveRoot) AggregateCommand()
type CmdSetPathFlags ¶
func (*CmdSetPathFlags) AggregateCommand ¶
func (*CmdSetPathFlags) AggregateCommand()
type CmdSetRepoInitPolicy ¶
type CmdSetRepoInitPolicy struct {
Policy *pb.FsoRepoInitPolicy
}
func (*CmdSetRepoInitPolicy) AggregateCommand ¶
func (*CmdSetRepoInitPolicy) AggregateCommand()
type CmdSetRepoNaming ¶
type CmdSetRepoNaming struct {
Naming *pb.FsoRepoNaming
}
func (*CmdSetRepoNaming) AggregateCommand ¶
func (*CmdSetRepoNaming) AggregateCommand()
type CmdUnsetPathFlags ¶
func (*CmdUnsetPathFlags) AggregateCommand ¶
func (*CmdUnsetPathFlags) AggregateCommand()
type CmdUpdateRootArchiveRecipients ¶
type CmdUpdateRootArchiveRecipients struct { GlobalRoot string Keys gpg.Fingerprints }
func (*CmdUpdateRootArchiveRecipients) AggregateCommand ¶
func (*CmdUpdateRootArchiveRecipients) AggregateCommand()
type CmdUpdateRootShadowBackupRecipients ¶
type CmdUpdateRootShadowBackupRecipients struct { GlobalRoot string Keys gpg.Fingerprints }
func (*CmdUpdateRootShadowBackupRecipients) AggregateCommand ¶
func (*CmdUpdateRootShadowBackupRecipients) AggregateCommand()
type CmdUpdateSplitRootConfig ¶
type CmdUpdateSplitRootConfig struct { GlobalRoot string Config *SplitRootConfig }
func (*CmdUpdateSplitRootConfig) AggregateCommand ¶
func (*CmdUpdateSplitRootConfig) AggregateCommand()
type EnablePathRuleError ¶
type EnablePathRuleError struct {
Rule string
}
func (*EnablePathRuleError) Error ¶
func (err *EnablePathRuleError) Error() string
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) MarshalProto ¶
func (*Event) PbRegistryEvent ¶
func (e *Event) PbRegistryEvent() *pb.RegistryEvent
func (*Event) UnmarshalProto ¶
type EventDetailsError ¶
type EventDetailsError struct {
Err error
}
func (*EventDetailsError) Error ¶
func (err *EventDetailsError) Error() string
type InitRepoAllower ¶
type InitRepoAllower interface { // `IsInitRepoAllowed()` returns `deny="", err=nil` if the operation is // allowed to proceed. Otherwise, it returns a `deny` reason that // explains why the operation cannot proceed, or an error if the check // could not be performed due to a network error, for example. // // If the implementation uses outgoing GRPC calls that require // authorization, `ctx` must have the required metadata attached with // `NewOutgoingContext()`. IsInitRepoAllowed( ctx context.Context, repo, host, hostPath string, subdirTracking pb.SubdirTracking, ) (deny string, err error) }
type InitRepoDenyError ¶
type InitRepoDenyError struct {
Reason string
}
func (*InitRepoDenyError) Error ¶
func (err *InitRepoDenyError) Error() string
type InternalError ¶
func (*InternalError) Error ¶
func (err *InternalError) Error() string
type Preconditions ¶
type Preconditions struct { InitRepo InitRepoAllower WorkflowIdCheck WorkflowIdChecker }
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) AbortArchiveRepo ¶
func (*Registry) AbortFreezeRepo ¶
func (*Registry) AbortUnarchiveRepo ¶
func (*Registry) AbortUnfreezeRepo ¶
func (*Registry) BeginArchiveRepo ¶
func (*Registry) BeginFreezeRepo ¶
func (*Registry) BeginMoveRepo ¶
func (*Registry) BeginUnarchiveRepo ¶
func (*Registry) BeginUnfreezeRepo ¶
func (*Registry) CommitArchiveRepo ¶
func (*Registry) CommitFreezeRepo ¶
func (*Registry) CommitMoveRepo ¶
func (*Registry) CommitUnarchiveRepo ¶
func (*Registry) CommitUnfreezeRepo ¶
func (*Registry) ConfirmRepo ¶
func (*Registry) CreateSplitRootConfig ¶
func (*Registry) DeleteRootArchiveRecipients ¶
func (r *Registry) DeleteRootArchiveRecipients( id uuid.I, vid ulid.I, globalRoot string, ) (ulid.I, error)
`DeleteRootArchiveRecipients()` disables archive encryption.
func (*Registry) DeleteRootShadowBackupRecipients ¶
func (r *Registry) DeleteRootShadowBackupRecipients( id uuid.I, vid ulid.I, globalRoot string, ) (ulid.I, error)
`DeleteRootShadowBackupRecipients()` disables archive encryption.
func (*Registry) DeleteSplitRootConfig ¶
func (*Registry) DisableGitlab ¶
func (*Registry) EnableDiscoveryPaths ¶
func (*Registry) EnableEphemeralWorkflows ¶
func (*Registry) EnableGitlab ¶
func (*Registry) EnableGitlabRepo ¶
func (*Registry) EnablePropagateRootAcls ¶
func (*Registry) PatchRepoNaming ¶
func (*Registry) PostShadowRepoMoveStarted ¶
func (r *Registry) PostShadowRepoMoveStarted( id uuid.I, vid ulid.I, repoId uuid.I, repoEventId ulid.I, workflowId uuid.I, ) (ulid.I, error)
`PostShadowRepoMoveStarted()` is called by Nogfsoregd in `replicated.go` to duplicate `EV_FSO_SHADOW_REPO_MOVE_STARTED` repo events to the registry, so that Nogfsostad learns about them by watching the registry.
func (*Registry) ReinitRepo ¶
func (*Registry) RemoveRoot ¶
func (*Registry) SetPathFlags ¶
func (*Registry) SetRepoInitPolicy ¶
func (*Registry) SetRepoNaming ¶
func (*Registry) UnsetPathFlags ¶
func (*Registry) UpdateRootArchiveRecipients ¶
func (r *Registry) UpdateRootArchiveRecipients( id uuid.I, vid ulid.I, globalRoot string, keys gpg.Fingerprints, ) (*State, error)
`UpdateRootArchiveRecipients()` sets the archive GPG keys, enabling encryption.
type RepoInfo ¶
type RepoInfo struct { Id uuid.I GlobalPath string GitlabNamespace string Confirmed bool ReinitReason string StorageTier StorageTierCode // contains filtered or unexported fields }
`Creator*` is stored in the event, but not in the aggregate state, because it is only of temporary interest.
type RootInfo ¶
type RootInfo struct { GlobalRoot string Host string HostRoot string GitlabNamespace string ArchiveRecipients gpg.Fingerprints ShadowBackupRecipients gpg.Fingerprints }
type SplitRootConfig ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) AggregateState ¶
func (*State) AggregateState()
func (*State) MayArchiveRepo ¶
`MayArchiveRepo()` is used in `BeginArchiveRepo()` to check preconditions before initializing an archive-repo workflow.
func (*State) MayFreezeRepo ¶
`MayFreezeRepo()` is used in `BeginFreezeRepo()` to check preconditions before initializing a freeze-repo workflow.
func (*State) MayUnarchiveRepo ¶
`MayUnarchiveRepo()` is used in `BeginUnarchiveRepo()` to check preconditions before initializing an archive-repo workflow.
func (*State) MayUnfreezeRepo ¶
`MayUnfreezeRepo()` is used in `BeginUnfreezeRepo()` to check preconditions before initializing a freeze-repo workflow.
func (*State) RepoAclPolicy ¶
func (*State) ReposPrefix ¶
`ReposPrefix(prefix)` returns repos whose global path is equal or below `prefix`. `prefix` must not have a trailing slash.
func (*State) SplitRootConfig ¶
func (s *State) SplitRootConfig(root string) (*SplitRootConfig, bool)
type StorageTierCode ¶
type StorageTierCode int
XXX Maybe factor out into a common package, e.g. `storagetier`, that is used by packages `fsoregistry` and `fsorepos`.
const ( StorageTierUnspecified StorageTierCode = iota StorageOnline StorageFrozen StorageArchived StorageFreezing StorageFreezeFailed StorageUnfreezing StorageUnfreezeFailed StorageArchiving StorageArchiveFailed StorageUnarchiving StorageUnarchiveFailed )
type WorkflowIdChecker ¶
type WorkflowIdError ¶
type WorkflowIdError struct {
Reason string
}
func (*WorkflowIdError) Error ¶
func (err *WorkflowIdError) Error() string