Documentation
¶
Index ¶
- Constants
- func ExitCode(err error) int
- type CloneEvidence
- type CloneResult
- type Command
- type DoctorResult
- type Envelope
- type Error
- type ErrorCode
- type FindingProjection
- type ListResult
- type Request
- type ResolvedSelector
- type RestoreResult
- type SavePoint
- type SaveResult
- type Selector
- type Service
- func (s *Service) Clone(ctx context.Context, request Request) (any, error)
- func (s *Service) Doctor(ctx context.Context, request Request) (DoctorResult, error)
- func (s *Service) List(ctx context.Context, request Request) (ListResult, error)
- func (s *Service) Restore(ctx context.Context, request Request) (any, error)
- func (s *Service) Save(ctx context.Context, request Request) (any, error)
- func (s *Service) Status(ctx context.Context, request Request) (StatusResult, error)
- type Status
- type StatusResult
Constants ¶
View Source
const ( ExitSuccess = 0 ExitInternal = 1 ExitInvalidArgument = 2 ExitMetadata = 3 ExitLocked = 4 ExitStorage = 5 )
View Source
const ContractVersion = "jvs.afscp.direct.v1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloneEvidence ¶
type CloneResult ¶
type CloneResult struct {
SourceRepoID string `json:"source_repo_id"`
TargetRepoID string `json:"target_repo_id"`
SavePointID string `json:"save_point_id"`
SavePointsCopiedCount int `json:"save_points_copied_count"`
CloneEvidence []CloneEvidence `json:"clone_evidence,omitempty"`
}
type DoctorResult ¶
type Envelope ¶
type Envelope struct {
Contract string `json:"contract"`
Command Command `json:"command"`
OK bool `json:"ok"`
Status Status `json:"status"`
Data any `json:"data"`
Error *Error `json:"error"`
}
func ErrorEnvelope ¶
func SuccessEnvelope ¶
type Error ¶
type ErrorCode ¶
type ErrorCode string
const ( ErrorCodeInvalidArgument ErrorCode = "JVS_INVALID_ARGUMENT" ErrorCodeLocked ErrorCode = "JVS_LOCKED" ErrorCodeMetadataInvalid ErrorCode = "JVS_METADATA_INVALID" ErrorCodeSavePointNotFound ErrorCode = "JVS_SAVE_POINT_NOT_FOUND" ErrorCodeCloneFailed ErrorCode = "JVS_CLONE_FAILED" ErrorCodeJournalRecoveryRequired ErrorCode = "JVS_JOURNAL_RECOVERY_REQUIRED" ErrorCodeInternal ErrorCode = "JVS_INTERNAL" )
type FindingProjection ¶
type ListResult ¶
type ResolvedSelector ¶
func ValidateMetadataSelector ¶
func ValidateMetadataSelector(selector Selector) (ResolvedSelector, error)
func ValidateNewTargetSelector ¶
func ValidateNewTargetSelector(source ResolvedSelector, selector Selector) (ResolvedSelector, error)
func ValidateSelector ¶
func ValidateSelector(selector Selector) (ResolvedSelector, error)
type RestoreResult ¶
type RestoreResult struct {
RestoredSavePointID string `json:"restored_save_point_id"`
PreviousHead *string `json:"previous_head"`
NewHead string `json:"new_head"`
CloneEvidence []CloneEvidence `json:"clone_evidence,omitempty"`
}
type SaveResult ¶
type Service ¶
type Service struct{}
func NewService ¶
func NewService() *Service
Click to show internal directories.
Click to hide internal directories.