builder

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataDel = iota
	DataAddOrUpdate
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo added in v0.0.11

type BuildInfo struct {
	TotalNumber     int64            `json:"total_num"`
	ErrorNumber     int64            `json:"error_num"`
	AddNum          int64            `json:"add_num,"`
	DeleteNum       int64            `json:"delete_num,"`
	MergeTime       time.Duration    `json:"merge_time,"`
	LastBaseUpdated time.Time        `json:"last_base_updated,omitempty"`
	LastIncUpdated  time.Time        `json:"last_inc_updated,omitempty"`
	IndexInfo       *index.IndexInfo `json:"index_info,omitempty"`
}

type Builder

type Builder interface {
	Build(ctx context.Context) error
	GetIndex() index.Index
	GetBuilderInfo() *BuildInfo
}

type DataMod

type DataMod int

type MongoIndexBuilder

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

func NewMongoIndexBuilder

func NewMongoIndexBuilder(ops *MongoIndexManagerOps) (*MongoIndexBuilder, error)

func (*MongoIndexBuilder) Build

func (mib *MongoIndexBuilder) Build(ctx context.Context, name string) error

func (*MongoIndexBuilder) GetBuilderInfo added in v0.0.11

func (mib *MongoIndexBuilder) GetBuilderInfo() *BuildInfo

func (*MongoIndexBuilder) GetIndex

func (mib *MongoIndexBuilder) GetIndex() index.Index

func (*MongoIndexBuilder) Info added in v0.0.9

func (mib *MongoIndexBuilder) Info(s string, d time.Duration) string

func (*MongoIndexBuilder) InfoStatus

func (mib *MongoIndexBuilder) InfoStatus(s string, d time.Duration)

func (*MongoIndexBuilder) WarnStatus

func (mib *MongoIndexBuilder) WarnStatus(s string, d time.Duration)

type MongoIndexManagerOps

type MongoIndexManagerOps struct {
	Name           string
	IncInterval    int
	BaseInterval   int
	URI            string
	DB             string
	Collection     string
	ConnectTimeout int
	ReadTimeout    int
	BaseParser     MongoParser
	IncParser      MongoParser
	BaseQuery      interface{}
	IncQuery       interface{}
	UserData       interface{}
	FindOpt        *options.FindOptions
	Logger         log.Logger
	OnBeforeBase   func(interface{}) interface{}
	OnBeforeInc    func(interface{}) interface{}
	OnFinishBase   func(interface{})
	OnFinishInc    func(interface{})
}

type MongoParser

type MongoParser interface {
	Parse([]byte, interface{}) *ParserResult
}

type ParserResult

type ParserResult struct {
	DataMod DataMod
	Value   *document.DocInfo
}

Jump to

Keyboard shortcuts

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