1
// Copyright 2014 ALTOROS
2
// Licensed under the AGPLv3, see LICENSE file for details.
9
"github.com/altoros/gosigma/data"
12
// A RuntimeNIC interface represents runtime information for network interface card
13
type RuntimeNIC interface {
20
// Type of network interface card (public, private, etc)
24
// A runtimeNIC implements runtime information for network interface card
25
type runtimeNIC struct {
26
obj *data.RuntimeNetwork
29
var _ RuntimeNIC = runtimeNIC{}
31
// String method is used to print values passed as an operand to any format that
32
// accepts a string or to an unformatted printer such as Print.
33
func (r runtimeNIC) String() string {
34
return fmt.Sprintf(`{Type: %q, IPv4: %v}`, r.Type(), r.IPv4())
38
func (r runtimeNIC) IPv4() Resource {
39
if r.obj.IPv4 != nil {
40
return resource{r.obj.IPv4}
45
// Type of network interface card (public, private, etc)
46
func (r runtimeNIC) Type() string { return r.obj.InterfaceType }