cli

package
v0.0.0-...-b14fe12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagNumberOfResult = "number-of-results"
	FlagQuery          = "query"
	FlagNoPager        = "no-pager"
	FlagHash           = "hash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CliDisplay

type CliDisplay interface {
	IndexBuild(res domain.BuildOperationResult) string
	IndexClean(res domain.CleanOperationResult) string
	Search(res domain.SearchResult) string
	ShowFile(file domain.IndexedFile) string
	StartServer(serviceUrl string) string
	Display(output string, withPager bool) error
}

func NewCliDisplay

func NewCliDisplay(config config.Config) CliDisplay

type CliDisplayImpl

type CliDisplayImpl struct {
	// contains filtered or unexported fields
}

func (*CliDisplayImpl) Display

func (d *CliDisplayImpl) Display(output string, withPager bool) error

func (*CliDisplayImpl) IndexBuild

func (d *CliDisplayImpl) IndexBuild(res domain.BuildOperationResult) string

func (*CliDisplayImpl) IndexClean

func (d *CliDisplayImpl) IndexClean(res domain.CleanOperationResult) string

func (*CliDisplayImpl) Search

func (d *CliDisplayImpl) Search(res domain.SearchResult) string

func (*CliDisplayImpl) ShowFile

func (d *CliDisplayImpl) ShowFile(file domain.IndexedFile) string

func (*CliDisplayImpl) StartServer

func (d *CliDisplayImpl) StartServer(serviceUrl string) string

type CliHandlers

type CliHandlers interface {
	UpdateIndex() error
	CleanIndex() error
	Search(query string, numberOfResults int, usePager bool) error
	ShowFile(hash string, usePager bool) error
	StartServer() error
}

func NewCliHandlers

func NewCliHandlers(gsConfig config.Config, gsIndex index.Index, server http.HttpServer) CliHandlers

type CliHandlersImpl

type CliHandlersImpl struct {
	// contains filtered or unexported fields
}

func (*CliHandlersImpl) CleanIndex

func (s *CliHandlersImpl) CleanIndex() error

func (*CliHandlersImpl) Search

func (s *CliHandlersImpl) Search(query string, numberOfResults int, usePager bool) error

func (*CliHandlersImpl) ShowFile

func (s *CliHandlersImpl) ShowFile(hash string, usePager bool) error

TODO: show files by path too

func (*CliHandlersImpl) StartServer

func (s *CliHandlersImpl) StartServer() error

func (*CliHandlersImpl) UpdateIndex

func (s *CliHandlersImpl) UpdateIndex() error

type CliParserImpl

type CliParserImpl struct {
	// contains filtered or unexported fields
}

func NewCliParser

func NewCliParser(config config.Config, index index.Index, server http.HttpServer) CliParserImpl

func (*CliParserImpl) ApplyCommand

func (s *CliParserImpl) ApplyCommand(args []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址