github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/cluster/member_status_events.go (about)

     1  package cluster
     2  
     3  import "fmt"
     4  
     5  type MemberStatusEvent interface {
     6  	MemberStatusEvent()
     7  	GetKinds() []string
     8  }
     9  
    10  type MemberMeta struct {
    11  	Host  string
    12  	Port  int
    13  	Kinds []string
    14  }
    15  
    16  func (e *MemberMeta) Name() string {
    17  	return fmt.Sprintf("%v:%v", e.Host, e.Port)
    18  }
    19  
    20  func (e *MemberMeta) GetKinds() []string {
    21  	return e.Kinds
    22  }
    23  
    24  type MemberJoinedEvent struct {
    25  	MemberMeta
    26  }
    27  
    28  func (*MemberJoinedEvent) MemberStatusEvent() {}
    29  
    30  type MemberRejoinedEvent struct {
    31  	MemberMeta
    32  }
    33  
    34  func (*MemberRejoinedEvent) MemberStatusEvent() {}
    35  
    36  type MemberLeftEvent struct {
    37  	MemberMeta
    38  }
    39  
    40  func (*MemberLeftEvent) MemberStatusEvent() {}
    41  
    42  type MemberUnavailableEvent struct {
    43  	MemberMeta
    44  }
    45  
    46  func (*MemberUnavailableEvent) MemberStatusEvent() {}
    47  
    48  type MemberAvailableEvent struct {
    49  	MemberMeta
    50  }
    51  
    52  func (*MemberAvailableEvent) MemberStatusEvent() {}