service

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidObjective = errors.New("invalid objective")
	ErrInvalidVerb      = errors.New("invalid verb")
	ErrNotImplemented   = errors.New("not implemented")
	ErrGetVertex        = errors.New("get vertex error")
	ErrGetEdge          = errors.New("get edge error")
	ErrPutVertex        = errors.New("put vertex error")
	ErrPutEdge          = errors.New("put edge error")
	ErrDeleteVertex     = errors.New("delete vertex error")
	ErrDeleteEdge       = errors.New("delete edge error")
	ErrAddEdge          = errors.New("add edge error")
	ErrAddDecayingEdge  = errors.New("add decaying-edge error")
	ErrScan             = errors.New("scan error")
	ErrCount            = errors.New("count error")
	ErrDeletePrefix     = errors.New("delete-prefix error")
	ErrKeys             = errors.New("keys error")
	ErrSearch           = errors.New("search error")
	ErrBFS              = errors.New("bfs error")
	ErrPagerank         = errors.New("pagerank error")
	ErrCommunity        = errors.New("community error")
	ErrHelp             = errors.New("help error")
	ErrConnection       = errors.New("connection error")
)

Functions

func BfsOption added in v0.32.0

func BfsOption(step, fanOut uint32, red client.Reduction, obj client.Objective) client.IlluminateOption

BfsOption / PagerankOption / CommunityOption build the typed per-family SDK option from CLI-resolved knobs (#846 oneof, #975 verb split). Each family verb owns exactly the knobs its wire arm understands: bfs carries step/fan_out plus the tree reduction, pagerank carries top_n plus the α/ε push knobs (no reduction — its relevance star is already a tree), and community carries max_size plus α/ε and an optional tree reduction (#845). Shared by the REPL dispatcher and the cobra family subcommands so both surfaces translate identically.

func CommunityOption added in v0.32.0

func CommunityOption(maxSize uint32, red client.Reduction, obj client.Objective, restartProb, epsilon float32) client.IlluminateOption

func PagerankOption added in v0.32.0

func PagerankOption(topN uint32, restartProb, epsilon float32) client.IlluminateOption

Types

type CLIService

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

CLIService owns the shared REPL/one-shot dispatcher and its output sink. Feature-specific execution stays in coherent siblings such as search.go.

func NewCLIService

func NewCLIService(client *client.Lantern, opts ...Option) *CLIService

func (*CLIService) Run

func (c *CLIService) Run(ctx context.Context, str string) error

func (*CLIService) RunArgs added in v0.16.0

func (c *CLIService) RunArgs(ctx context.Context, args []string) error

RunArgs dispatches an already-split token stream (verb + arguments) through the same grammar the REPL parses from a raw line. The one-shot verb-first CLI commands (`lantern-cli get vertex <key>`, …) call this with cobra's argv so the one-liner surface and the REPL share exactly one grammar and one dispatcher (#672).

func (*CLIService) RunSearch added in v0.33.0

func (c *CLIService) RunSearch(ctx context.Context, command parser.Search) error

RunSearch is the one request/output implementation shared by the raw REPL grammar and the top-level Cobra search command. JSON is a single bounded page document; all=true resolves to NDJSON unless the caller explicitly selected TSV, so exhaustive output is streamed rather than accumulated.

type Option added in v0.33.0

type Option func(*CLIService)

Option configures CLIService without splitting the REPL and one-shot execution paths. WithOutput is primarily used by Cobra and tests; the REPL keeps stdout as its default.

func WithOutput added in v0.33.0

func WithOutput(w io.Writer) Option

Jump to

Keyboard shortcuts

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