iface

package
v0.0.0-...-4334ecd Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDateRangeFacet

type IDateRangeFacet interface {
	Name() string
	Start() string
	End() string
	Count() int
}

type IDocument

type IDocument interface {
	ID() string
	Score() float64
	Index() string
}

type IFacet

type IFacet interface {
	Name() string
	Field() string
	Total() int
	Missing() int
	Other() int
	Terms() []ITerm
	NumericRanges() []INumericRangeFacet
	DateRanges() []IDateRangeFacet
}

type IIndexStorage

type IIndexStorage interface {
	RunGC()
	Close() error
	IndexStorageName() string
	Open(path string, secretKey []byte, configuration interface{}) error

	DefaultIndexMeta(namespace string) error
	UpsertIndexMeta(meta *pb.IndexMeta) error
	DeleteIndexMeta(meta *pb.IndexMeta) error

	CustomIndexRule(namespace string, indexRule interface{}) error

	CanIndex(namespace string) bool
	ApplyIndex(namespace string, data []*variant.IndexData) error

	GlobalSearch(ctx context.Context, input *pb.GlobalSearchInput) (IIndexStorageSearchResult, error)
}

type IIndexStorageSearchResult

type IIndexStorageSearchResult interface {
	RawResult() interface{}
	ToMap() map[string]interface{}
	ToBytes() []byte
	ToSearchResponse() ISearchResponse
}

type INodeConfiguration

type INodeConfiguration interface {
	/*Dragonboat NodeHostConfig*/
	DeploymentID() uint64
	WALDir() string
	NodeHostDir() string
	RTTMillisecond() uint64
	RaftAddress() string
	ListenAddress() string
	MutualTLS() bool
	CAFile() string
	CertFile() string
	KeyFile() string
	MaxSendQueueSize() uint64
	MaxReceiveQueueSize() uint64

	EnableMetrics() bool
	MaxSnapshotSendBytesPerSecond() uint64
	MaxSnapshotRecvBytesPerSecond() uint64

	LogDBFactory() config.LogDBFactoryFunc
	RaftRPCFactory() config.RaftRPCFactoryFunc

	NotifyCommit() bool
	LogDB() config.LogDBConfig

	SystemTickerPrecision() time.Duration
	RaftEventListener() raftio.IRaftEventListener
	SystemEventListener() raftio.ISystemEventListener
}

type INumericRangeFacet

type INumericRangeFacet interface {
	Name() string
	Min() float64
	Max() float64
	Count() int
}

type IOnDiskClusterConfiguration

type IOnDiskClusterConfiguration interface {
	// Join defines the join flag for on disk cluster
	// configuration
	Join() bool

	// ClusterID method contains cluster id
	ClusterID() uint64

	// ClusterName method contains cluster name
	ClusterName() string

	// InitialMembers method defines all initial members of the cluster
	InitialMembers() map[uint64]string

	// StateMachine method return a method which returns storaged state machine
	StateMachine(IStoragedConfiguration) func(uint64, uint64) IStoraged
}

IOnDiskClusterConfiguration interface defines on disk cluster configuration

type IPasswordHashAlgorithm

type IPasswordHashAlgorithm interface {
	Algorithm() string

	Encode(password string, salt string) (string, error)
	Verify(password string, encoded string) (bool, error)
}

type IPasswordHashAlgorithmFactory

type IPasswordHashAlgorithmFactory interface {
	IsAlgorithmAvailable(algorithm string) bool
	AppendPasswordHashAlgorithm(pha IPasswordHashAlgorithm)

	CheckPassword(password, encoded string) (bool, error)
	MakePassword(password, salt, algorithm string) (string, error)
}

type IRaftConfiguration

type IRaftConfiguration interface {
	NodeID() uint64
	CheckQuorum() bool
	ElectionRTT() uint64
	HeartbeatRTT() uint64
	SnapshotEntries() uint64
	CompactionOverhead() uint64
	OrderedConfigChange() bool
	MaxInMemLogSize() uint64
	//SnapshotCompressionType() string
	//EntryCompressionType() string
	DisableAutoCompactions() bool

	IsObserver() bool
	IsWitness() bool
	Quiesce() bool
}

type IReader

type IReader interface {
	Read(clusterID uint64,
		query interface{},
		timeout time.Duration) (interface{}, error)
}

type IReaderWriter

type IReaderWriter interface {
	IReader
	IWriter
}

type ISearchResponse

type ISearchResponse interface {
	Total() uint64
	MaxScore() float64
	Took() time.Duration
	Hits() []IDocument
	Facets() []IFacet
}

type IStateContext

type IStateContext interface {
	GetForwardIterator() IStateIterator
	GetReverseIterator() IStateIterator
	GetKeyOnlyForwardIterator() IStateIterator
	GetKeyOnlyReverseIterator() IStateIterator

	GetState(address []byte) (*pb.StateEntry, error)
	UpsertState(address []byte, entry *pb.StateEntry) error
	DeleteState(address []byte) error

	UpsertIndex(id string, data interface{}) error
	DeleteIndex(id string) error

	//AutoIndexMeta() bool
	//CanIndex(namespace string) bool
	UpsertIndexMeta(meta *pb.IndexMeta) error
	DeleteIndexMeta(meta *pb.IndexMeta) error
	DefaultIndexMeta(namespace string) error
}

type IStateIterator

type IStateIterator interface {
	Next()
	Close()
	Valid() bool
	Rewind()
	Seek(address []byte)
	StateSnapshot() *pb.StateSnapshot
	ValidForPrefix(prefix []byte) bool
}

type IStateStorage

type IStateStorage interface {
	RunGC()
	Open() error
	Close() error
	StateStorageName() string
	NewTransaction() IStateStorageTransaction
	NewReadOnlyTransaction() IStateStorageTransaction
	Setup(path string, secretKey []byte, configuration interface{})
	ChangeSecretKey(path string, oldSecretKey []byte, newSecretKey []byte,
		encryptionKeyRotationDuration time.Duration) error
}

type IStateStorageIterator

type IStateStorageIterator interface {
	Next()
	Close()
	Valid() bool
	Rewind()
	Seek(address []byte)
	StateSnapshot() *pb.StateSnapshot
	ValidForPrefix(prefix []byte) bool
}

type IStateStorageTransaction

type IStateStorageTransaction interface {
	Discard()
	Commit() error
	Delete(address []byte) error
	Get(address []byte) ([]byte, error)
	Set(address []byte, data []byte) error

	ForwardIterator() IStateStorageIterator
	ReverseIterator() IStateStorageIterator
	KeyOnlyForwardIterator() IStateStorageIterator
	KeyOnlyReverseIterator() IStateStorageIterator
}

type IStorage

type IStorage interface {
	RunGC()
	Open() error
	Close() error

	SetConfiguration(configuration IStorageConfiguration) bool

	ChangeSecretKey(path string,
		oldSecretKey []byte,
		newSecretKey []byte,
		encryptionKeyRotationDuration time.Duration) error

	PrepareSnapshot() (interface{}, error)
	RecoverFromSnapshot(r io.Reader) error
	SaveSnapshot(snapshotContext interface{}, w io.Writer) error

	SaveAppliedIndex(u uint64) error
	QueryAppliedIndex() (uint64, error)

	GetAppliedIndex(ctx context.Context) (interface{}, error)

	Search(ctx context.Context, search *pb.SearchInput) (interface{}, error)
	Iterate(ctx context.Context, iterate *pb.IterateInput) (interface{}, error)
	Retrieve(ctx context.Context, retrieve *pb.RetrieveInput) (interface{}, error)

	GlobalSearch(ctx context.Context, globalSearch *pb.GlobalSearchInput) (interface{}, error)
	GlobalIterate(ctx context.Context, globalIterate *pb.GlobalIterateInput) (interface{}, error)
	GlobalRetrieve(ctx context.Context, globalRetrieve *pb.GlobalRetrieveInput) (interface{}, error)

	ApplyProposal(ctx context.Context, proposal *pb.Proposal, entryIndex uint64) *pb.ProposalResponse

	UpsertIndexMeta(meta *pb.IndexMeta) error
	DeleteIndexMeta(meta *pb.IndexMeta) error
	CanIndex(namespace string) bool
	IndexEnable() bool
	AutoIndexMeta() bool
	DefaultIndexMeta(namespace string) error
	CustomIndexRule(namespace string, indexRule interface{}) error
}

type IStorageConfiguration

type IStorageConfiguration interface {
	/*Storage Config*/
	CacheSize() int
	BatchSize() int
	QueueSize() int

	IndexEnable() bool
	AutoIndexMeta() bool
	AutoBuildIndex() bool

	StorageTaskQueue() variant.TaskQueue

	StateStoragePath() string
	StateStorageSecretKey() []byte

	IndexStoragePath() string
	IndexStorageSecretKey() []byte

	StoragePluginState() IStateStorage
	StoragePluginIndex() IIndexStorage

	StateStorageCustomConfiguration() interface{}
	IndexStorageCustomConfiguration() interface{}

	AddTransactionProcessor(tp ITransactionProcessor)
	IsTransactionProcessorExists(family, version string) bool
	GetTransactionProcessor(family, version string) ITransactionProcessor

	ProposalReceiver(proposal *pb.Proposal, status pb.Status)
}

type IStoraged

type IStoraged interface {
	Sync() error
	Close() error
	Open(<-chan struct{}) (uint64, error)

	Update(entries []sm.Entry) ([]sm.Entry, error)
	Lookup(input interface{}) (interface{}, error)

	SetConfiguration(configuration IStoragedConfiguration) bool

	PrepareSnapshot() (interface{}, error)
	SaveSnapshot(snapshotContext interface{}, w io.Writer, done <-chan struct{}) error
	RecoverFromSnapshot(r io.Reader, done <-chan struct{}) error
}

type IStoragedConfiguration

type IStoragedConfiguration interface {
	IStorageConfiguration
}

type ITerm

type ITerm interface {
	Term() string
	Count() int
}

type ITransactionProcessor

type ITransactionProcessor interface {
	FamilyName() string
	FamilyVersion() string
	IndexObject(statePayload []byte) interface{}

	Search(ctx context.Context,
		readOnlyStateContext IStateContext,
		searchInput *pb.SearchInput) (interface{}, error)
	Iterate(ctx context.Context,
		readOnlyStateContext IStateContext,
		iterateInput *pb.IterateInput) (interface{}, error)
	Retrieve(ctx context.Context,
		readOnlyStateContext IStateContext,
		retrieveInput *pb.RetrieveInput) (interface{}, error)

	Apply(ctx context.Context,
		stateContext IStateContext,
		transaction *pb.Transaction) *pb.TransactionResponse
}

type IWriter

type IWriter interface {
	Write(clusterID uint64,
		pp *pb.Proposal,
		timeout time.Duration) (sm.Result, error)
}

Jump to

Keyboard shortcuts

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