parser

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Verbs = []string{
		"get",
		"put",
		"add",
		"delete",
		"illuminate",
		"exit",
	}

	Objectives = []string{
		"vertex",
		"edge",
	}
	IlluminateObjectives = []string{
		"neighbor",
		"spt_relevance",
		"spt_cost",
		"mst_relevance",
		"mst_cost",
	}

	ErrNotFound = errors.New("not found")
	ErrNotEOF   = errors.New("not EOF")
)
View Source
var (
	ErrOutOfIndex = errors.New("out of index")
)
View Source
var ErrParse = errors.New("parse error")

Functions

func AnyOf

func AnyOf(s *Source, choices []string) (string, error)

func Bool

func Bool(s *Source) (bool, error)

func Datetime

func Datetime(s *Source) (time.Time, error)

func Duration

func Duration(s *Source) (time.Duration, error)

func EOF

func EOF(s *Source) error

func Float

func Float(s *Source) (float64, error)

func Float32

func Float32(s *Source) (float32, error)

func IlluminateObjective

func IlluminateObjective(s *Source) (string, error)

func Integer

func Integer(s *Source) (int, error)

func Objective

func Objective(s *Source) (string, error)

func String

func String(s *Source) (string, error)

func Validate

func Validate(input string) error

func Value

func Value(s *Source) (any, error)

func Verb

func Verb(s *Source) (string, error)

Types

type AddEdge

type AddEdge struct {
	Tail   string
	Head   string
	Weight float32
	TTL    time.Duration
}

func AddEdgeParam

func AddEdgeParam(s *Source) (*AddEdge, error)

type DeleteEdge

type DeleteEdge struct {
	Tail string
	Head string
}

func DeleteEdgeParam

func DeleteEdgeParam(s *Source) (*DeleteEdge, error)

type DeleteVertex

type DeleteVertex struct {
	Key string
}

func DeleteVertexParam

func DeleteVertexParam(s *Source) (*DeleteVertex, error)

type GetEdge

type GetEdge struct {
	Tail string
	Head string
}

func GetEdgeParam

func GetEdgeParam(s *Source) (*GetEdge, error)

type GetVertex

type GetVertex struct {
	Key string
}

func GetVertexParam

func GetVertexParam(s *Source) (*GetVertex, error)

type Illuminate

type Illuminate struct {
	Seed  string
	Step  int
	K     int
	Tfidf bool
}

func IlluminateParam

func IlluminateParam(s *Source) (*Illuminate, error)

type PutEdge

type PutEdge struct {
	Tail   string
	Head   string
	Weight float32
	TTL    time.Duration
}

func PutEdgeParam

func PutEdgeParam(s *Source) (*PutEdge, error)

type PutVertex

type PutVertex struct {
	Key   string
	Value any
	TTL   time.Duration
}

func PutVertexParam

func PutVertexParam(s *Source) (*PutVertex, error)

type Source

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

func NewSource

func NewSource(str string) *Source

func (*Source) HasNext

func (s *Source) HasNext() bool

func (*Source) Len

func (s *Source) Len() int

func (*Source) Next

func (s *Source) Next()

func (*Source) Peek

func (s *Source) Peek() (string, error)

func (*Source) Pos

func (s *Source) Pos() int

func (*Source) Reset

func (s *Source) Reset()

func (*Source) SetPos

func (s *Source) SetPos(pos int)

func (*Source) Slice

func (s *Source) Slice() []string

Jump to

Keyboard shortcuts

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