search

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOCUMENT_NODE    = "node"
	DOCUMENT_STACK   = "stack"
	DOCUMENT_SERVICE = "service"
	DOCUMENT_TASK    = "task"
	DOCUMENT_NETWORK = "network"
	DOCUMENT_VOLUME  = "volume"
)
View Source
const (
	//Search
	CodeInvalidSearchKeywords = "503-13001"
)
View Source
const (
	RESULT_LEN = 10
)
View Source
const SEARCH_LOAD_DATA_INTERVAL = 1

Variables

This section is empty.

Functions

func Init

func Init()

Types

type CraneIndexer

type CraneIndexer struct {
	Indexer

	CraneDockerClient *dockerclient.CraneDockerClient
}

func NewCraneIndex

func NewCraneIndex(CraneDockerClient *dockerclient.CraneDockerClient) *CraneIndexer

func (*CraneIndexer) Index

func (indexer *CraneIndexer) Index(store *DocumentStorage)

type Document

type Document struct {
	ID      string
	Name    string
	Type    string
	GroupId uint64 `json:"-"`
	Param   map[string]string
}

type DocumentStorage

type DocumentStorage struct {
	Store map[string]Document
}

func NewDocumentStorage

func NewDocumentStorage() *DocumentStorage

func (*DocumentStorage) Copy

func (storage *DocumentStorage) Copy() *DocumentStorage

func (*DocumentStorage) Empty

func (storage *DocumentStorage) Empty()

func (*DocumentStorage) Get

func (storage *DocumentStorage) Get(key string) *Document

func (*DocumentStorage) Indices

func (storage *DocumentStorage) Indices() []string

func (*DocumentStorage) Set

func (storage *DocumentStorage) Set(key string, doc Document)

type Indexer

type Indexer interface {
	Index(prefetchStore *DocumentStorage)
}

type SearchApi

type SearchApi struct {
	Index         []string
	Store         *DocumentStorage
	PrefetchStore *DocumentStorage

	Indexer Indexer
}

func (*SearchApi) ApiRegister

func (searchApi *SearchApi) ApiRegister(router *gin.Engine, middlewares ...gin.HandlerFunc)

func (*SearchApi) IndexData

func (searchApi *SearchApi) IndexData()

func (*SearchApi) Search

func (searchApi *SearchApi) Search(ctx *gin.Context)

Jump to

Keyboard shortcuts

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