...

Source file src/edge-infra.dev/pkg/edge/datasync/apis/v1alpha1/replicationset.go

Documentation: edge-infra.dev/pkg/edge/datasync/apis/v1alpha1

     1  package v1alpha1
     2  
     3  // Provider information about the data provider
     4  type Provider struct {
     5  	Name string `json:"name"`
     6  }
     7  
     8  func (p *Provider) Empty() bool {
     9  	if p != nil {
    10  		return p.Name == ""
    11  	}
    12  	return true
    13  }
    14  
    15  func (p *Provider) Equal(p2 *Provider) bool {
    16  	if p == nil && p2 == nil {
    17  		return true
    18  	}
    19  	if p != nil && p2 != nil && p.Name == p2.Name {
    20  		return true
    21  	}
    22  	return false
    23  }
    24  
    25  // ReplConfig CouchDB replication settings from https://docs.couchdb.org/en/stable/json-structure.html?highlight=checkpoint_interval#replication-settings
    26  type ReplConfig struct {
    27  	Interval       string   `json:"interval"`
    28  	Cancel         bool     `json:"cancel"`
    29  	Continuous     bool     `json:"continuous"`
    30  	CreateTarget   bool     `json:"create_target"`
    31  	DocIDs         []string `json:"doc_ids"`
    32  	Filter         string   `json:"filter"`
    33  	SourceProxy    string   `json:"source_proxy"`
    34  	TargetProxy    string   `json:"target_proxy"`
    35  	QueryParams    string   `json:"query_params"` // TODO
    36  	Selector       string   `json:"selector"`
    37  	SinceSeq       string   `json:"since_seq"`
    38  	UseCheckpoints bool     `json:"use_checkpoints"`
    39  }
    40  
    41  // Dataset represents a database and associated configuration
    42  type Dataset struct {
    43  	Name             string     `json:"name"`
    44  	Provider         *Provider  `json:"provider,omitempty"`
    45  	Config           ReplConfig `json:"config"`
    46  	EnterpriseUnitID string     `json:"enterprise_unit_id,omitempty"`
    47  	Stores           []string   `json:"stores,omitempty"`
    48  	Touchpoints      []string   `json:"touchpoints,omitempty"`
    49  	Deleted          bool       `json:"deleted,omitempty"`
    50  }
    51  
    52  // ReplicationSet represents all replications for stores and touchpoints whithin a banner
    53  type ReplicationSet struct {
    54  	Providers []Provider `json:"providers"`
    55  	Datasets  []Dataset  `json:"datasets"`
    56  }
    57  

View as plain text