tagbrowser

package
v0.0.0-...-72cd24a Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 33 Imported by: 4

Documentation

Overview

silo

silo

silo

tagTypes.go

tagsbrowser.go

Index

Constants

This section is empty.

Variables

View Source
var BoundariesRegex = regexp.MustCompile("\\b|\\p{Z}+|\\p{C}|\\s+|\\/+|\\.+|\\\\+|_+")
View Source
var FragsRegex = regexp.MustCompile(`(\s+|,+|;+|:+|"+|'+|\.|/+|\+|-+|_+|=+|}+|{+|>+|<+|!+|\)+|\(+)`) //regexp.MustCompile("(\\/+|\\.+|\\\\+|\\-+|\\_+|_+|\\\\(|\\\\|\\p{Z}+|\\p{C}|\\s+|:|,|\"|{|}|>|<|!|))")
View Source
var FragsString = "\\b|\\p{Z}+|\\p{C}|\\s+|\\/+|\\.+|\\\\+|_+|\\\\(|\\\\)"
View Source
var RpcPath = "/rpc/json/"
View Source
var ServerAddress = "127.0.0.1:6781"

Functions

func Debugf

func Debugf(format string, args ...interface{})

Works like printf, but outputs to log

func Debugln

func Debugln(args ...interface{})

Works like println, but outputs to log

func InsertRecord

func InsertRecord(args *InsertArgs, reply *SuccessReply) error

func Launch

func Launch(file string, line string)

func NewNullLogger

func NewNullLogger() *logrus.Logger

NewNullLogger creates a discarding logger and installs the test hook.

func NewRPCRequest

func NewRPCRequest(r io.Reader) *rpcRequest

NewRPCRequest returns a new rpcRequest.

func ReSplit

func ReSplit(seps []string, in []string) []string

func RegSplit

func RegSplit(text string, reg *regexp.Regexp) []string

func StartServer

func StartServer()

Types

type Args

type Args struct {
	A     string
	Limit int
}

RPC

type Farm

type Farm struct {
	ShutdownStatus bool
	LockLog        chan string
	LogChan        map[string]chan string
	// contains filtered or unexported fields
}

func (*Farm) Shutdown

func (f *Farm) Shutdown()

func (*Farm) SubmitRecord

func (f *Farm) SubmitRecord(r RecordTransmittable)

type HistoReply

type HistoReply struct {
	TagsToFilesHisto map[string]int //Show how many files each tag points to
}

type InsertArgs

type InsertArgs struct {
	Name     string
	Position int
	Tags     []string
}

type Manor

type Manor struct {
	Farms []*Farm
	// contains filtered or unexported fields
}

func CreateManor

func CreateManor(config tomlConfig) *Manor

func (*Manor) Shutdown

func (m *Manor) Shutdown()

func (*Manor) SubmitRecord

func (m *Manor) SubmitRecord(r RecordTransmittable)

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Map[K, V]) Delete

func (m *Map[K, V]) Delete(key K)

func (*Map[K, V]) Load

func (m *Map[K, V]) Load(key K) (value V, ok bool)

func (*Map[K, V]) LoadAndDelete

func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)

func (*Map[K, V]) LoadOrStore

func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(f func(key K, value V) bool)

func (*Map[K, V]) Store

func (m *Map[K, V]) Store(key K, value V)

type RecordTransmittable

type RecordTransmittable struct {
	Filename    string
	Line        int
	Fingerprint []string
}

type Reply

type Reply struct {
	C []ResultRecordTransmittable
}

type ResultRecordTransmittable

type ResultRecordTransmittable struct {
	Filename    string
	Line        string
	Fingerprint []string
	Sample      string
	Score       string
}

type ResultRecordTransmittableCollection

type ResultRecordTransmittableCollection []ResultRecordTransmittable

func (ResultRecordTransmittableCollection) Len

func (ResultRecordTransmittableCollection) Less

func (ResultRecordTransmittableCollection) Swap

type SerialiseMe

type SerialiseMe struct {
	Id                   string
	Last_database_record int

	Database          []record //The in memory database, if any
	Counters          *Map[string, int]
	Next_string_index int
	Last_tag_record   int

	Reverse_string_table []string
	Tag2file             [][]*record
	Tag2record           [][]int

	Temporary     bool
	Offload_index int
	Offloading    bool
	MaxRecords    int
}

type SiloMetaData

type SiloMetaData struct {
	Next_string_index    uint64
	Last_database_record uint64
	// contains filtered or unexported fields
}

type SiloStore

type SiloStore interface {
	Init(silo *tagSilo)
	GetString(s *tagSilo, index int) string
	GetSymbol(silo *tagSilo, aStr string) int
	InsertRecord(silo *tagSilo, key []byte, aRecord record)
	InsertStringAndSymbol(silo *tagSilo, aStr string)
	Flush(silo *tagSilo)
	GetRecordId(tagID int) []int
	StoreRecordId(key, val []byte)
	GetRecord(key []byte) record
	StoreTagToRecord(recordId int, fp fingerPrint)
}

type SqlStore

type SqlStore struct {
	Db *sql.DB
}

func NewSQLStore

func NewSQLStore(filename string) *SqlStore

func (*SqlStore) Dbh

func (s *SqlStore) Dbh() *sql.DB

FIXME this needs to go, all access must be through member functions!

func (*SqlStore) Flush

func (s *SqlStore) Flush(silo *tagSilo)

func (*SqlStore) GetRecord

func (s *SqlStore) GetRecord(key []byte) record

func (*SqlStore) GetRecordId

func (s *SqlStore) GetRecordId(tagID int) []int

func (*SqlStore) GetString

func (store *SqlStore) GetString(s *tagSilo, index int) string

func (*SqlStore) GetSymbol

func (s *SqlStore) GetSymbol(silo *tagSilo, aStr string) int

func (*SqlStore) Init

func (s *SqlStore) Init(silo *tagSilo)

func (*SqlStore) InsertRecord

func (s *SqlStore) InsertRecord(silo *tagSilo, key []byte, aRecord record)

func (*SqlStore) InsertStringAndSymbol

func (s *SqlStore) InsertStringAndSymbol(silo *tagSilo, aStr string)

func (*SqlStore) StoreRecordId

func (s *SqlStore) StoreRecordId(key []byte, val []byte)

func (*SqlStore) StoreTagToRecord

func (s *SqlStore) StoreTagToRecord(recordId int, fp fingerPrint)

type StatusReply

type StatusReply struct {
	Answer map[string]string
}

type StringListReply

type StringListReply struct {
	C []string
}

type SuccessReply

type SuccessReply struct {
	Success bool
	Reason  string
}

type TagResponder

type TagResponder int

func (*TagResponder) Error

func (t *TagResponder) Error(args *Args, reply *Reply) error

func (*TagResponder) HistoStatus

func (t *TagResponder) HistoStatus(args *Args, reply *HistoReply) error

func (*TagResponder) InsertRecord

func (t *TagResponder) InsertRecord(args *InsertArgs, reply *SuccessReply) error

func (*TagResponder) PredictString

func (t *TagResponder) PredictString(args *Args, reply *StringListReply) error

func (*TagResponder) SearchString

func (t *TagResponder) SearchString(args *Args, reply *Reply) error

func (*TagResponder) Shutdown

func (t *TagResponder) Shutdown(args *Args, reply *SuccessReply) error

func (*TagResponder) Status

func (t *TagResponder) Status(args *Args, reply *StatusReply) error

func (*TagResponder) TopTagsStatus

func (t *TagResponder) TopTagsStatus(args *Args, reply *TopTagsReply) error

type TopTagsReply

type TopTagsReply struct {
	TopTags map[string]int //The number of files the top 10 tags point to
}

type WeaviateStore

type WeaviateStore struct {
	StringTable      *lsmkv.Bucket
	SymbolTable      *lsmkv.Bucket
	RecordTable      *lsmkv.Bucket
	TagToRecordTable *lsmkv.Bucket
	DirectoryName    string
}

func NewWeaviateStore

func NewWeaviateStore(dirname string) *WeaviateStore

func (*WeaviateStore) Dbh

func (store *WeaviateStore) Dbh() *sql.DB

func (*WeaviateStore) Flush

func (s *WeaviateStore) Flush(silo *tagSilo)

func (*WeaviateStore) GetRecord

func (s *WeaviateStore) GetRecord(key []byte) record

func (*WeaviateStore) GetRecordId

func (s *WeaviateStore) GetRecordId(tagID int) []int

func (*WeaviateStore) GetString

func (store *WeaviateStore) GetString(s *tagSilo, index int) string

func (*WeaviateStore) GetSymbol

func (s *WeaviateStore) GetSymbol(silo *tagSilo, aStr string) int

func (*WeaviateStore) Init

func (s *WeaviateStore) Init(silo *tagSilo)

func (*WeaviateStore) InsertRecord

func (s *WeaviateStore) InsertRecord(silo *tagSilo, key []byte, aRecord record)

func (*WeaviateStore) InsertStringAndSymbol

func (s *WeaviateStore) InsertStringAndSymbol(silo *tagSilo, aStr string)

func (*WeaviateStore) StoreRecordId

func (s *WeaviateStore) StoreRecordId(key []byte, val []byte)

func (*WeaviateStore) StoreTagToRecord

func (s *WeaviateStore) StoreTagToRecord(recordId int, fp fingerPrint)

Directories

Path Synopsis
entities
ent contains common types used throughout various lsmkv (sub-)packages
ent contains common types used throughout various lsmkv (sub-)packages
roaringset
The "roaringset" package contains all the LSM business logic that is unique to the "RoaringSet" strategy
The "roaringset" package contains all the LSM business logic that is unique to the "RoaringSet" strategy

Jump to

Keyboard shortcuts

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