Documentation ¶
Index ¶
- Constants
- Variables
- type DataType
- type JoinRequest
- type JoinResponse
- type ReplProviderSilo
- func (rpl *ReplProviderSilo) Close()
- func (rpl *ReplProviderSilo) SendEventsAfter(csn string, peer *ReplicationPeer, transport *http.Transport, serverId uint16, ...) (string, error)
- func (rpl *ReplProviderSilo) StoreEvent(event ReplicationEvent) (*bytes.Buffer, error)
- func (rpl *ReplProviderSilo) WriteBacklogEvents(csn string, peer *ReplicationPeer, w http.ResponseWriter, domainCode string) (string, error)
- type ReplSilo
- func (rl *ReplSilo) AddReceivedJoinReq(req JoinRequest) error
- func (rl *ReplSilo) AddReplicationPeer(req *ReplicationPeer) error
- func (rl *ReplSilo) AddSentJoinReq(req JoinRequest) error
- func (rl *ReplSilo) Close()
- func (rl *ReplSilo) DeleteReceivedJoinRequest(serverId uint16) error
- func (rl *ReplSilo) DeleteReplicationPeer(serverId uint16) error
- func (rl *ReplSilo) DeleteSentJoinRequest(serverId uint16) error
- func (rl *ReplSilo) GetReceivedJoinRequest(serverId uint16) *JoinRequest
- func (rl *ReplSilo) GetReceivedJoinRequests() []JoinRequest
- func (rl *ReplSilo) GetReplicationPeer(serverId uint16) *ReplicationPeer
- func (rl *ReplSilo) GetReplicationPeers() map[uint16]*ReplicationPeer
- func (rl *ReplSilo) GetSentJoinRequests() []JoinRequest
- func (rl *ReplSilo) IsCloned() bool
- func (rl *ReplSilo) SetClonedFrom(serverId uint16) error
- type ReplicationEvent
- type ReplicationPeer
Constants ¶
View Source
const HEADER_X_FROM_PEER_ID = "X-From-Peer-Id"
View Source
const HEADER_X_WEBHOOK_TOKEN = "X-Webhook-Token"
Variables ¶
View Source
var ( // a bucket that holds the pending join requests BUC_SENT_JOIN_REQUESTS = []byte("sent_join_requests") BUC_RECEIVED_JOIN_REQUESTS = []byte("received_join_requests") BUC_PEERS = []byte("peers") BUC_SELF_STATE = []byte("self_state") )
View Source
var ( // a bucket that holds the replication events BUC_REPL_EVENTS = []byte("repl_events") )
Functions ¶
This section is empty.
Types ¶
type JoinRequest ¶
type JoinRequest struct { Host string `json:"host" valid:"ascii,required"` Port int `json:"port" valid:"range(1|65535),required"` ServerId uint16 `json:"serverId" valid:"range(0|65535),required"` WebHookToken string `json:"webHookToken" valid:"required"` SentBy string `json:"sentBy" valid:"required"` Domain string `json:"domain" valid:"required"` CreatedTime int64 `json:"createdTime"` RequestId string `json:"requestId" valid:"required"` // this is for correlation during approval phase PeerHost string // no need to send to the peer PeerPort int // no need to send to the peer }
type JoinResponse ¶
type JoinResponse struct { PeerServerId uint16 `json:"peerServerId" valid:"range(0|65535),required"` ApprovedBy string `json:"approvedBy" valid:"required"` PeerWebHookToken string `json:"peerWebHookToken" valid:"required"` RequestId string `json:"requestId" valid:"required"` // this is for correlation during approval phase PeerView []ReplicationPeer `json:"peerView"` }
type ReplProviderSilo ¶
type ReplProviderSilo struct {
// contains filtered or unexported fields
}
func OpenReplProviderSilo ¶
func OpenReplProviderSilo(path string, eventTtl int, purgeInterval int) (*ReplProviderSilo, error)
func (*ReplProviderSilo) Close ¶
func (rpl *ReplProviderSilo) Close()
func (*ReplProviderSilo) SendEventsAfter ¶
func (rpl *ReplProviderSilo) SendEventsAfter(csn string, peer *ReplicationPeer, transport *http.Transport, serverId uint16, webhookToken string, domainCode string) (string, error)
func (*ReplProviderSilo) StoreEvent ¶
func (rpl *ReplProviderSilo) StoreEvent(event ReplicationEvent) (*bytes.Buffer, error)
func (*ReplProviderSilo) WriteBacklogEvents ¶
func (rpl *ReplProviderSilo) WriteBacklogEvents(csn string, peer *ReplicationPeer, w http.ResponseWriter, domainCode string) (string, error)
type ReplSilo ¶
type ReplSilo struct { WebHookToken string // webhook token of this server // contains filtered or unexported fields }
func OpenReplSilo ¶
func (*ReplSilo) AddReceivedJoinReq ¶
func (rl *ReplSilo) AddReceivedJoinReq(req JoinRequest) error
func (*ReplSilo) AddReplicationPeer ¶
func (rl *ReplSilo) AddReplicationPeer(req *ReplicationPeer) error
func (*ReplSilo) AddSentJoinReq ¶
func (rl *ReplSilo) AddSentJoinReq(req JoinRequest) error
func (*ReplSilo) DeleteReceivedJoinRequest ¶
func (*ReplSilo) DeleteReplicationPeer ¶
func (*ReplSilo) DeleteSentJoinRequest ¶
func (*ReplSilo) GetReceivedJoinRequest ¶
func (rl *ReplSilo) GetReceivedJoinRequest(serverId uint16) *JoinRequest
func (*ReplSilo) GetReceivedJoinRequests ¶
func (rl *ReplSilo) GetReceivedJoinRequests() []JoinRequest
func (*ReplSilo) GetReplicationPeer ¶
func (rl *ReplSilo) GetReplicationPeer(serverId uint16) *ReplicationPeer
func (*ReplSilo) GetReplicationPeers ¶
func (rl *ReplSilo) GetReplicationPeers() map[uint16]*ReplicationPeer
func (*ReplSilo) GetSentJoinRequests ¶
func (rl *ReplSilo) GetSentJoinRequests() []JoinRequest
func (*ReplSilo) SetClonedFrom ¶
type ReplicationEvent ¶
type ReplicationEvent struct { Version string DomainCode string Type DataType Data []byte CreatedRes *base.Resource PatchIfMatch string PatchRid string RtName string Rid string ResToReplace *base.Resource NewSession *base.RbacSession SsoSession bool RevokedSessionId string DeletedSessionId string NewPassword string HashAlgo string NewDomainName string Cloning bool // flag to indicate that this was generated as part of clone operation }
type ReplicationPeer ¶
type ReplicationPeer struct { ServerId uint16 `json:"serverId"` BaseUrl string `json:"baseUrl"` EventsUrl *url.URL `json:"-"` WebHookToken string `json:"-"` ApprovedBy string `json:"approvedBy"` Domain string `json:"domain"` CreatedTime int64 `json:"createdTime"` LastVersions map[string]string `json:"lastVersions"` // a map of domain code and the associated event version PendingVersions map[string]string `json:"-"` // a map of domain code and the associated LATEST event version that was NOT sent yet due to backlog processing LastReqSentTime int64 `json:"lastReqSentTime"` LastReqFailureTime int64 `json:"lastReqFailureTime"` // contains filtered or unexported fields }
func (*ReplicationPeer) BeginRebase ¶
func (peer *ReplicationPeer) BeginRebase()
func (*ReplicationPeer) EndRebase ¶
func (peer *ReplicationPeer) EndRebase()
func (*ReplicationPeer) IsBusy ¶
func (peer *ReplicationPeer) IsBusy() bool
Click to show internal directories.
Click to hide internal directories.