odm

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_QUEUED    int = 10
	STATUS_RUNNING   int = 20
	STATUS_FAILED    int = 30
	STATUS_COMPLETED int = 40
	STATUS_CANCELED  int = 50
)

Variables

View Source
var ErrAuthRequired = errors.New("Auth Required")

ErrAuthRequired means authorization is required

View Source
var ErrUnauthorized = errors.New("Unauthorized")

ErrUnauthorized means a response was not authorized

Functions

func Run

func Run(files []string, options []Option, node Node, outputPath string, parallelConnections int, maxUploadRetries int)

Run processes a dataset

Types

type ApiActionResponse

type ApiActionResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

type AuthInfoResponse

type AuthInfoResponse struct {
	Message     string `json:"message"`
	LoginUrl    string `json:"loginUrl"`
	RegisterUrl string `json:"registerUrl"`
}

type InfoResponse

type InfoResponse struct {
	Version   string `json:"version"`
	MaxImages int    `json:"maxImages"`

	Error string `json:"error"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

type Node

type Node struct {
	URL   string `json:"url"`
	Token string `json:"token"`
	// contains filtered or unexported fields
}

Node is a NodeODM processing node

func (Node) CheckAuthentication

func (n Node) CheckAuthentication(err error) error

func (Node) Info

func (n Node) Info() (*InfoResponse, error)

Info GET: /info

func (Node) Options

func (n Node) Options() ([]OptionResponse, error)

Options GET: /options

func (Node) String

func (n Node) String() string

func (Node) TaskCancel

func (n Node) TaskCancel(uuid string) error

TaskCancel POST: /task/cancel

func (Node) TaskDownload

func (n Node) TaskDownload(uuid string, asset string, outputFile string) error

TaskDownload GET: /task/<uuid>/download/<asset>

func (Node) TaskInfo

func (n Node) TaskInfo(uuid string) (*TaskInfoResponse, error)

TaskInfo GET: /task/<uuid>/info

func (Node) TaskNewCommit added in v1.1.0

func (n Node) TaskNewCommit(uuid string) TaskNewResponse

TaskNewCommit POST: /task/new/commit/{uuid}

func (Node) TaskNewInit added in v1.1.0

func (n Node) TaskNewInit(jsonOptions []byte) TaskNewResponse

TaskNewInit POST: /task/new/init

func (Node) TaskNewUpload added in v1.1.0

func (n Node) TaskNewUpload(file string, uuid string, bar *pb.ProgressBar) error

TaskNewUpload POST: /task/new/upload/{uuid}

func (Node) TaskOutput

func (n Node) TaskOutput(uuid string, line int) ([]string, error)

TaskOutput GET: /task/<uuid>/output

func (Node) TryLogin

func (n Node) TryLogin(username string, password string) (token string, err error)

func (Node) URLFor

func (n Node) URLFor(path string) string

URLFor builds a URL path

type Option

type Option struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

Option is an option that can be passed to NodeODM

type OptionResponse

type OptionResponse struct {
	Domain interface{} `json:"domain"`
	Help   string      `json:"help"`
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Value  string      `json:"value"`
}

type StatusCode

type StatusCode struct {
	Code int `json:"code"`
}

type TaskInfoResponse

type TaskInfoResponse struct {
	ProcessingTime int        `json:"processingTime"`
	Status         StatusCode `json:"status"`
}

type TaskNewResponse

type TaskNewResponse struct {
	UUID  string `json:"uuid"`
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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