Documentation ¶
Index ¶
- Constants
- func CreateCanaryMesh(routineConfig *RoutineConfiguration, setupConfig *SetupConfiguration)
- func GetId(n *meshv1.Node) uint32
- func GetSampleId(p *meshv1.Sample) uint32
- type Mesh
- type MeshClient
- type MeshServer
- func (s *MeshServer) JoinMesh(ctx context.Context, req *meshv1.Node) (*meshv1.JoinMeshResponse, error)
- func (s *MeshServer) NodeDiscovery(ctx context.Context, req *meshv1.NodeDiscoveryRequest) (*emptypb.Empty, error)
- func (s *MeshServer) Ping(ctx context.Context, req *meshv1.Node) (*emptypb.Empty, error)
- func (s *MeshServer) PushSamples(ctx context.Context, req *meshv1.Samples) (*emptypb.Empty, error)
- func (s *MeshServer) Rtt(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)
- type NodeDiscovered
- type RoutineConfiguration
- type SetupConfiguration
Constants ¶
const ( NodeOk = 1 NodeTimeout = 2 NodeDead = 3 )
Variables ¶
This section is empty.
Functions ¶
func CreateCanaryMesh ¶
func CreateCanaryMesh(routineConfig *RoutineConfiguration, setupConfig *SetupConfiguration)
CreateCanaryMesh creates a canary bot & mesh with the desired configuration Use a pre-defined routineConfig with e.g. StandardProductionRoutineConfig() and define your mesh setup configuration
- Logger will be initialized
- setupConfig will be checked
- DB will be created
- Mesh will be initialized
- Routines will be started
- API will be created
Types ¶
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
Mesh is the internal mesh representation
func (*Mesh) NodeDiscovery ¶
func (*Mesh) StartServer ¶
StartServer starts the mesh server, by setting up gRPC and TLS.
type MeshClient ¶
type MeshClient struct {
// contains filtered or unexported fields
}
MeshClient is the client for the mesh service
type MeshServer ¶
type MeshServer struct { meshv1.UnimplementedMeshServiceServer // contains filtered or unexported fields }
MeshServer handles incoming requests
func (*MeshServer) JoinMesh ¶
func (s *MeshServer) JoinMesh(ctx context.Context, req *meshv1.Node) (*meshv1.JoinMeshResponse, error)
JoinMesh handles the join mesh request from a node wishing to join the mesh
func (*MeshServer) NodeDiscovery ¶
func (s *MeshServer) NodeDiscovery(ctx context.Context, req *meshv1.NodeDiscoveryRequest) (*emptypb.Empty, error)
NodeDiscovery handles the node discovery request from a node in the mesh
func (*MeshServer) PushSamples ¶
PushSamples adds samples to the database if they are newer than the current sample
type NodeDiscovered ¶
NodeDiscovered represents a newly discovered node in the mesh
type RoutineConfiguration ¶
type RoutineConfiguration struct { // Timeout for every grpc request RequestTimeout time.Duration // Join config JoinInterval time.Duration // Ping config PingInterval time.Duration PingRetryAmount int PingRetryDelay time.Duration // Node discovery BroadcastToAmount int // Push samples PushSampleInterval time.Duration PushSampleToAmount int PushSampleRetryAmount int PushSampleRetryDelay time.Duration // Clean nodes & samples CleanupInterval time.Duration CleanupMaxAge time.Duration // Sample: RTT RttInterval time.Duration }
Configuration for the timer- and channelRoutines
func StandardProductionRoutineConfig ¶
func StandardProductionRoutineConfig() *RoutineConfiguration
Use standard configuration parameters for your production
type SetupConfiguration ¶
type SetupConfiguration struct { // remote target Targets []string // local config Name string JoinAddress string ListenAddress string ListenPort int64 // API ApiPort int64 // TLS server side ServerCertPath string ServerKeyPath string ServerCert []byte ServerKey []byte // TLS client side CaCertPath []string CaCert []byte //Auth API Tokens []string // Clean nodes & samples CleanupNodes bool CleanupSamples bool //Logging Debug bool DebugGrpc bool }
Configuration how the bot can connect to the mesh etc.