Documentation ¶
Index ¶
- Constants
- func AddIP(ip string, ifname string) error
- func DeleteIP(ip string, ifname string) error
- type ServiceNetwork
- func (s *ServiceNetwork) AddIP(ip string) error
- func (s *ServiceNetwork) DeleteIP(ip string) error
- func (s *ServiceNetwork) SetIfname(ifname string)
- func (s *ServiceNetwork) UpdateDNS(ctx context.Context, domainName string, hostedZoneID string, memberName string) (dnsName string, err error)
- func (s *ServiceNetwork) UpdateServiceMemberDNS(ctx context.Context, cluster string, service string, memberName string, ...) (memberHost string, err error)
- func (s *ServiceNetwork) UpdateStaticIP(ctx context.Context, domainName string, member *common.ServiceMember) error
Constants ¶
const (
// DefaultNetworkInterface is the default static ip attach network.
DefaultNetworkInterface = "eth0"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ServiceNetwork ¶
type ServiceNetwork struct {
// contains filtered or unexported fields
}
ServiceNetwork handles the network for the service. It handles: 1. Update the dns record for the service member. 2. Assign/Unassign the static IP for the service member.
func NewServiceNetwork ¶
func NewServiceNetwork(dbIns db.DB, dnsIns dns.DNS, serverIns server.Server, serverInfo server.Info) *ServiceNetwork
NewServiceNetwork creates a ServiceNetwork instance.
func (*ServiceNetwork) AddIP ¶
func (s *ServiceNetwork) AddIP(ip string) error
AddIP adds the ip to the net interface.
func (*ServiceNetwork) DeleteIP ¶
func (s *ServiceNetwork) DeleteIP(ip string) error
DeleteIP deletes the ip from the net interface.
func (*ServiceNetwork) SetIfname ¶
func (s *ServiceNetwork) SetIfname(ifname string)
SetIfname sets the ifname. This is for the unit test only.
func (*ServiceNetwork) UpdateDNS ¶
func (s *ServiceNetwork) UpdateDNS(ctx context.Context, domainName string, hostedZoneID string, memberName string) (dnsName string, err error)
UpdateDNS updates the dns record of the service member to the private ip of the local server.
func (*ServiceNetwork) UpdateServiceMemberDNS ¶
func (s *ServiceNetwork) UpdateServiceMemberDNS(ctx context.Context, cluster string, service string, memberName string, containersvcIns containersvc.ContainerSvc, localContainerInstanceID string) (memberHost string, err error)
UpdateServiceMemberDNS updates the DNS for the service member. If memberName is empty, an idle member will be assigned.
func (*ServiceNetwork) UpdateStaticIP ¶
func (s *ServiceNetwork) UpdateStaticIP(ctx context.Context, domainName string, member *common.ServiceMember) error
UpdateStaticIP unassigns the static ip from the old node and assigns to the local node.