Documentation
¶
Overview ¶
Package cli contains implementations of CLI commands. The command code is supposed contain only logic specific to the CLI and delegate complex/reusable stuff to code in /internal/commands. Commands in cli package should print results in human-readable format to stdout.
Index ¶
- Constants
- Variables
- func AttachmentDelete(ctx context.Context, spec model.RepoSpec, tmNameOrId, attachmentName string) error
- func AttachmentFetch(ctx context.Context, spec model.RepoSpec, tmNameOrId, attachmentName string) error
- func AttachmentImport(ctx context.Context, spec model.RepoSpec, tmNameOrId, filename string, ...) error
- func AttachmentList(ctx context.Context, spec model.RepoSpec, tmNameOrId string) error
- func CalcFileDigest(filename string) error
- func CheckIndex(ctx context.Context, spec model.RepoSpec) error
- func CheckResources(ctx context.Context, spec model.RepoSpec, names []string) error
- func Copy(ctx context.Context, repo model.RepoSpec, toRepo model.RepoSpec, ...) error
- func CreateSearchParamsFromCLI(flags FilterFlags, name string) *model.SearchParams
- func Delete(ctx context.Context, repo model.RepoSpec, id string) error
- func Export(ctx context.Context, repo model.RepoSpec, search *model.SearchParams, ...) error
- func Fetch(ctx context.Context, repo model.RepoSpec, idOrName, outputPath string, ...) error
- func Index(ctx context.Context, spec model.RepoSpec) error
- func List(ctx context.Context, repo model.RepoSpec, search *model.SearchParams) error
- func ListVersions(ctx context.Context, spec model.RepoSpec, name string) error
- func RepoAdd(name, typ, confStr, confFile, descr string) error
- func RepoList() error
- func RepoRemove(name string) error
- func RepoRename(oldName, newName string) (err error)
- func RepoSetAuth(name, kind, data string) error
- func RepoSetConfig(name, typ, confStr, confFile string, descr string) error
- func RepoShow(name string) error
- func RepoToggleEnabled(name string) error
- func Serve(host, port string, opts ServeOptions, repo model.RepoSpec) error
- func Stderrf(format string, args ...any)
- func ValidateFile(filename string) error
- type CheckResult
- type CheckResultType
- type FilterFlags
- type ImportExecutor
- type ServeOptions
Constants ¶
View Source
const ( CheckOK = CheckResultType(iota) CheckErr )
View Source
const DefaultListSeparator = ","
Variables ¶
View Source
var ErrInvalidArgs = errors.New("invalid arguments")
View Source
var TmcVersion = "n/a"
Functions ¶
func AttachmentDelete ¶
func AttachmentFetch ¶
func AttachmentImport ¶
func AttachmentList ¶
func CalcFileDigest ¶
func CheckResources ¶
func CreateSearchParamsFromCLI ¶
func CreateSearchParamsFromCLI(flags FilterFlags, name string) *model.SearchParams
func RepoRemove ¶
func RepoRename ¶
func RepoSetAuth ¶
func RepoSetConfig ¶
func RepoToggleEnabled ¶
func ValidateFile ¶
Types ¶
type CheckResult ¶
type CheckResult struct {
// contains filtered or unexported fields
}
func (CheckResult) String ¶
func (r CheckResult) String() string
type CheckResultType ¶
type CheckResultType int
func (CheckResultType) String ¶
func (t CheckResultType) String() string
type FilterFlags ¶
type ImportExecutor ¶
type ImportExecutor struct {
// contains filtered or unexported fields
}
func NewImportExecutor ¶
func NewImportExecutor(now commands.Now) *ImportExecutor
func (*ImportExecutor) Import ¶
func (p *ImportExecutor) Import(ctx context.Context, filename string, spec model.RepoSpec, optTree bool, opts repos.ImportOptions) ([]repos.ImportResult, error)
Import imports file or directory into the specified repository Returns the list of import results up to the first encountered error, and the error
type ServeOptions ¶
type ServeOptions struct { UrlCtxRoot string cors.CORSOptions jwt.JWTValidationOpts JWTValidation bool }
Click to show internal directories.
Click to hide internal directories.