Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseDirRef ¶
func ResolveBase ¶
type HashPath ¶
HashPath is a string that represents a file-system object (file or directory). In its simplest form a HashPath is a hash. It can also have a relative path to a given hash or reference. A HashPath can be resolved to a single hash of a dir or blob using a specific resolution process.
func Parse ¶
Parse a HashPath, which is a string in one of these forms:
<blob-hash> <dir-hash> <dir-hash>:<relative-path> <commit-hash>:<relative-path> <ref>:<relative-path> # with inferred project and server <ref@project>:<relative-path> # with inferred server <ref@project@server>:<relative-path>
func (*HashPath) IsSimpleHash ¶
type NewResolution ¶
type Resolution ¶
type Resolution struct {
// FS is a CAS in-memory file-system rooted at the base object. It will be nil if the base is pointing to a blob or the hash-path was simply a path.
FS bindcas.MemFS
// Ref is a fully-qualified reference if a ref is used, otherwise is an empty string.
Ref string
// Base is the hash of resolved object either specified explicitly or resolved from the ref.
Base entities.Hash
// DirHash is the hash of a tree (directory) object resolved from Base (like if Base is a commit, DirHash is its tree-hash).
DirHash entities.Hash
// Resolved is the hash of the target object, found by resolving the base and starting from the directory specified by DirHash.
Resolved entities.Hash
}
func Resolve ¶
func Resolve(ctx context.Context, store entities.CASStore, hp *HashPath, defaultServer, defaultProject string) (*Resolution, error)
Resolve is split into two methods: ResolveBase -> Uses remote Ref APIs to lookup base and dir hashes. ResolvePath -> Can navigate from the dir hash to the path of interest. They are split here to allow independent caching.
func ResolvePath ¶
func ResolvePath(ctx context.Context, store entities.CASStore, baseDirRef BaseDirRef, hp *HashPath) (*Resolution, error)
Click to show internal directories.
Click to hide internal directories.