pbevents

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateGPGFingerprint = errors.New("duplicate GPG key fingerprints")
View Source
var ErrIgnoreHasWrongType = errors.New("`ignore` value has wrong type")
View Source
var ErrIgnoreListEmpty = errors.New("`ignore` list is empty")
View Source
var ErrInvalidEvent = errors.New("invalid event")
View Source
var ErrLevelNotInteger = errors.New("`level` is not an integer")
View Source
var ErrLevelOutOfRange = errors.New("`level` out of range")
View Source
var ErrLevelWrongType = errors.New("`level` has wrong type")
View Source
var ErrMalformedGPGFingerprint = errors.New("malformed GPG key fingerprint")
View Source
var ErrMalformedRepoNamingEmptyGlobalRoot = errors.New("malformed repo naming: empty global root")
View Source
var ErrMalformedRepoNamingNil = errors.New("nil repo naming not allowed")
View Source
var ErrMalformedRepoNamingRule = errors.New("unknown repo naming rule")
View Source
var ErrMalformedRootInfo = errors.New("malformed root info")
View Source
var ErrMissingGloblist = errors.New("missing globlist")
View Source
var ErrMissingLevel = errors.New("missing `level`")
View Source
var ErrMissingPatterns = errors.New("missing `patterns`")
View Source
var ErrMissingRootInfo = errors.New("missing root info")
View Source
var ErrNamingConfigNil = errors.New("naming config is nil")
View Source
var ErrPatternsWrongType = errors.New("`patterns` has wrong type")
View Source
var ErrPolicyNil = errors.New("invalid nil policy")
View Source
var ErrUnexpectedConfigField = errors.New("unexpected config fields")
View Source
var ErrUnknownEventType = errors.New("unknown event type")
View Source
var ErrUnknownRepoNamingPolicy = errors.New("unknown repo naming policy")

Functions

func NewArchiveRepoCompletedError

func NewArchiveRepoCompletedError(
	repoId uuid.I, workflowId uuid.I, code int32,
) pb.RegistryEvent

func NewArchiveRepoCompletedOk

func NewArchiveRepoCompletedOk(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewArchiveRepoStarted

func NewArchiveRepoStarted(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewEphemeralWorkflowsEnabled

func NewEphemeralWorkflowsEnabled(
	ephemeralWorkflowsId uuid.I,
) pb.RegistryEvent

func NewFreezeRepoCompleted2Error

func NewFreezeRepoCompleted2Error(
	repoId uuid.I, workflowId uuid.I, code int32,
) pb.RegistryEvent

func NewFreezeRepoCompleted2Ok

func NewFreezeRepoCompleted2Ok(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewFreezeRepoStarted2

func NewFreezeRepoStarted2(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewPathFlagSet

func NewPathFlagSet(
	path string,
	flags uint32,
) pb.RegistryEvent

func NewPathFlagUnset

func NewPathFlagUnset(
	path string,
	flags uint32,
) pb.RegistryEvent

func NewPbRepoMoveAccepted

func NewPbRepoMoveAccepted(ev *EvRepoMoveAccepted) pb.RegistryEvent

func NewPbRepoMoved

func NewPbRepoMoved(ev *EvRepoMoved) pb.RegistryEvent

func NewRegistryAdded

func NewRegistryAdded(name string) pb.RegistryEvent

func NewRepoAccepted

func NewRepoAccepted(inf *pb.FsoRepoInfo) pb.RegistryEvent

func NewRepoAclPolicyUpdated

func NewRepoAclPolicyUpdated(
	policy pb.RepoAclPolicy_Policy,
) pb.RegistryEvent

func NewRepoAdded

func NewRepoAdded(
	repoId []byte, globalPath string, repoEventId ulid.I,
) pb.RegistryEvent

func NewRepoEnableGitlabAccepted

func NewRepoEnableGitlabAccepted(
	repoId uuid.I, gitlabNamespace string,
) pb.RegistryEvent

func NewRepoInitPolicyUpdated

func NewRepoInitPolicyUpdated(p *pb.FsoRepoInitPolicy) pb.RegistryEvent

func NewRepoNamingConfigUpdated

func NewRepoNamingConfigUpdated(patch *pb.FsoRepoNaming) pb.RegistryEvent

func NewRepoNamingUpdated

func NewRepoNamingUpdated(n *pb.FsoRepoNaming) pb.RegistryEvent

func NewRepoReinitAccepted

func NewRepoReinitAccepted(
	repoId []byte, globalPath, reason string,
) pb.RegistryEvent

func NewRootAdded

func NewRootAdded(inf *pb.FsoRootInfo) pb.RegistryEvent

func NewRootArchiveRecipientsUpdated

func NewRootArchiveRecipientsUpdated(
	root string, keys [][]byte,
) pb.RegistryEvent

func NewRootRemoved

func NewRootRemoved(root string) pb.RegistryEvent

func NewRootShadowBackupRecipientsUpdated

func NewRootShadowBackupRecipientsUpdated(
	root string, keys [][]byte,
) pb.RegistryEvent

func NewRootUpdated

func NewRootUpdated(inf *pb.FsoRootInfo) pb.RegistryEvent

func NewShadowRepoMoveStarted

func NewShadowRepoMoveStarted(
	repoId uuid.I, repoEventId ulid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewSplitRootDisabled

func NewSplitRootDisabled(
	root string,
) pb.RegistryEvent

func NewSplitRootEnabled

func NewSplitRootEnabled(
	root string,
) pb.RegistryEvent

func NewSplitRootParamsUpdated

func NewSplitRootParamsUpdated(
	root string,
	cfg *pb.FsoSplitRootParams,
) pb.RegistryEvent

func NewUnarchiveRepoCompletedError

func NewUnarchiveRepoCompletedError(
	repoId uuid.I, workflowId uuid.I, code int32,
) pb.RegistryEvent

func NewUnarchiveRepoCompletedOk

func NewUnarchiveRepoCompletedOk(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewUnarchiveRepoStarted

func NewUnarchiveRepoStarted(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewUnfreezeRepoCompleted2Error

func NewUnfreezeRepoCompleted2Error(
	repoId uuid.I, workflowId uuid.I, code int32,
) pb.RegistryEvent

func NewUnfreezeRepoCompleted2Ok

func NewUnfreezeRepoCompleted2Ok(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func NewUnfreezeRepoStarted2

func NewUnfreezeRepoStarted2(
	repoId uuid.I, workflowId uuid.I,
) pb.RegistryEvent

func ValidateRepoInitPolicy

func ValidateRepoInitPolicy(policy *pb.FsoRepoInitPolicy) error

func ValidateRepoNaming

func ValidateRepoNaming(naming *pb.FsoRepoNaming) error

func ValidateRepoNamingPatch

func ValidateRepoNamingPatch(naming *pb.FsoRepoNaming) error

Types

type ConfigMapFieldError

type ConfigMapFieldError struct {
	Field  string
	Reason string
}

func (*ConfigMapFieldError) Error

func (err *ConfigMapFieldError) Error() string

type DepthPathInvalidError

type DepthPathInvalidError struct {
	Path   string
	Reason string
	Err    error
}

func (*DepthPathInvalidError) Error

func (err *DepthPathInvalidError) Error() string

type EvArchiveRepoCompleted

type EvArchiveRepoCompleted struct {
	RepoId     uuid.I
	WorkflowId uuid.I
	StatusCode int32
}

`RegistryEvent_EV_FSO_ARCHIVE_REPO_COMPLETED` aka `EvArchiveRepoCompleted`. See freeze-repo workflow aka freezerepowf.

func (EvArchiveRepoCompleted) RegistryEvent

func (EvArchiveRepoCompleted) RegistryEvent()

type EvArchiveRepoStarted

type EvArchiveRepoStarted struct {
	RepoId     uuid.I
	WorkflowId uuid.I
}

`RegistryEvent_EV_FSO_ARCHIVE_REPO_STARTED` aka `EvArchiveRepoStarted`. See freeze-repo workflow aka freezerepowf.

func (EvArchiveRepoStarted) RegistryEvent

func (EvArchiveRepoStarted) RegistryEvent()

type EvEphemeralWorkflowsEnabled

type EvEphemeralWorkflowsEnabled struct {
	EphemeralWorkflowsId uuid.I
}

`RegistryEvent_EV_EPHEMERAL_WORKFLOWS_ENABLED` aka EvEphemeralWorkflowsEnabled`.

func (EvEphemeralWorkflowsEnabled) RegistryEvent

func (EvEphemeralWorkflowsEnabled) RegistryEvent()

type EvFreezeRepoCompleted2

type EvFreezeRepoCompleted2 struct {
	RepoId     uuid.I
	WorkflowId uuid.I
	StatusCode int32
}

`RegistryEvent_EV_FSO_FREEZE_REPO_COMPLETED_2` aka `EvFreezeRepoCompleted2`. See freeze-repo workflow aka freezerepowf.

func (EvFreezeRepoCompleted2) RegistryEvent

func (EvFreezeRepoCompleted2) RegistryEvent()

type EvFreezeRepoStarted2

type EvFreezeRepoStarted2 struct {
	RepoId     uuid.I
	WorkflowId uuid.I
}

`RegistryEvent_EV_FSO_FREEZE_REPO_STARTED_2` aka `EvFreezeRepoStarted2`. See freeze-repo workflow aka freezerepowf.

func (EvFreezeRepoStarted2) RegistryEvent

func (EvFreezeRepoStarted2) RegistryEvent()

type EvPathFlagSet

type EvPathFlagSet struct {
	Path  string
	Flags uint32
}

`RegistryEvent_EV_FSO_PATH_FLAG_SET` aka `EvPathFlagSet`.

func (EvPathFlagSet) RegistryEvent

func (EvPathFlagSet) RegistryEvent()

type EvPathFlagUnset

type EvPathFlagUnset struct {
	Path  string
	Flags uint32
}

`RegistryEvent_EV_FSO_PATH_FLAG_UNSET` aka `EvPathFlagUnset`.

func (EvPathFlagUnset) RegistryEvent

func (EvPathFlagUnset) RegistryEvent()

type EvRegistryAdded

type EvRegistryAdded struct {
	pb.FsoRegistryInfo
}

`RegistryEvent_EV_FSO_REGISTRY_ADDED` aka `EvRegistryAdded`.

func (EvRegistryAdded) RegistryEvent

func (EvRegistryAdded) RegistryEvent()

type EvRepoAccepted

type EvRepoAccepted struct {
	pb.FsoRepoInfo
}

`RegistryEvent_EV_FSO_REPO_ACCEPTED` aka `EvRepoAccepted`.

func (EvRepoAccepted) RegistryEvent

func (EvRepoAccepted) RegistryEvent()

type EvRepoAclPolicyUpdated

type EvRepoAclPolicyUpdated struct {
	Policy pb.RepoAclPolicy_Policy
}

`EV_FSO_REPO_ACL_POLICY_UPDATED` aka `EvRepoPolicyUpdated` sets the policy that is used to control ACLs on repo real files.

func (EvRepoAclPolicyUpdated) RegistryEvent

func (EvRepoAclPolicyUpdated) RegistryEvent()

type EvRepoAdded

type EvRepoAdded struct {
	pb.FsoRepoInfo
}

`RegistryEvent_EV_FSO_REPO_ADDED` aka `EvRepoAdded`.

func (EvRepoAdded) RegistryEvent

func (EvRepoAdded) RegistryEvent()

type EvRepoEnableGitlabAccepted

type EvRepoEnableGitlabAccepted struct {
	RepoId          uuid.I
	GitlabNamespace string
}

`RegistryEvent_EV_FSO_REPO_ENABLE_GITLAB_ACCEPTED` aka `EvRepoEnableGitlabAccepted`.

func (EvRepoEnableGitlabAccepted) RegistryEvent

func (EvRepoEnableGitlabAccepted) RegistryEvent()

type EvRepoInitPolicyUpdated

type EvRepoInitPolicyUpdated struct {
	pb.FsoRepoInitPolicy
}

`EV_FSO_REPO_INIT_POLICY_UPDATED` aka `EvRepoInitPolicyUpdated` sets the policy that is used to determine repo initialization options.

Fields:

  • `fso_repo_init_policy.global_root`, `GlobalRoot`: The global path of the root.
  • `fso_repo_init_policy.policy`, `Policy`: The policy type.

If policy type `IPOL_SUBDIR_TRACKING_GLOBLIST`:

  • `fso_repo_init_policy.subdir_tracking_globlist`, `SubdirTrackingGloblist`: lists pairs of glob patterns and `SubdirTracking`. The first matching glob decides the `SubdirTracking`.

See `ValidateRepoInitPolicy()` for details.

func (EvRepoInitPolicyUpdated) RegistryEvent

func (EvRepoInitPolicyUpdated) RegistryEvent()

type EvRepoMoveAccepted

type EvRepoMoveAccepted struct {
	RepoId        uuid.I
	WorkflowId    uuid.I
	NewGlobalPath string
}

`RegistryEvent_EV_FSO_REPO_MOVE_ACCEPTED` aka `EvRepoMoveAccepted` starts a move-repo workflow, which changes the real repo and the shadow repo location. See package `moverepowf` for details.

func (EvRepoMoveAccepted) RegistryEvent

func (EvRepoMoveAccepted) RegistryEvent()

type EvRepoMoved

type EvRepoMoved struct {
	RepoId      uuid.I
	RepoEventId ulid.I
	WorkflowId  uuid.I
	GlobalPath  string
}

`RegistryEvent_EV_FSO_REPO_MOVED` aka `EvRepoMoved` is part of the move-repo workflow. See package `moverepowf` for details.

func (EvRepoMoved) RegistryEvent

func (EvRepoMoved) RegistryEvent()

type EvRepoNamingConfigUpdated

type EvRepoNamingConfigUpdated struct {
	GlobalRoot  string
	Rule        string
	ConfigPatch pb.ConfigMap
}

`EV_FSO_REPO_NAMING_CONFIG_UPDATED` aka `EvRepoNamingConfigUpdated` patches a naming configuration that has been previously set with `EV_FSO_REPO_NAMING_UPDATED`.

The meaning of 'patch' depends on the current naming rule. Naming rules should avoid `O(n^2)` event storage. Example: An ingnore list would be incrementally built by repeatedly adding paths. Each path is stored only once. If the entire list was instead stored each time, the total amount of events would require `O(n^2)` storage.

Fields:

  • `fso_repo_naming.global_root`, `GlobalRoot`: The global path of the root for which the naming config is updated.
  • `fso_repo_naming.rule`, `Rule`: The rule name. It must equal the rule that has been previously set with `EV_FSO_REPO_NAMING_UPDATED`.
  • `fso_repo_naming.config`, `ConfigPatch`: The config patch.

See `ValidateRepoNamingPatch()` for valid rule-config combinations.

func (EvRepoNamingConfigUpdated) RegistryEvent

func (EvRepoNamingConfigUpdated) RegistryEvent()

type EvRepoNamingUpdated

type EvRepoNamingUpdated struct {
	pb.FsoRepoNaming
}

`EV_FSO_REPO_NAMING_UPDATED` aka `EvRepoNamingUpdated` sets the naming convention that is used to discover untracked repos below a root.

Fields:

  • `fso_repo_naming.global_root`, `GlobalRoot`: The global path of the root.
  • `fso_repo_naming.rule`, `Rule`: The rule name.
  • `fso_repo_naming.config`, `Config`: A config map that controls rule details. The structure of the config depends on the rule.

See `ValidateRepoNaming()` for available rules and config map structures.

The config can be patched with `EV_FSO_REPO_NAMING_CONFIG_UPDATED`.

func (EvRepoNamingUpdated) RegistryEvent

func (EvRepoNamingUpdated) RegistryEvent()

type EvRepoReinitAccepted

type EvRepoReinitAccepted struct {
	RepoId     []byte
	GlobalPath string
	Reason     string
}

`RegistryEvent_EV_FSO_REPO_REINIT_ACCEPTED` aka `EvRepoReinitAccepted`.

func (EvRepoReinitAccepted) RegistryEvent

func (EvRepoReinitAccepted) RegistryEvent()

type EvRootAdded

type EvRootAdded struct {
	pb.FsoRootInfo
}

`RegistryEvent_EV_FSO_ROOT_ADDED` aka `EvRootAdded`.

func (EvRootAdded) RegistryEvent

func (EvRootAdded) RegistryEvent()

type EvRootArchiveRecipientsUpdated

type EvRootArchiveRecipientsUpdated struct {
	GlobalRoot string
	Keys       [][]byte
}

`EV_FSO_ROOT_ARCHIVE_RECIPIENTS_UPDATED` aka `EvRootArchiveRecipientsUpdated`.

func (EvRootArchiveRecipientsUpdated) RegistryEvent

func (EvRootArchiveRecipientsUpdated) RegistryEvent()

type EvRootRemoved

type EvRootRemoved struct {
	GlobalRoot string
}

`RegistryEvent_EV_FSO_ROOT_REMOVED` aka `EvRootRemoved`.

func (EvRootRemoved) RegistryEvent

func (EvRootRemoved) RegistryEvent()

type EvRootShadowBackupRecipientsUpdated

type EvRootShadowBackupRecipientsUpdated struct {
	GlobalRoot string
	Keys       [][]byte
}

`EV_FSO_ROOT_SHADOW_BACKUP_RECIPIENTS_UPDATED` aka `EvRootShadowBackupRecipientsUpdated`.

func (EvRootShadowBackupRecipientsUpdated) RegistryEvent

func (EvRootShadowBackupRecipientsUpdated) RegistryEvent()

type EvRootUpdated

type EvRootUpdated struct {
	pb.FsoRootInfo
}

`RegistryEvent_EV_FSO_ROOT_UPDATED` aka `EvRootUpdated`.

func (EvRootUpdated) RegistryEvent

func (EvRootUpdated) RegistryEvent()

type EvShadowRepoMoveStarted

type EvShadowRepoMoveStarted struct {
	RepoId      uuid.I
	RepoEventId ulid.I
	WorkflowId  uuid.I
}

`EV_FSO_SHADOW_REPO_MOVE_STARTED` aka `EvShadowRepoMoveStarted` refers to a corresponding repo event.

func (EvShadowRepoMoveStarted) RegistryEvent

func (EvShadowRepoMoveStarted) RegistryEvent()

type EvSplitRootDisabled

type EvSplitRootDisabled struct {
	GlobalRoot string
}

`RegistryEvent_EV_FSO_SPLIT_ROOT_DISABLED` aka `EvSplitRootDisabled`.

func (EvSplitRootDisabled) RegistryEvent

func (EvSplitRootDisabled) RegistryEvent()

type EvSplitRootEnabled

type EvSplitRootEnabled struct {
	GlobalRoot string
}

`RegistryEvent_EV_FSO_SPLIT_ROOT_ENABLED` aka `EvSplitRootEnabled`.

func (EvSplitRootEnabled) RegistryEvent

func (EvSplitRootEnabled) RegistryEvent()

type EvSplitRootParamsUpdated

type EvSplitRootParamsUpdated struct {
	GlobalRoot   string
	MaxDepth     int32
	MinDiskUsage int64
	MaxDiskUsage int64
}

`RegistryEvent_EV_FSO_SPLIT_ROOT_PARAMS_UPDATED` aka `EvSplitRootParamsUpdated`.

func (EvSplitRootParamsUpdated) RegistryEvent

func (EvSplitRootParamsUpdated) RegistryEvent()

type EvUnarchiveRepoCompleted

type EvUnarchiveRepoCompleted struct {
	RepoId     uuid.I
	WorkflowId uuid.I
	StatusCode int32
}

`RegistryEvent_EV_FSO_UNARCHIVE_REPO_COMPLETED` aka `EvUnarchiveRepoCompleted`. See freeze-repo workflow aka freezerepowf.

func (EvUnarchiveRepoCompleted) RegistryEvent

func (EvUnarchiveRepoCompleted) RegistryEvent()

type EvUnarchiveRepoStarted

type EvUnarchiveRepoStarted struct {
	RepoId     uuid.I
	WorkflowId uuid.I
}

`RegistryEvent_EV_FSO_UNARCHIVE_REPO_STARTED` aka `EvUnarchiveRepoStarted`. See freeze-repo workflow aka freezerepowf.

func (EvUnarchiveRepoStarted) RegistryEvent

func (EvUnarchiveRepoStarted) RegistryEvent()

type EvUnfreezeRepoCompleted2

type EvUnfreezeRepoCompleted2 struct {
	RepoId     uuid.I
	WorkflowId uuid.I
	StatusCode int32
}

`RegistryEvent_EV_FSO_UNFREEZE_REPO_COMPLETED_2` aka `EvUnfreezeRepoCompleted2`. See freeze-repo workflow aka freezerepowf.

func (EvUnfreezeRepoCompleted2) RegistryEvent

func (EvUnfreezeRepoCompleted2) RegistryEvent()

type EvUnfreezeRepoStarted2

type EvUnfreezeRepoStarted2 struct {
	RepoId     uuid.I
	WorkflowId uuid.I
}

`RegistryEvent_EV_FSO_UNFREEZE_REPO_STARTED_2` aka `EvUnfreezeRepoStarted2`. See freeze-repo workflow aka freezerepowf.

func (EvUnfreezeRepoStarted2) RegistryEvent

func (EvUnfreezeRepoStarted2) RegistryEvent()

type ParseError

type ParseError struct {
	What string
	Err  error
}

func (*ParseError) Error

func (err *ParseError) Error() string

type PatternInvalidActionError

type PatternInvalidActionError struct {
	Pattern string
}

func (*PatternInvalidActionError) Error

func (err *PatternInvalidActionError) Error() string

type PatternInvalidError

type PatternInvalidError struct {
	Pattern string
}

func (*PatternInvalidError) Error

func (err *PatternInvalidError) Error() string

type PatternInvalidGlobError

type PatternInvalidGlobError struct {
	Pattern string
}

func (*PatternInvalidGlobError) Error

func (err *PatternInvalidGlobError) Error() string

type RegistryEvent

type RegistryEvent interface {
	RegistryEvent()
}

func FromPbMust

func FromPbMust(evpb pb.RegistryEvent) RegistryEvent

func FromPbValidate

func FromPbValidate(evpb pb.RegistryEvent) (ev RegistryEvent, err error)

Jump to

Keyboard shortcuts

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