Versions in this module Expand all Collapse all v1 v1.0.1 Dec 2, 2020 v1.0.0 Dec 2, 2020 Changes in this version + const DefaultCreateQueryFormat + const DefaultListQueryFormat + const IndexActionReasonCreate + const IndexActionReasonDropExcess + const IndexActionReasonNoop + const IndexActionReasonRecreateConditionMismatch + const IndexActionReasonRecreateForced + const IndexActionReasonRecreateIndexKeysMismatch + const IndexActionReasonRecreateKeyspaceIDMismatch + const IndexDefaultUsing + func DefaultIndexCreateFunc(cluster *gocb.Cluster, def IndexDefinition) (*gocb.QueryResult, error) + func DefaultIndexDropFunc(cluster *gocb.Cluster, def IndexDefinition) error + type ActionListFinalizerFunc func(actions []*IndexActionDecision, defMap *IndexDefinitionMap) ([]*IndexActionDecision, error) + type DecisionFunc func(current *IndexDefinition, defMap *IndexDefinitionMap) (*IndexActionDecision, error) + type IndexAction string + const IndexActionCreate + const IndexActionDrop + const IndexActionNoop + const IndexActionRecreate + type IndexActionDecision struct + Action IndexAction + ActionReason string + CurrentDefinition *IndexDefinition + IndexName string + NewDefinition *IndexDefinition + func DefaultActionListFinalizerFunc(actions []*IndexActionDecision, _ *IndexDefinitionMap) ([]*IndexActionDecision, error) + func DefaultDecisionFunc(current *IndexDefinition, defMap *IndexDefinitionMap) (*IndexActionDecision, error) + type IndexCreateFunc func(cluster *gocb.Cluster, def IndexDefinition) (*gocb.QueryResult, error) + type IndexDefinition struct + Condition string + DeferBuild bool + ForceRebuild bool + IndexKey []string + KeyspaceID string + Name string + NumReplica uint + Using string + type IndexDefinitionMap struct + func NewIndexDefinitionMap(defs ...*IndexDefinition) (*IndexDefinitionMap, error) + func (dm *IndexDefinitionMap) Clear() + func (dm *IndexDefinitionMap) Get(name string) (IndexDefinition, bool) + func (dm *IndexDefinitionMap) Map() map[string]IndexDefinition + func (dm *IndexDefinitionMap) NameList() []string + func (dm *IndexDefinitionMap) Register(defs ...*IndexDefinition) error + func (dm *IndexDefinitionMap) Unregister(name string) bool + type IndexDropFunc func(cluster *gocb.Cluster, def IndexDefinition) error + type IndexLocatorFunc func(*gocb.Cluster) ([]*IndexDefinition, error) + func PrefixIndexLocatorFunc(idxPrefix string, opts *gocb.QueryOptions) IndexLocatorFunc + type ReconcileResults struct + ActionList []*IndexActionDecision + CreatedCount int + CreatedNames []string + DroppedCount int + DroppedNames []string + Err error + FinalCount int + FinalNames []string + InitialCount int + InitialNames []string + NoopCount int + NoopNames []string + func (r ReconcileResults) Error() string + func (r ReconcileResults) String() string + type Reconciler struct + func NewReconciler(conf *ReconcilerConfig) (*Reconciler, error) + func (rc *Reconciler) Definitions() *IndexDefinitionMap + func (rc *Reconciler) Execute() (*ReconcileResults, error) + func (rc *Reconciler) RegisterDefinitions(defs ...*IndexDefinition) error + type ReconcilerConfig struct + ActionListFinalizerFunc ActionListFinalizerFunc + Cluster *gocb.Cluster + Debug bool + DecisionFunc DecisionFunc + IndexCreateFunc IndexCreateFunc + IndexDefinitionMap *IndexDefinitionMap + IndexDropFunc IndexDropFunc + IndexLocatorFunc IndexLocatorFunc + Logger *log.Logger + func DefaultReconcilerConfig(cluster *gocb.Cluster, idxLocator IndexLocatorFunc) *ReconcilerConfig