search

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSearch = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSearch   = fmt.Errorf("proto: integer overflow")
)
View Source
var Search_Status_name = map[int32]string{
	0: "Queued",
	1: "Started",
	2: "Completed",
}
View Source
var Search_Status_value = map[string]int32{
	"Queued":    0,
	"Started":   1,
	"Completed": 2,
}

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Queue   *queue.Queue
	List    map[string]*Search
	Plugins *repo.Repo
	Themes  *repo.Repo

	Loaded bool
	sync.RWMutex
	// contains filtered or unexported fields
}

Manager controls the processing and storage of searches

func NewManager

func NewManager(limit int) *Manager

NewManager returns a new SearchManager struct

func (*Manager) Empty

func (sm *Manager) Empty() error

Empty ...

func (*Manager) Exists

func (sm *Manager) Exists(ID string) bool

Exists ...

func (*Manager) Get

func (sm *Manager) Get(ID string) Search

Get ...

func (*Manager) IsLoaded

func (sm *Manager) IsLoaded() bool

IsLoaded ...

func (*Manager) NewSearch

func (sm *Manager) NewSearch(sr Request) string

NewSearch ...

func (*Manager) Set

func (sm *Manager) Set(s *Search)

Set ...

func (*Manager) Worker

func (sm *Manager) Worker()

Worker ...

type Match

type Match struct {
	Slug     string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"`
	File     string `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
	LineNum  uint32 `protobuf:"varint,3,opt,name=line_num,json=lineNum,proto3" json:"line_num,omitempty"`
	LineText string `protobuf:"bytes,4,opt,name=line_text,json=lineText,proto3" json:"line_text,omitempty"`
}

func (*Match) Descriptor

func (*Match) Descriptor() ([]byte, []int)

func (*Match) Marshal

func (m *Match) Marshal() (dAtA []byte, err error)

func (*Match) MarshalTo

func (m *Match) MarshalTo(dAtA []byte) (int, error)

func (*Match) ProtoMessage

func (*Match) ProtoMessage()

func (*Match) Reset

func (m *Match) Reset()

func (*Match) Size

func (m *Match) Size() (n int)

func (*Match) String

func (this *Match) String() string

func (*Match) Unmarshal

func (m *Match) Unmarshal(dAtA []byte) error

func (*Match) XXX_DiscardUnknown

func (m *Match) XXX_DiscardUnknown()

func (*Match) XXX_Marshal

func (m *Match) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Match) XXX_Merge

func (dst *Match) XXX_Merge(src proto.Message)

func (*Match) XXX_Size

func (m *Match) XXX_Size() int

func (*Match) XXX_Unmarshal

func (m *Match) XXX_Unmarshal(b []byte) error

type MatchList

type MatchList struct {
	List map[string]*Matches
	sync.RWMutex
}

MatchList ...

type Matches

type Matches struct {
	List []*Match `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}

func (*Matches) Descriptor

func (*Matches) Descriptor() ([]byte, []int)

func (*Matches) Marshal

func (m *Matches) Marshal() (dAtA []byte, err error)

func (*Matches) MarshalTo

func (m *Matches) MarshalTo(dAtA []byte) (int, error)

func (*Matches) ProtoMessage

func (*Matches) ProtoMessage()

func (*Matches) Reset

func (m *Matches) Reset()

func (*Matches) Size

func (m *Matches) Size() (n int)

func (*Matches) String

func (this *Matches) String() string

func (*Matches) Unmarshal

func (m *Matches) Unmarshal(dAtA []byte) error

func (*Matches) XXX_DiscardUnknown

func (m *Matches) XXX_DiscardUnknown()

func (*Matches) XXX_Marshal

func (m *Matches) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Matches) XXX_Merge

func (dst *Matches) XXX_Merge(src proto.Message)

func (*Matches) XXX_Size

func (m *Matches) XXX_Size() int

func (*Matches) XXX_Unmarshal

func (m *Matches) XXX_Unmarshal(b []byte) error

type Options

type Options struct {
	IgnoreCase     bool   `protobuf:"varint,1,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
	LinesOfContext uint32 `protobuf:"varint,2,opt,name=lines_of_context,json=linesOfContext,proto3" json:"lines_of_context,omitempty"`
	FileRegexp     string `protobuf:"bytes,3,opt,name=file_regexp,json=fileRegexp,proto3" json:"file_regexp,omitempty"`
	IgnoreComments bool   `protobuf:"varint,4,opt,name=ignore_comments,json=ignoreComments,proto3" json:"ignore_comments,omitempty"`
	Offset         uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit          uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"`
}

func (*Options) Descriptor

func (*Options) Descriptor() ([]byte, []int)

func (*Options) Marshal

func (m *Options) Marshal() (dAtA []byte, err error)

func (*Options) MarshalTo

func (m *Options) MarshalTo(dAtA []byte) (int, error)

func (*Options) ProtoMessage

func (*Options) ProtoMessage()

func (*Options) Reset

func (m *Options) Reset()

func (*Options) Size

func (m *Options) Size() (n int)

func (*Options) String

func (this *Options) String() string

func (*Options) Unmarshal

func (m *Options) Unmarshal(dAtA []byte) error

func (*Options) XXX_DiscardUnknown

func (m *Options) XXX_DiscardUnknown()

func (*Options) XXX_Marshal

func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Options) XXX_Merge

func (dst *Options) XXX_Merge(src proto.Message)

func (*Options) XXX_Size

func (m *Options) XXX_Size() int

func (*Options) XXX_Unmarshal

func (m *Options) XXX_Unmarshal(b []byte) error

type Request

type Request struct {
	Input   string
	Repo    string
	Private bool
	Time    time.Time
	Opts    Options
}

Request ...

type Result

type Result struct {
	Slug           string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"`
	Name           string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version        string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Homepage       string `protobuf:"bytes,4,opt,name=homepage,proto3" json:"homepage,omitempty"`
	ActiveInstalls uint32 `protobuf:"varint,5,opt,name=active_installs,json=activeInstalls,proto3" json:"active_installs"`
	Matches        uint32 `protobuf:"varint,6,opt,name=matches,proto3" json:"matches"`
}

func (*Result) Descriptor

func (*Result) Descriptor() ([]byte, []int)

func (*Result) Marshal

func (m *Result) Marshal() (dAtA []byte, err error)

func (*Result) MarshalTo

func (m *Result) MarshalTo(dAtA []byte) (int, error)

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) Size

func (m *Result) Size() (n int)

func (*Result) String

func (this *Result) String() string

func (*Result) Unmarshal

func (m *Result) Unmarshal(dAtA []byte) error

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (dst *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error
type Search struct {
	ID        string        `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Input     string        `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
	Repo      string        `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"`
	Started   string        `protobuf:"bytes,4,opt,name=started,proto3" json:"started,omitempty"`
	Completed string        `protobuf:"bytes,5,opt,name=completed,proto3" json:"completed,omitempty"`
	Progress  uint32        `protobuf:"varint,6,opt,name=progress,proto3" json:"progress,omitempty"`
	Private   bool          `protobuf:"varint,7,opt,name=private,proto3" json:"private,omitempty"`
	Status    Search_Status `protobuf:"varint,8,opt,name=status,proto3,enum=search.Search_Status" json:"status,omitempty"`
	Options   *Options      `protobuf:"bytes,9,opt,name=options" json:"options,omitempty"`
	Matches   uint32        `protobuf:"varint,10,opt,name=matches,proto3" json:"matches"`
	Revision  uint32        `protobuf:"varint,11,opt,name=revision,proto3" json:"revision,omitempty"`
}

func (*Search) Descriptor

func (*Search) Descriptor() ([]byte, []int)

func (*Search) Marshal

func (m *Search) Marshal() (dAtA []byte, err error)

func (*Search) MarshalTo

func (m *Search) MarshalTo(dAtA []byte) (int, error)

func (*Search) ProtoMessage

func (*Search) ProtoMessage()

func (*Search) Reset

func (m *Search) Reset()

func (*Search) Size

func (m *Search) Size() (n int)

func (*Search) String

func (this *Search) String() string

func (*Search) Unmarshal

func (m *Search) Unmarshal(dAtA []byte) error

func (*Search) XXX_DiscardUnknown

func (m *Search) XXX_DiscardUnknown()

func (*Search) XXX_Marshal

func (m *Search) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Search) XXX_Merge

func (dst *Search) XXX_Merge(src proto.Message)

func (*Search) XXX_Size

func (m *Search) XXX_Size() int

func (*Search) XXX_Unmarshal

func (m *Search) XXX_Unmarshal(b []byte) error

type Search_Status

type Search_Status int32
const (
	Queued    Search_Status = 0
	Started   Search_Status = 1
	Completed Search_Status = 2
)

func (Search_Status) EnumDescriptor

func (Search_Status) EnumDescriptor() ([]byte, []int)

func (Search_Status) String

func (x Search_Status) String() string

type Summary

type Summary struct {
	Total uint64             `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	List  map[string]*Result `` /* 135-byte string literal not displayed */
}

func (*Summary) Descriptor

func (*Summary) Descriptor() ([]byte, []int)

func (*Summary) Marshal

func (m *Summary) Marshal() (dAtA []byte, err error)

func (*Summary) MarshalTo

func (m *Summary) MarshalTo(dAtA []byte) (int, error)

func (*Summary) ProtoMessage

func (*Summary) ProtoMessage()

func (*Summary) Reset

func (m *Summary) Reset()

func (*Summary) Size

func (m *Summary) Size() (n int)

func (*Summary) String

func (this *Summary) String() string

func (*Summary) Unmarshal

func (m *Summary) Unmarshal(dAtA []byte) error

func (*Summary) XXX_DiscardUnknown

func (m *Summary) XXX_DiscardUnknown()

func (*Summary) XXX_Marshal

func (m *Summary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Summary) XXX_Merge

func (dst *Summary) XXX_Merge(src proto.Message)

func (*Summary) XXX_Size

func (m *Summary) XXX_Size() int

func (*Summary) XXX_Unmarshal

func (m *Summary) XXX_Unmarshal(b []byte) error

type SummaryList

type SummaryList struct {
	List  map[string]*Result
	Total uint64
	sync.RWMutex
}

SummaryList ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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