dockernetwork

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultNetworkInterface is the default static ip attach network.
	DefaultNetworkInterface = "eth0"
)

Variables

This section is empty.

Functions

func AddIP

func AddIP(ip string, ifname string) error

AddIP adds the ip to the net interface.

func DeleteIP

func DeleteIP(ip string, ifname string) error

DeleteIP deletes the ip from the net interface.

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.

Jump to

Keyboard shortcuts

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