Documentation
¶
Index ¶
- Constants
- func BoolToYesNo(b bool) string
- func CleanQuotes(s string) string
- func DumpBboltFromDB(db *bbolt.DB, bucketPath string) error
- func ExplainRemoteRepositoryOpenError(target string, err error) (friendly string, includeDetails bool)
- func FlagToSymbol(flag sst.DiffTripleFlag) string
- func GetAuthContext(repo sst.Repository, authContexts map[sst.Repository]context.Context) context.Context
- func GetRealProvider() *refreshableProvider
- func GetToken(refreshToken string) *oauth2.Token
- func GetUserCredentials() (string, string)
- func HumanBytes(n int64) string
- func ListCommitHistoryDetailed(dataset sst.Dataset, commit sst.Hash, visited map[string]bool, ...)
- func ListCommitHistoryHashOnly(dataset sst.Dataset, commit sst.Hash, visited map[string]bool, ...)
- func MuteLog()
- func MuteStdout()
- func PaginateLogEntries(entries [][]string, pageSize int)
- func PaginateOutput(lines []string, linesPerPage int)
- func PrintCommitDetails(details *sst.CommitDetails)
- func PrintDiffTriples(tris []sst.DiffTriple)
- func PrintDocumentInfo(doc *sst.DocumentInfo)
- func PrintDocumentList(docs []sst.DocumentInfo)
- func PrintIBNodeDetails(alias string, node sst.IBNode)
- func PrintNamedGraphDetails(alias string, namedGraph sst.NamedGraph)
- func PrintNamedGraphInfo(info sst.NamedGraphInfo)
- func PrintRepositoryInfo(info sst.RepositoryInfo)
- func PrintSearchResult(result *bleve.SearchResult)
- func PrintSearchResultAllFields(result *bleve.SearchResult)
- func PrintStageInfo(stage sst.Stage)
- func RemoveAlias(list []string, alias string) []string
- func RemoveAliasFlag(args []string) []string
- func RestoreLog()
- func RestoreStdout()
- func ShowLoadingIndicator(message string, fn func())
- func SstDiffTriples(ctx context.Context, repo sst.Repository, oldH, newH sst.Hash, normalize bool) ([]sst.DiffTriple, error)
- func SstRead(ctx context.Context, repo sst.Repository, h sst.Hash) ([]byte, error)
- func ValidatePath(path string) error
- func VerifyTokenValidity(accessToken string) bool
- func WrapText(text string, width int, indentSize int) string
- type AliasResult
Constants ¶
const (
BasePath = "cli/cmd/.sst"
)
BasePath is the root directory for the .sst configuration files (relative to the current working directory).
Variables ¶
This section is empty.
Functions ¶
func CleanQuotes ¶
func ExplainRemoteRepositoryOpenError ¶
func ExplainRemoteRepositoryOpenError(target string, err error) (friendly string, includeDetails bool)
ExplainRemoteRepositoryOpenError returns a short, user-oriented message for a failed OpenRemoteRepository. If includeDetails is true, the caller may also print the raw error.
func FlagToSymbol ¶
func FlagToSymbol(flag sst.DiffTripleFlag) string
flagToSymbol returns a visual symbol for a DiffFlag
func GetAuthContext ¶
func GetAuthContext(repo sst.Repository, authContexts map[sst.Repository]context.Context) context.Context
GetAuthContext returns the appropriate context for a given repository. If the repository has an associated authentication context (e.g., for remote repositories), it returns that context. Otherwise, it returns context.TODO() as a fallback for local or unauthenticated use.
func GetRealProvider ¶
func GetRealProvider() *refreshableProvider
GetRealProvider retrieves a valid authentication provider, prompting user if necessary
func GetUserCredentials ¶
GetUserCredentials prompts the user to enter their username and password
func HumanBytes ¶
HumanBytes formats bytes into a human-friendly string.
func MuteLog ¶
func MuteLog()
MuteLog redirects log output to a null device, effectively silencing it.
func MuteStdout ¶
func MuteStdout()
MuteStdout redirects stdout to a null device, effectively silencing fmt.Printf and similar output.
func PaginateLogEntries ¶
PaginateLogEntries paginates log entries where each entry is a group of lines.
func PaginateOutput ¶
PaginateOutput displays a list of lines with pagination, pausing every `linesPerPage` lines. Users can press Enter to continue or type 'q' to exit early.
func PrintCommitDetails ¶
func PrintCommitDetails(details *sst.CommitDetails)
func PrintDocumentInfo ¶
func PrintDocumentInfo(doc *sst.DocumentInfo)
func PrintDocumentList ¶
func PrintDocumentList(docs []sst.DocumentInfo)
func PrintIBNodeDetails ¶
func PrintNamedGraphDetails ¶
func PrintNamedGraphDetails(alias string, namedGraph sst.NamedGraph)
func PrintNamedGraphInfo ¶
func PrintNamedGraphInfo(info sst.NamedGraphInfo)
func PrintRepositoryInfo ¶
func PrintRepositoryInfo(info sst.RepositoryInfo)
func PrintSearchResult ¶
func PrintSearchResult(result *bleve.SearchResult)
func PrintSearchResultAllFields ¶
func PrintSearchResultAllFields(result *bleve.SearchResult)
PrintSearchResultAllFields prints all fields from search results
func PrintStageInfo ¶
func RemoveAlias ¶
RemoveAlias removes a specific alias string from a list of aliases (generic utility)
func RemoveAliasFlag ¶
RemoveAliasFlag removes the first occurrence of '-a' flag and its value from args. This is useful when you need to get multiple aliases from the same args list.
func RestoreStdout ¶
func RestoreStdout()
RestoreStdout restores stdout to its original destination.
func ShowLoadingIndicator ¶
func ShowLoadingIndicator(message string, fn func())
ShowLoadingIndicator runs a loading message or spinner while executing a given function. - `message`: The message to display while loading. - `fn`: The function that takes time to execute.
func SstDiffTriples ¶
func SstDiffTriples(ctx context.Context, repo sst.Repository, oldH, newH sst.Hash, normalize bool) ([]sst.DiffTriple, error)
Compute diff triples between two NGRs
func ValidatePath ¶
func VerifyTokenValidity ¶
VerifyTokenValidity checks if the token is a valid JWT
Types ¶
type AliasResult ¶
type AliasResult struct {
Alias string
Confirm func() // Call this function only if the operation succeeds
}
AliasResult contains an alias and a confirmation function. If the alias was auto-generated, call Confirm() on success.