Documentation
¶
Index ¶
- Variables
- func New() resource.Driver
- type Addrs
- type T
- func (t *T) Abort(ctx context.Context) bool
- func (t *T) Configure() error
- func (t *T) DriverID() driver.ID
- func (t *T) Holds(src resource.HoldSource) []resource.Hold
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) Provision(ctx context.Context) error
- func (t *T) ProvisionConflicts(ctx context.Context) []string
- func (t *T) ProvisionStart(ctx context.Context) error
- func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)
- func (t *T) Start(ctx context.Context) error
- func (t *T) Status(ctx context.Context) status.T
- func (t *T) StatusInfo(_ context.Context) map[string]interface{}
- func (t *T) Stop(ctx context.Context) error
- func (t *T) Unprovision(ctx context.Context) error
- func (t *T) UnprovisionStop(ctx context.Context, leader bool) error
Constants ¶
This section is empty.
Variables ¶
var ( // GroupInterface holds the interface of the node the address is // plumbed on, and how. GroupInterface = keywords.Group{ ID: "interface", Name: "Interface", Text: keywords.NewText(fs, "text/group/interface"), Order: 20, } // GroupRouting holds the gateway of the address, which the driver // reads but sets no route with. GroupRouting = keywords.Group{ ID: "routing", Name: "Routing", Text: keywords.NewText(fs, "text/group/routing"), Order: 30, } )
The groups of the keywords of an ip.host resource beside the addressing and dns groups of the ip drivers. They have the ids, names and orders of the interface and routing groups of ip.netns, their texts saying the interface of the node.
Functions ¶
Types ¶
type T ¶
type T struct {
resource.T
resource.Restart
Path naming.Path
ObjectFQDN string
DNS []string
// config
Name string `json:"name"`
Dev string `json:"dev"`
Netmask string `json:"netmask"`
Network string `json:"network"`
Addr string `json:"addr"`
Gateway string `json:"gateway"`
Provisioner string `json:"provisioner"`
CheckCarrier bool `json:"check_carrier"`
Alias bool `json:"alias"`
Expose []string `json:"expose"`
WaitDNS *time.Duration `json:"wait_dns"`
// contains filtered or unexported fields
}
func (*T) Configure ¶
Configure fills from the network what the configuration did not say: the interface of this node the address is configured on, and the prefix length it is configured with. They are the network's to know, so naming the network is enough, and an explicit value always wins.
func (*T) Holds ¶
func (t *T) Holds(src resource.HoldSource) []resource.Hold
Holds says the address, as named or drawn from a network.
func (*T) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) ProvisionConflicts ¶
ProvisionConflicts says the address answers already, from another host or another object of this one: the provision would bring it up a second time. An address still to draw from a network is not checked: it is drawn free.
A provision that does not start the address, off the leader of the placement and not standby, brings nothing up a second time: the address answering is then the one the leader of this object started, and the start of this node checks it again. An address up on the device of the resource is its own, as the abort of a start counts it.
func (*T) ProvisionStart ¶
ProvisionStart starts the address at the end of its provision on the placement leader only: see resip.ProvisionStarts.
func (*T) Provisioned ¶
func (*T) StatusInfo ¶
StatusInfo implements resource.StatusInfoer
func (*T) UnprovisionStop ¶
UnprovisionStop stops the resource, and releases the address drawn from the network, which a stop keeps: the address is the service's, which its clients know it by, until the service is unprovisioned. Every node releases its reservation, and the leader removes the address from the configuration, once for all of them.