store_fs

package
v0.0.0-...-544897d Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 42 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(
	envRepo env_repo.Env,
	inlineTypeChecker ids.InlineTypeChecker,
) *fileEncoder

Types

type CheckedOutMutableSet

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

func MakeCheckedOutMutableSet

func MakeCheckedOutMutableSet() CheckedOutMutableSet

type CheckedOutSet

type CheckedOutSet = interfaces.Set[*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(
		checkout_options.TextFormatterOptions,
		*sku.Transacted,
		*sku.FSItem,
	) 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 file_extensions.Config,
	envRepo env_repo.Env,
) (store *Store, err error)

func (*Store) All

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

TODO switch to seq.Iter2

func (*Store) CheckoutOne

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

func (*Store) DeleteCheckedOut

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

Deletions of user objects that should be exposed to the user

func (*Store) DeleteCheckedOutInternal

func (store *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(
	object *sku.Transacted,
) string

func (*Store) Flush

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

func (*Store) GenerateConflictMarker

func (store *Store) GenerateConflictMarker(
	conflicted sku.Conflicted,
	checkedOut *sku.CheckedOut,
) (err error)

func (*Store) Get

func (store *Store) Get(
	objectId ids.Id,
) (fsItem *sku.FSItem, ok bool)

func (*Store) GetCheckoutMode

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

func (*Store) GetCheckoutModeOrError

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

func (*Store) GetConflictOrError

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

func (*Store) GetExternalObjectIds

func (store *Store) GetExternalObjectIds() (fsItems []*sku.FSItem, err error)

func (*Store) GetExternalStoreLike

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

func (*Store) GetFSItemsForDir

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

func (*Store) GetFSItemsForString

func (store *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 (store *Store) GetObjectOrError(
	el sku.ExternalLike,
) (f *fd.FD, err error)

func (*Store) HydrateExternalFromItem

func (store *Store) HydrateExternalFromItem(
	options 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) MakeBlobPathSlice

func (store *Store) MakeBlobPathSlice(
	objects sku.SkuTypeSet,
) (out []string, err error)

func (*Store) MakeMergedTransacted

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

func (*Store) MakeObjectPathSlice

func (store *Store) MakeObjectPathSlice(
	objects sku.SkuTypeSet,
) (out []string, err error)

func (*Store) Merge

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

func (*Store) MergeCheckedOut

func (store *Store) MergeCheckedOut(
	checkedOut *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 (store *Store) Open(
	m checkout_mode.Mode,
	ph interfaces.FuncIter[string],
	zsc sku.SkuTypeSet,
) (err error)

func (*Store) PathForTransacted

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

func (*Store) QueryCheckedOut

func (store *Store) QueryCheckedOut(
	queryGroup *queries.Query,
	funk interfaces.FuncIter[sku.SkuType],
) (err error)

func (*Store) ReadAllExternalItems

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

func (*Store) ReadCheckedOutFromTransacted

func (store *Store) ReadCheckedOutFromTransacted(
	object *sku.Transacted,
) (checkedOut *sku.CheckedOut, err error)

func (*Store) ReadExternalFromItem

func (store *Store) ReadExternalFromItem(
	commitOptions 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 (store *Store) ReadFSItemFromExternal(
	transactedGetter sku.TransactedGetter,
) (item *sku.FSItem, err error)

func (*Store) ReadOneExternalObjectReader

func (store *Store) ReadOneExternalObjectReader(
	reader io.Reader,
	external *sku.Transacted,
) (err error)

func (*Store) RefreshCheckedOut

func (store *Store) RefreshCheckedOut(
	checkedOut *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 (store *Store) RemoveItem(fsItem *sku.FSItem) (err error)

func (*Store) RunMergeTool

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

func (*Store) SetFilenameForTransacted

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

func (*Store) String

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

func (*Store) UpdateCheckoutFromCheckedOut

func (store *Store) UpdateCheckoutFromCheckedOut(
	options checkout_options.OptionsWithoutMode,
	object sku.SkuType,
) (err error)

func (*Store) UpdateTransacted

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

func (*Store) UpdateTransactedFromBlobs

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

func (*Store) WriteFSItemToExternal

func (store *Store) WriteFSItemToExternal(
	item *sku.FSItem,
	transactedGetter sku.TransactedGetter,
) (err error)

Source Files

  • accessors.go
  • checked_out.go
  • checkout.go
  • checkout2.go
  • checkout_options.go
  • collections.go
  • delete_checkout.go
  • diff.go
  • dir_info.go
  • edit_and_open.go
  • external.go
  • file_encoder.go
  • fs_item_data.go
  • main.go
  • merge.go
  • open_files.go
  • pathoption_string.go
  • pools.go
  • primitives.go
  • query.go
  • read_checked_out.go
  • read_external.go
  • reading.go

Jump to

Keyboard shortcuts

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