store_fs

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathOptionDefault = PathOption(iota)
	PathOptionLeft
	PathOptionMiddle
	PathOptionRight
	PathOptionTempLocal // TODO remove
)

Variables

This section is empty.

Functions

func GetCheckedOutPool

func GetCheckedOutPool() interfaces.Pool[sku.CheckedOut, *sku.CheckedOut]

func GetExternalPool

func GetExternalPool() interfaces.Pool[sku.Transacted, *sku.Transacted]

func MakeFileEncoder

func MakeFileEncoder(
	repoLayout env_repo.Env,
	ic ids.InlineTypeChecker,
) *fileEncoder

Types

type CheckedOutMutableSet

type CheckedOutMutableSet = interfaces.MutableSetLike[*sku.CheckedOut]

func MakeCheckedOutMutableSet

func MakeCheckedOutMutableSet() CheckedOutMutableSet

type CheckedOutSet

type CheckedOutSet = interfaces.SetLike[*sku.CheckedOut]

type CheckoutOptions

type CheckoutOptions struct {
	Path            PathOption
	ForceInlineBlob bool
	AllowConflicted bool
	checkout_options.TextFormatterOptions
}

func GetCheckoutOptionsFromOptions

func GetCheckoutOptionsFromOptions(
	options checkout_options.Options,
) CheckoutOptions

func GetCheckoutOptionsFromOptionsWithoutMode

func GetCheckoutOptionsFromOptionsWithoutMode(
	options checkout_options.OptionsWithoutMode,
) (fsOptions CheckoutOptions)

type DeleteCheckout

type DeleteCheckout struct{}

func (DeleteCheckout) Run

func (c DeleteCheckout) Run(
	dryRun bool,
	s env_repo.Env,
	p interfaces.FuncIter[*fd.FD],
	fs interfaces.Collection[*fd.FD],
) (err error)

type FileEncoder

type FileEncoder interface {
	Encode(
		options checkout_options.TextFormatterOptions,
		z *sku.Transacted,
		i *sku.FSItem) (err error)
}

type OpenFiles

type OpenFiles struct{}

func (OpenFiles) Run

func (c OpenFiles) Run(
	ph interfaces.FuncIter[string],
	args ...string,
) (err error)

type PathOption

type PathOption int

func (PathOption) String

func (i PathOption) String() string

type Store

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

func Make

func Make(
	config sku.Config,
	deletedPrinter interfaces.FuncIter[*fd.FD],
	fileExtensions interfaces.FileExtensions,
	envRepo env_repo.Env,
) (fs *Store, err error)

func (*Store) All

func (d *Store) All(
	f interfaces.FuncIter[*sku.FSItem],
) (err error)

TODO switch to seq.Iter2

func (*Store) CheckoutOne

func (s *Store) CheckoutOne(
	options checkout_options.Options,
	sz sku.TransactedGetter,
) (col sku.SkuType, err error)

func (*Store) DeleteCheckedOut

func (s *Store) DeleteCheckedOut(co *sku.CheckedOut) (err error)

Deletions of user objects that should be exposed to the user

func (*Store) DeleteCheckedOutInternal

func (s *Store) DeleteCheckedOutInternal(co *sku.CheckedOut) (err error)

Deletions of "transient" internal objects that should not be exposed to the user

func (*Store) FileExtensionForObject

func (store *Store) FileExtensionForObject(
	sk *sku.Transacted,
) string

func (*Store) Flush

func (fs *Store) Flush() (err error)

func (*Store) GenerateConflictMarker

func (s *Store) GenerateConflictMarker(
	conflicted sku.Conflicted,
	co *sku.CheckedOut,
) (err error)

func (*Store) Get

func (fs *Store) Get(
	k interfaces.ObjectId,
) (t *sku.FSItem, ok bool)

func (*Store) GetCheckoutMode

func (s *Store) GetCheckoutMode(
	el sku.ExternalLike,
) (m checkout_mode.Mode, err error)

func (*Store) GetCheckoutModeOrError

func (s *Store) GetCheckoutModeOrError(
	el sku.ExternalLike,
) (m checkout_mode.Mode, err error)

func (*Store) GetConflictOrError

func (s *Store) GetConflictOrError(
	el sku.ExternalLike,
) (f *fd.FD, err error)

func (*Store) GetExternalObjectIds

func (s *Store) GetExternalObjectIds() (ks []*sku.FSItem, err error)

func (*Store) GetExternalStoreLike

func (fs *Store) GetExternalStoreLike() store_workspace.StoreLike

func (*Store) GetFSItemsForDir

func (s *Store) GetFSItemsForDir(
	fd *fd.FD,
) (items []*sku.FSItem, err error)

func (*Store) GetFSItemsForString

func (s *Store) GetFSItemsForString(
	baseDir string,
	value string,
	tryPattern bool,
) (items []*sku.FSItem, err error)

TODO confirm against actual Object Id

func (*Store) GetFileEncoder

func (store *Store) GetFileEncoder() FileEncoder

func (*Store) GetObjectIdsForString

func (store *Store) GetObjectIdsForString(
	queryLiteral string,
) (objectIds []sku.ExternalObjectId, err error)

func (*Store) GetObjectOrError

func (s *Store) GetObjectOrError(
	el sku.ExternalLike,
) (f *fd.FD, err error)

func (*Store) HydrateExternalFromItem

func (s *Store) HydrateExternalFromItem(
	o sku.CommitOptions,
	item *sku.FSItem,
	internal *sku.Transacted,
	external *sku.Transacted,
) (err error)

Internal may be nil, which means that the external is hydrated without an overlay.

func (*Store) Initialize

func (store *Store) Initialize(
	storeSupplies store_workspace.Supplies,
) (err error)

func (*Store) MakeMergedTransacted

func (s *Store) MakeMergedTransacted(
	conflicted sku.Conflicted,
) (merged *sku.Transacted, err error)

func (*Store) Merge

func (s *Store) Merge(conflicted sku.Conflicted) (err error)

func (*Store) MergeCheckedOut

func (s *Store) MergeCheckedOut(
	co *sku.CheckedOut,
	parentNegotiator sku.ParentNegotiator,
	allowMergeConflicts bool,
) (commitOptions sku.CommitOptions, err error)

TODO combine with other method in this file Makes hard assumptions about the availability of the blobs associated with the *sku.CheckedOut.

func (*Store) Open

func (s *Store) Open(
	m checkout_mode.Mode,
	ph interfaces.FuncIter[string],
	zsc sku.SkuTypeSet,
) (err error)

func (*Store) PathForTransacted

func (store *Store) PathForTransacted(dir string, sk *sku.Transacted) string

func (*Store) QueryCheckedOut

func (s *Store) QueryCheckedOut(
	qg *query.Query,
	f interfaces.FuncIter[sku.SkuType],
) (err error)

func (*Store) ReadAllExternalItems

func (s *Store) ReadAllExternalItems() (err error)

func (*Store) ReadCheckedOutFromTransacted

func (s *Store) ReadCheckedOutFromTransacted(
	sk2 *sku.Transacted,
) (co *sku.CheckedOut, err error)

func (*Store) ReadExternalFromItem

func (s *Store) ReadExternalFromItem(
	o sku.CommitOptions,
	item *sku.FSItem,
	internal *sku.Transacted,
) (external *sku.Transacted, err error)

Given a sku and an FSItem, return the overlayed external variant. Internal can be nil and then only the external data is used.

func (*Store) ReadExternalLikeFromObjectIdLike

func (store *Store) ReadExternalLikeFromObjectIdLike(
	commitOptions sku.CommitOptions,
	objectIdMaybeExternal interfaces.Stringer,
	internal *sku.Transacted,
) (external sku.ExternalLike, err error)

func (*Store) ReadFSItemFromExternal

func (s *Store) ReadFSItemFromExternal(
	tg sku.TransactedGetter,
) (item *sku.FSItem, err error)

func (*Store) ReadOneExternalObjectReader

func (s *Store) ReadOneExternalObjectReader(
	r io.Reader,
	external *sku.Transacted,
) (err error)

func (*Store) RefreshCheckedOut

func (s *Store) RefreshCheckedOut(
	co *sku.CheckedOut,
) (err error)

TODO what does this even do. This caused [cervicis/marshall.zettel !task pom-2 project-2021-zit-bugs project-25q1-zit_workspaces-crit] fix issue with tags other than workspace in `checkin -organize` bei… likely due to this method overriding tags that were set by organize. maybe this bug existed before workspaces?

func (*Store) RemoveItem

func (s *Store) RemoveItem(i *sku.FSItem) (err error)

func (*Store) RunMergeTool

func (store *Store) RunMergeTool(
	tool []string,
	conflicted sku.Conflicted,
) (co *sku.CheckedOut, err error)

func (*Store) SetFilenameForTransacted

func (store *Store) SetFilenameForTransacted(
	options checkout_options.Options,
	sk *sku.Transacted,
	info *checkoutFileNameInfo,
) (err error)

func (*Store) String

func (fs *Store) String() (out string)

func (*Store) ToSliceFilesBlobs

func (s *Store) ToSliceFilesBlobs(
	cos sku.SkuTypeSet,
) (out []string, err error)

func (*Store) ToSliceFilesZettelen

func (s *Store) ToSliceFilesZettelen(
	cos sku.SkuTypeSet,
) (out []string, err error)

func (*Store) UpdateCheckoutFromCheckedOut

func (s *Store) UpdateCheckoutFromCheckedOut(
	options checkout_options.OptionsWithoutMode,
	co sku.SkuType,
) (err error)

func (*Store) UpdateTransacted

func (s *Store) UpdateTransacted(internal *sku.Transacted) (err error)

func (*Store) UpdateTransactedFromBlobs

func (s *Store) UpdateTransactedFromBlobs(
	el sku.ExternalLike,
) (err error)

func (*Store) WriteFSItemToExternal

func (s *Store) WriteFSItemToExternal(
	item *sku.FSItem,
	tg sku.TransactedGetter,
) (err error)

Jump to

Keyboard shortcuts

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