Documentation ¶
Index ¶
- Variables
- type Event
- type EventStore
- type KafkaStore
- type KafkaStoreTopics
- type LevelDbEventStore
- type MasterServerEvent
- func (mse *MasterServerEvent) GetKey() ([]byte, error)
- func (mse *MasterServerEvent) GetProofOfHistory() *event_pb.ProofOfHistory
- func (mse *MasterServerEvent) GetServer() *event_pb.Server
- func (mse *MasterServerEvent) GetType() string
- func (mse *MasterServerEvent) GetValue() ([]byte, error)
- func (mse *MasterServerEvent) SetProofOfHistory(previousHash *string, hash string)
- func (mse *MasterServerEvent) SetType(t string)
- type MasterServerEventKey
- type MasterServerEventType
- type VolumeServerEvent
- func (vse *VolumeServerEvent) GetKey() ([]byte, error)
- func (vse *VolumeServerEvent) GetProofOfHistory() *event_pb.ProofOfHistory
- func (vse *VolumeServerEvent) GetServer() *event_pb.Server
- func (vse *VolumeServerEvent) GetType() string
- func (vse *VolumeServerEvent) GetValue() ([]byte, error)
- func (vse *VolumeServerEvent) SetProofOfHistory(previousHash *string, hash string)
- func (vse *VolumeServerEvent) SetType(t string)
- type VolumeServerEventKafkaKey
- type VolumeServerEventType
Constants ¶
This section is empty.
Variables ¶
View Source
var LastEventNotFoundError error = errors.New("last event not found")
View Source
var MasterServerEvents = map[MasterServerEventType]string{ MASTER_ALIVE: "MASTER_ALIVE", ASSIGN: "ASSIGN", }
View Source
var VolumeServerEvents = map[VolumeServerEventType]string{ ALIVE: "ALIVE", WRITE: "WRITE", DELETE: "DELETE", VACUUM: "VACUUM", }
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type KafkaStore ¶
type KafkaStore struct {
// contains filtered or unexported fields
}
func NewKafkaStore ¶
func NewKafkaStore(brokers []string, config *sarama.Config, producer sarama.SyncProducer) *KafkaStore
func (*KafkaStore) Close ¶
func (ks *KafkaStore) Close()
type KafkaStoreTopics ¶
type LevelDbEventStore ¶
type LevelDbEventStore[T Event] struct { EventStore[T] Dir string // contains filtered or unexported fields }
func NewLevelDbEventStore ¶
func (*LevelDbEventStore[T]) Close ¶
func (es *LevelDbEventStore[T]) Close()
func (*LevelDbEventStore[T]) GetLastEvent ¶
func (es *LevelDbEventStore[T]) GetLastEvent() (*T, error)
func (*LevelDbEventStore[T]) ListAllEvents ¶
func (es *LevelDbEventStore[T]) ListAllEvents() ([]T, error)
func (*LevelDbEventStore[T]) RegisterEvent ¶
func (es *LevelDbEventStore[T]) RegisterEvent(e T) error
type MasterServerEvent ¶
type MasterServerEvent struct { // TODO: consider replacing with protobuf value Type string `json:"type"` Timestamp *timestamppb.Timestamp `json:"timestamp"` Fid string `json:"fid"` Locations []*master_pb.Location `json:"locations"` Server *event_pb.Server `json:"server"` ProofOfHistory *event_pb.ProofOfHistory `json:"proofOfHistory"` }
func NewMasterServerEvent ¶
func NewMasterServerEvent( eventType MasterServerEventType, fid *string, locations []*master_pb.Location, serverPublicUrl string, ) *MasterServerEvent
func (*MasterServerEvent) GetKey ¶
func (mse *MasterServerEvent) GetKey() ([]byte, error)
func (*MasterServerEvent) GetProofOfHistory ¶
func (mse *MasterServerEvent) GetProofOfHistory() *event_pb.ProofOfHistory
func (*MasterServerEvent) GetServer ¶
func (mse *MasterServerEvent) GetServer() *event_pb.Server
func (*MasterServerEvent) GetType ¶
func (mse *MasterServerEvent) GetType() string
func (*MasterServerEvent) GetValue ¶
func (mse *MasterServerEvent) GetValue() ([]byte, error)
func (*MasterServerEvent) SetProofOfHistory ¶
func (mse *MasterServerEvent) SetProofOfHistory(previousHash *string, hash string)
func (*MasterServerEvent) SetType ¶
func (mse *MasterServerEvent) SetType(t string)
type MasterServerEventKey ¶
type MasterServerEventType ¶
type MasterServerEventType uint32
const ( MASTER_ALIVE MasterServerEventType = iota ASSIGN )
type VolumeServerEvent ¶
type VolumeServerEvent struct {
*volume_server_pb.VolumeServerEventResponse
}
func NewVolumeServerEvent ¶
func NewVolumeServerEvent( eventType VolumeServerEventType, serverMetadata *event_pb.Server, volumeMetadata *volume_server_pb.VolumeServerEventResponse_Volume, needleMetadata *volume_server_pb.VolumeServerEventResponse_Needle, ) (*VolumeServerEvent, error)
func (*VolumeServerEvent) GetKey ¶
func (vse *VolumeServerEvent) GetKey() ([]byte, error)
func (*VolumeServerEvent) GetProofOfHistory ¶
func (vse *VolumeServerEvent) GetProofOfHistory() *event_pb.ProofOfHistory
func (*VolumeServerEvent) GetServer ¶
func (vse *VolumeServerEvent) GetServer() *event_pb.Server
func (*VolumeServerEvent) GetType ¶
func (vse *VolumeServerEvent) GetType() string
func (*VolumeServerEvent) GetValue ¶
func (vse *VolumeServerEvent) GetValue() ([]byte, error)
func (*VolumeServerEvent) SetProofOfHistory ¶
func (vse *VolumeServerEvent) SetProofOfHistory(previousHash *string, hash string)
func (*VolumeServerEvent) SetType ¶
func (vse *VolumeServerEvent) SetType(t string)
type VolumeServerEventType ¶
type VolumeServerEventType uint32
const ( ALIVE VolumeServerEventType = iota WRITE DELETE VACUUM )
Click to show internal directories.
Click to hide internal directories.