coordination

package
v0.0.0-...-6f38258 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommanderServer

type CommanderServer struct {
	sync.WaitGroup
	pb.UnimplementedCommandManagerServer
	DB *sql.DB
	CO *Coordinator
	ID string
}

func (*CommanderServer) GetNodes

func (*CommanderServer) SendCommandToNodes

func (c *CommanderServer) SendCommandToNodes(ctx context.Context, cmd *pb.CommanderRequest) (*pb.AggregateResponses, error)

func (*CommanderServer) SendCommandToNodesStream

type Coordinator

type Coordinator struct {
	connections.Tailnet
	services.DataManagement

	ID string
	// contains filtered or unexported fields
}

Coordinator holds the runtime variables for the coordination server

func (*Coordinator) NewCoordinator

func (co *Coordinator) NewCoordinator(ctx context.Context, opts ...Option) error

NewCoordinator Create a new coordinator instance and set the provided options

func (*Coordinator) StartDatabase

func (co *Coordinator) StartDatabase(ctx context.Context) error

func (*Coordinator) StartPingService

func (co *Coordinator) StartPingService(ctx context.Context)

func (*Coordinator) StartRPCCoordinationServer

func (co *Coordinator) StartRPCCoordinationServer(ctx context.Context) error

StartRPCCoordinationServer Register the gRPC server endpoints and start the server

func (*Coordinator) WithDevMode

func (co *Coordinator) WithDevMode(mode bool) Option

WithDevMode enable the server to run in dev mode

type Option

type Option func(co *Coordinator) error

Options defines the configuration options function for configuration injection

type RegistrationServer

type RegistrationServer struct {
	pb.UnimplementedRegistrationServer
	DevMode  bool
	ID       string
	Hostname string
	DB       *sql.DB
}

RegistrationServer struct to contain proto for gRPC

func (*RegistrationServer) Register

Register registers a node with the database when a node sends a request. Returns the server id so the node can verify further requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL