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, ...) error
- func AttachmentList(ctx context.Context, spec model.RepoSpec, tmNameOrId, format string) error
- func CalcFileDigest(filename string) error
- func CheckIntegrity(ctx context.Context, spec model.RepoSpec, args []string, format string) error
- func Copy(ctx context.Context, repo model.RepoSpec, toRepo model.RepoSpec, ...) error
- func CreateSearchIndex(ctx context.Context, spec model.RepoSpec) error
- func Delete(ctx context.Context, repo model.RepoSpec, id string) error
- func Export(ctx context.Context, repo model.RepoSpec, search *model.Filters, ...) error
- func Fetch(ctx context.Context, repo model.RepoSpec, idOrName, outputPath string, ...) error
- func Index(ctx context.Context, spec model.RepoSpec) error
- func IsValidOutputFormat(format string) bool
- func List(ctx context.Context, repo model.RepoSpec, search *model.Filters, format string) error
- func ListVersions(ctx context.Context, spec model.RepoSpec, name, format string) error
- func RepoAdd(name, typ string, locStr, descr, jsonConf, confFile string) error
- func RepoList(format string) error
- func RepoRemove(name string) error
- func RepoRename(oldName, newName string) (err error)
- func RepoSetAuth(name, kind string, data []string) error
- func RepoSetConfig(name, locStr, jsonConf, confFile string) error
- func RepoSetDescription(ctx context.Context, name, description string) error
- func RepoSetHeaders(name string, data []string) error
- func RepoShow(name string) error
- func RepoToggleEnabled(name string) error
- func Search(ctx context.Context, repo model.RepoSpec, query, format string) error
- func Serve(host, port string, opts ServeOptions, repo model.RepoSpec) error
- func Stderrf(format string, args ...any)
- func ValidateFile(ctx context.Context, filename string) error
- type ImportExecutor
- type ListResultEntry
- type OpResultType
- type OperationResult
- type RepoConfigAbridged
- type SearchResultEntry
- type ServeOptions
- type VersionResultEntry
Constants ¶
View Source
const ( OutputFormatJSON = "json" OutputFormatPlain = "plain" )
View Source
const DefaultListSeparator = ","
Variables ¶
View Source
var ErrInvalidArgs = errors.New("invalid arguments")
View Source
var ErrInvalidOutputFormat = errors.New("invalid output format")
Functions ¶
func AttachmentDelete ¶
func AttachmentFetch ¶
func AttachmentImport ¶
func AttachmentList ¶
func CalcFileDigest ¶
func CheckIntegrity ¶ added in v0.1.3
func CreateSearchIndex ¶ added in v0.1.3
func IsValidOutputFormat ¶ added in v0.1.3
func ListVersions ¶
func RepoRemove ¶
func RepoRename ¶
func RepoSetAuth ¶
func RepoSetConfig ¶
func RepoSetDescription ¶ added in v0.1.3
func RepoSetHeaders ¶ added in v0.1.3
func RepoToggleEnabled ¶
Types ¶
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, format string) ([]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 ListResultEntry ¶ added in v0.1.3
type OpResultType ¶ added in v0.1.3
type OpResultType int
func (OpResultType) MarshalJSON ¶ added in v0.1.3
func (t OpResultType) MarshalJSON() ([]byte, error)
func (OpResultType) String ¶ added in v0.1.3
func (t OpResultType) String() string
type OperationResult ¶ added in v0.1.3
type OperationResult struct {
Type OpResultType `json:"type"`
ResourceId string `json:"resourceId"`
Text string `json:"text,omitempty"`
}
func (OperationResult) String ¶ added in v0.1.3
func (r OperationResult) String() string
type RepoConfigAbridged ¶ added in v0.1.3
type SearchResultEntry ¶ added in v0.1.3
type SearchResultEntry struct {
TMID string `json:"tmid"`
Repo string `json:"repo"`
SearchMatch *model.SearchMatch `json:"searchMatch,omitempty"`
}
type ServeOptions ¶
type ServeOptions struct {
UrlCtxRoot string
cors.CORSOptions
jwt.JWTValidationOpts
JWTValidation bool
}
Click to show internal directories.
Click to hide internal directories.