Documentation
¶
Index ¶
Constants ¶
View Source
const ( PeerAddrHeader = 11 RaftConnectType = 2048 RaftDataType = 2049 SigningCertHeader = 2050 ChannelTypeMesh = "ctrl.mesh" )
Variables ¶
This section is empty.
Functions ¶
func ExtractSpiffeId ¶ added in v0.24.2
func ExtractSpiffeId(certs []*x509.Certificate) (string, error)
Types ¶
type ClusterState ¶ added in v0.22.23
type ClusterState uint32
const ( ClusterReadWrite ClusterState = 0 ClusterReadOnly ClusterState = 1 )
type Env ¶ added in v0.22.32
type Env interface {
GetId() *identity.TokenId
GetVersionProvider() versions.VersionProvider
GetEventDispatcher() event.Dispatcher
}
type Mesh ¶
type Mesh interface {
raft.StreamLayer
channel.UnderlayAcceptor
// GetOrConnectPeer returns a peer for the given address. If a peer has already been established,
// it will be returned, otherwise a new connection will be established
GetOrConnectPeer(address string, timeout time.Duration) (*Peer, error)
IsReadOnly() bool
GetPeerInfo(address string, timeout time.Duration) (raft.ServerID, raft.ServerAddress, error)
GetAdvertiseAddr() raft.ServerAddress
GetPeers() map[string]*Peer
RegisterClusterStateHandler(f func(state ClusterState))
Init(bindHandler channel.BindHandler)
}
Mesh provides the networking layer to raft
type Peer ¶
type Peer struct {
Id raft.ServerID
Address string
Channel channel.Channel
RaftConn *raftPeerConn
Version *versions.VersionInfo
SigningCerts []*x509.Certificate
// contains filtered or unexported fields
}
func (*Peer) ContentType ¶
func (*Peer) HandleClose ¶
Click to show internal directories.
Click to hide internal directories.