generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kernel): add skeleton navigator (#52)
- Loading branch information
1 parent
0194298
commit 19fe6e8
Showing
36 changed files
with
1,585 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ tasks: | |
cmds: | ||
- go test ./... | ||
|
||
ta: | ||
cmds: | ||
- go test ./tapable | ||
|
||
tc: | ||
cmds: | ||
- go test ./cycle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package core | ||
|
||
import ( | ||
"io/fs" | ||
) | ||
|
||
// DirectoryContents represents the contents of a directory's contents and | ||
// handles sorting order which by default is different between various | ||
// operating systems. This abstraction removes the differences in sorting | ||
// behaviour on different platforms. | ||
type DirectoryContents struct { | ||
Folders []fs.DirEntry | ||
Files []fs.DirEntry | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,65 @@ | ||
package core | ||
|
||
import "errors" | ||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
// Errors defined here are internal errors that are of no value to end | ||
// users (hence not l10n). There are usually programming errors which | ||
// means they only have meaning for client developers. | ||
|
||
// ❌ Invalid Notification Mute Requested | ||
|
||
// NewInvalidNotificationMuteRequestedNativeError creates an untranslated error to | ||
// indicate invalid notification mute requested (internal error) | ||
func NewInvalidNotificationMuteRequestedNativeError(value string) error { | ||
return fmt.Errorf("internal: invalid notification mute requested (%v)", value) | ||
} | ||
|
||
// ❌ Invalid Resume State Transition Detected | ||
|
||
// NewItemAlreadyExtendedNativeError creates an untranslated error to | ||
// indicate invalid resume state transition occurred (internal error) | ||
func NewInvalidResumeStateTransitionNativeError(state string) error { | ||
return fmt.Errorf("internal: invalid resume state transition detected (%v)", state) | ||
} | ||
|
||
// ❌ Item already extended | ||
|
||
// NewItemAlreadyExtendedNativeError creates an untranslated error to | ||
// indicate traverse-item already extended (internal error) | ||
func NewItemAlreadyExtendedNativeError(path string) error { | ||
return fmt.Errorf("internal: item already extended for item at: '%v'", path) | ||
} | ||
|
||
// ❌ Missing listen detacher function | ||
|
||
// NewMissingListenDetacherFunctionNativeError creates an untranslated error to | ||
// indicate invalid resume state transition occurred (internal error) | ||
func NewMissingListenDetacherFunctionNativeError(state string) error { | ||
return fmt.Errorf("internal: missing listen detacher function (%v)", state) | ||
} | ||
|
||
// ❌ Invalid Periscope Root Path | ||
|
||
// NewInvalidPeriscopeRootPathNativeError creates an untranslated error to | ||
// indicate invalid resume state transition occurred (internal error) | ||
func NewInvalidPeriscopeRootPathNativeError(root, current string) error { | ||
return fmt.Errorf("internal: root path '%v' can't be longer than current '%v'", root, current) | ||
} | ||
|
||
// ❌ Resume controller not set | ||
|
||
// NewResumeControllerNotSetNativeError creates an untranslated error to | ||
// indicate resume controller not set (internal error) | ||
func NewResumeControllerNotSetNativeError(from string) error { | ||
return fmt.Errorf("internal: resume controller not set (from: '%v')", from) | ||
} | ||
|
||
var ( | ||
ErrNotImpl = errors.New("NOT-IMPL") | ||
ErrNotImpl = errors.New("NOT-IMPL") | ||
ErrUndefinedSubscriptionType = errors.New( | ||
"undefined subscription type; please set in traverse options (/Options.Store.Subscription)", | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package core | ||
|
||
import ( | ||
"io/fs" | ||
) | ||
|
||
type ( | ||
// QueryStatusHook function signature that enables the default to be overridden. | ||
// (By default, uses Lstat) | ||
QueryStatusHook func(path string) (fs.FileInfo, error) | ||
|
||
// ReadDirectoryHook hook function to define implementation of how a directory's | ||
// entries are read. A default implementation is preset, so does not have to be set | ||
// by the client. | ||
ReadDirectoryHook func(sys fs.FS, dirname string) ([]fs.DirEntry, error) | ||
|
||
// SortHook hook function to define how directory entries are sorted. Does not | ||
// have to be set explicitly. This will be set according to the IsCaseSensitive on | ||
// the TraverseOptions, but can be overridden if needed. | ||
SortHook func(entries []fs.DirEntry, custom ...any) error | ||
|
||
SubPathInfo struct { | ||
Root string | ||
Node *Node | ||
KeepTrailingSep bool | ||
} | ||
|
||
// SubPathHook | ||
SubPathHook func(info *SubPathInfo) string | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.