Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureClassifyCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
- func ConfigureCreateClassifierCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureCreateDocumentCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureCreateExtractorCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureCreateExtractorTemplateCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureCreateReadProfileCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureDeleteClassifierCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureDeleteDocumentCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags ...)
- func ConfigureDeleteExtractorCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags ...)
- func ConfigureDeleteReadProfileCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureExtractCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
- func ConfigureListClassifiersCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureListDocumentsCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureListExtractorsCmd(ctx context.Context, listCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureListModulesCommand(ctx context.Context, listCmd *kingpin.CmdClause, ...)
- func ConfigureListReadProfilesCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
- func ConfigureLoginCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
- func ConfigureReadCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
- func ConfigureRedactWithExtractionCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
- func ConfigureUploadClassifierCommand(ctx context.Context, uploadCmd *kingpin.CmdClause, ...)
- func ConfigureUploadExtractorCommand(ctx context.Context, uploadCommand *kingpin.CmdClause, ...)
- func ExecuteWithMessage(message string, fn func() error) error
- func Glob(filePattern string) ([]string, error)
- func GlobMany(filePatterns []string) ([]string, error)
- func NewTable(writer io.Writer, headers []string) *tablewriter.Table
- type ClassificationService
- type ClassifierCreator
- type ClassifierDeleter
- type ClassifierDeleterGetter
- type ClassifierGetter
- type ClassifierTrainer
- type ClassifierUploader
- type ClassifyCmd
- type ConsoleSecretReader
- type CreateClassifierCmd
- type CreateDocumentCmd
- type CreateExtractorCmd
- type CreateExtractorTemplateCmd
- type CreateReadProfileCmd
- type CredentialsResolver
- type DeleteClassifierCmd
- type DeleteDocumentCmd
- type DeleteExtractorCmd
- type DeleteReadProfileCmd
- type DocumentDeleterGetter
- type ExtractCmd
- type ExtractionService
- type ExtractorCreator
- type ExtractorDeleter
- type ExtractorDeleterGetter
- type ExtractorGetter
- type ListClassifiersCmd
- type ListDocumentsCmd
- type ListExtractorsCmd
- type ListModulesCmd
- type ListReadProfilesCmd
- type LoginCmd
- type ModuleGetter
- type ReadArgs
- type ReadCmd
- type ReaderService
- type RedactWithExtractorCmd
- type RedactWithExtractorService
- type UploadClassifierCmd
- type UploadExtractorCmd
Constants ¶
const ListExtractorsCommand = "list extractors"
const ListModulesCommandString = "list modules"
Variables ¶
var DefaultHttpClient = &http.Client{Timeout: time.Minute * 2}
Functions ¶
func ConfigureClassifyCommand ¶
func ConfigureClassifyCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
func ConfigureCreateClassifierCmd ¶
func ConfigureCreateClassifierCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
func ConfigureCreateDocumentCmd ¶
func ConfigureCreateDocumentCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
func ConfigureCreateExtractorCmd ¶
func ConfigureCreateExtractorCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
ConfigureCreateExtractorCmd configures kingpin with the 'create extractor' commands.
func ConfigureCreateExtractorTemplateCmd ¶
func ConfigureCreateExtractorTemplateCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
ConfigureCreateExtractorTemplateCmd configures kingpin with the 'create extractor-template' command.
func ConfigureCreateReadProfileCmd ¶
func ConfigureCreateReadProfileCmd(ctx context.Context, createCmd *kingpin.CmdClause, flags *config.GlobalFlags)
func ConfigureDeleteClassifierCmd ¶
func ConfigureDeleteClassifierCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config.GlobalFlags)
func ConfigureDeleteDocumentCmd ¶
func ConfigureDeleteDocumentCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config. GlobalFlags)
ConfigureDeleteDocumentCmd configures kingpin with the 'delete document' command.
func ConfigureDeleteExtractorCmd ¶
func ConfigureDeleteExtractorCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config. GlobalFlags)
ConfigureDeleteExtractorCmd configures kingpin with the 'delete extractor' command.
func ConfigureDeleteReadProfileCmd ¶
func ConfigureDeleteReadProfileCmd(ctx context.Context, deleteCmd *kingpin.CmdClause, flags *config.GlobalFlags)
func ConfigureExtractCommand ¶
func ConfigureExtractCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
func ConfigureListClassifiersCmd ¶
func ConfigureListClassifiersCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
Configures kingpin with the 'list classifiers' command
func ConfigureListDocumentsCmd ¶
func ConfigureListDocumentsCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
Configures kingpin with the 'list documents' command
func ConfigureListExtractorsCmd ¶
func ConfigureListExtractorsCmd(ctx context.Context, listCmd *kingpin.CmdClause, flags *config.GlobalFlags)
ConfigureListExtractorsCmd configures kingpin with the 'list extractors' command.
func ConfigureListModulesCommand ¶
func ConfigureListModulesCommand(ctx context.Context, listCmd *kingpin.CmdClause, globalFlags *config.GlobalFlags)
func ConfigureListReadProfilesCmd ¶
func ConfigureListReadProfilesCmd(ctx context.Context, parentCmd *kingpin.CmdClause, flags *config.GlobalFlags)
Configures kingpin with the 'list read-profiles' command
func ConfigureLoginCommand ¶
func ConfigureLoginCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
ConfigureLoginCommand configures kingpin to add the login command.
func ConfigureReadCommand ¶
func ConfigureReadCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
ConfigureReadCommand configures kingpin to call ExecuteRead after having successfully parsed the cli options.
func ConfigureRedactWithExtractionCommand ¶
func ConfigureRedactWithExtractionCommand(ctx context.Context, app *kingpin.Application, globalFlags *config.GlobalFlags)
func ConfigureUploadClassifierCommand ¶
func ConfigureUploadClassifierCommand(ctx context.Context, uploadCmd *kingpin.CmdClause, globalFlags *config.GlobalFlags)
func ConfigureUploadExtractorCommand ¶
func ConfigureUploadExtractorCommand(ctx context.Context, uploadCommand *kingpin.CmdClause, globalFlags *config.GlobalFlags)
func ExecuteWithMessage ¶
Execute prints the provided message to stderr, runs fn(), then prints [OK] or [FAILED] depending on fn's success.
Types ¶
type ClassificationService ¶
type ClassifierCreator ¶
type ClassifierDeleter ¶
type ClassifierDeleterGetter ¶
type ClassifierDeleterGetter interface { ClassifierDeleter ClassifierGetter }
type ClassifierGetter ¶
type ClassifierGetter interface {
GetAll(ctx context.Context) (client.ClassifierList, error)
}
type ClassifierTrainer ¶
type ClassifierUploader ¶
type ClassifyCmd ¶
type ClassifyCmd struct { ClassificationService ClassificationService FilePaths []string ClassifierName string ReadProfileArgs client.ReadProfileArgs }
type ConsoleSecretReader ¶
type ConsoleSecretReader struct { }
func (ConsoleSecretReader) ReadLine ¶
func (r ConsoleSecretReader) ReadLine(ctx context.Context) (string, error)
func (ConsoleSecretReader) ReadSecret ¶
func (r ConsoleSecretReader) ReadSecret(ctx context.Context) (string, error)
type CreateClassifierCmd ¶
type CreateClassifierCmd struct { Creator ClassifierCreator Deleter ClassifierDeleter Trainer ClassifierTrainer ClassifierName string SamplesArchive *os.File }
type CreateDocumentCmd ¶
type CreateDocumentCmd struct { Creator client.DocumentCreator DocumentPaths []string }
type CreateExtractorCmd ¶
type CreateExtractorCmd struct { Creator ExtractorCreator ExtractorName string Template *client.ExtractorTemplate }
type CreateExtractorTemplateCmd ¶
type CreateExtractorTemplateCmd struct { Client ModuleGetter ModuleIds []string Output io.Writer }
CreateExtractorTemplate is a command which accepts a list of module ids, retrieves their descriptions from aluma and generates a template json from them.
type CreateReadProfileCmd ¶
type CreateReadProfileCmd struct { Creator client.ReadProfileCreator Name string Languages []string }
type CredentialsResolver ¶
type CredentialsResolver struct{}
func (*CredentialsResolver) Resolve ¶
func (r *CredentialsResolver) Resolve(clientId string, clientSecret string, configurationReader config.ConfigurationReader) (string, string, error)
type DeleteClassifierCmd ¶
type DeleteClassifierCmd struct { Client ClassifierDeleterGetter ClassifierName string }
type DeleteDocumentCmd ¶
type DeleteDocumentCmd struct { Client DocumentDeleterGetter DocumentIDs []string DeleteAll bool }
type DeleteExtractorCmd ¶
type DeleteExtractorCmd struct { Client ExtractorDeleterGetter ExtractorName string }
type DeleteReadProfileCmd ¶
type DeleteReadProfileCmd struct { Client client.ReadProfileGetterDeleter ReadProfileName string }
type DocumentDeleterGetter ¶
type DocumentDeleterGetter interface { client.DocumentDeleter client.DocumentGetter }
type ExtractCmd ¶
type ExtractCmd struct { ExtractorName string FilePaths []string ReadProfileArgs client.ReadProfileArgs ExtractionService ExtractionService }
type ExtractionService ¶
type ExtractorCreator ¶
type ExtractorDeleter ¶
type ExtractorDeleterGetter ¶
type ExtractorDeleterGetter interface { ExtractorDeleter ExtractorGetter }
type ExtractorGetter ¶
type ExtractorGetter interface {
GetAll(ctx context.Context) (client.ExtractorList, error)
}
type ListClassifiersCmd ¶
type ListClassifiersCmd struct {
Client ClassifierGetter
}
type ListDocumentsCmd ¶
type ListDocumentsCmd struct {
Client client.DocumentGetter
}
type ListExtractorsCmd ¶
type ListExtractorsCmd struct {
Client ExtractorGetter
}
func (*ListExtractorsCmd) Execute ¶
func (cmd *ListExtractorsCmd) Execute(ctx context.Context) error
Execute runs the 'list extractors' command.
func (ListExtractorsCmd) Usage ¶
func (cmd ListExtractorsCmd) Usage() string
type ListModulesCmd ¶
type ListModulesCmd struct {
Client ModuleGetter
}
func (ListModulesCmd) Usage ¶
func (cmd ListModulesCmd) Usage() string
type ListReadProfilesCmd ¶
type ListReadProfilesCmd struct {
Client client.ReadProfileGetter
}
type LoginCmd ¶
type LoginCmd struct { TokenRetriever auth.TokenRetriever ConfigurationWriter config.ConfigurationWriter }
type ModuleGetter ¶
type ModuleGetter interface {
GetAll(ctx context.Context) (client.ModuleList, error)
}
type ReadCmd ¶
type ReadCmd struct { FilePaths []string ReaderService ReaderService ReadMode client.ReadMode ReadProfileArgs client.ReadProfileArgs }
ReadCmd represents the 'read' command. It relies on a 'ReaderService' to perform the actual OCR.
type ReaderService ¶
type RedactWithExtractorCmd ¶
type RedactWithExtractorCmd struct { ExtractorName string FilePaths []string ReadProfileArgs client.ReadProfileArgs RedactionService RedactWithExtractorService }
type UploadClassifierCmd ¶
type UploadClassifierCmd struct { Uploader ClassifierUploader ClassifierName string ClassifierContents io.Reader }
type UploadExtractorCmd ¶
type UploadExtractorCmd struct { ExtractorCreator ExtractorCreator ExtractorName string ExtractorContent io.Reader }
Source Files ¶
- classify.go
- commonflags.go
- consolesecretreader.go
- createclassifier.go
- createdocument.go
- createextractor.go
- createextractortemplate.go
- createreadprofile.go
- credentialsresolver.go
- deleteclassifier.go
- deletedocuments.go
- deleteextractor.go
- deletereadprofile.go
- execute.go
- extract.go
- glob.go
- init.go
- listclassifiers.go
- listdocuments.go
- listextractors.go
- listmodules.go
- listreadprofiles.go
- login.go
- read.go
- redact.go
- table.go
- uploadclassifier.go
- uploadextractor.go