Documentation
¶
Index ¶
- Constants
- Variables
- func NewMachineID() (string, error)
- func NewRandomMachineName() (string, error)
- type Cluster
- func (c *Cluster) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*pb.AddMachineResponse, error)
- func (c *Cluster) CreateDomainRecords(ctx context.Context, req *pb.CreateDomainRecordsRequest) (*pb.CreateDomainRecordsResponse, error)
- func (c *Cluster) GetDomain(ctx context.Context, _ *emptypb.Empty) (*pb.Domain, error)
- func (c *Cluster) Init(ctx context.Context, network netip.Prefix) error
- func (c *Cluster) Initialised(ctx context.Context) (bool, error)
- func (c *Cluster) ListMachines(ctx context.Context, _ *emptypb.Empty) (*pb.ListMachinesResponse, error)
- func (c *Cluster) Network(ctx context.Context) (netip.Prefix, error)
- func (c *Cluster) ReleaseDomain(ctx context.Context, _ *emptypb.Empty) (*pb.Domain, error)
- func (c *Cluster) RemoveMachine(ctx context.Context, req *pb.RemoveMachineRequest) (*emptypb.Empty, error)
- func (c *Cluster) ReserveDomain(ctx context.Context, req *pb.ReserveDomainRequest) (*pb.Domain, error)
- func (c *Cluster) UpdateMachine(ctx context.Context, req *pb.UpdateMachineRequest) (*pb.UpdateMachineResponse, error)
- func (c *Cluster) UpdateMachineID(mid string)
- type IPAM
Constants ¶
View Source
const DefaultSubnetBits = 24
Variables ¶
View Source
var DefaultNetwork = netip.MustParsePrefix("10.210.0.0/16")
Functions ¶
func NewMachineID ¶
NewMachineID generates a new unique machine ID.
func NewRandomMachineName ¶
NewRandomMachineName generates a random machine name in the format "machine-xxxx".
Types ¶
type Cluster ¶
type Cluster struct {
pb.UnimplementedClusterServer
// contains filtered or unexported fields
}
func NewCluster ¶
func NewCluster(store *store.Store, corroAdmin *corrosion.AdminClient) *Cluster
func (*Cluster) AddMachine ¶
func (c *Cluster) AddMachine(ctx context.Context, req *pb.AddMachineRequest) (*pb.AddMachineResponse, error)
AddMachine adds a machine to the cluster.
func (*Cluster) CreateDomainRecords ¶
func (c *Cluster) CreateDomainRecords( ctx context.Context, req *pb.CreateDomainRecordsRequest, ) (*pb.CreateDomainRecordsResponse, error)
func (*Cluster) ListMachines ¶
func (c *Cluster) ListMachines(ctx context.Context, _ *emptypb.Empty) (*pb.ListMachinesResponse, error)
ListMachines lists all machines in the cluster including their membership states.
func (*Cluster) ReleaseDomain ¶
func (*Cluster) RemoveMachine ¶ added in v0.10.0
func (c *Cluster) RemoveMachine(ctx context.Context, req *pb.RemoveMachineRequest) (*emptypb.Empty, error)
RemoveMachine removes a machine from the cluster.
func (*Cluster) ReserveDomain ¶
func (*Cluster) UpdateMachine ¶ added in v0.10.0
func (c *Cluster) UpdateMachine(ctx context.Context, req *pb.UpdateMachineRequest) (*pb.UpdateMachineResponse, error)
UpdateMachine updates machine configuration in the cluster.
func (*Cluster) UpdateMachineID ¶
UpdateMachineID updates the current machine ID that is running the cluster service.
type IPAM ¶
type IPAM struct {
// contains filtered or unexported fields
}
IPAM is an in-memory IP address manager for allocating and releasing subnets for machines from a cluster network.
func NewIPAMWithAllocated ¶
NewIPAMWithAllocated creates a new IPAM with the given network and already allocated subnets.
Click to show internal directories.
Click to hide internal directories.