canopy

package
Version: v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 23 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OnOff_name = map[int32]string{
	0: "OnOffReserved",
	1: "On",
	2: "Off",
}
View Source
var OnOff_value = map[string]int32{
	"OnOffReserved": 0,
	"On":            1,
	"Off":           2,
}
View Source
var Presence_name = map[int32]string{
	0: "PresenceReserved",
	1: "Present",
	2: "Absent",
}
View Source
var Presence_value = map[string]int32{
	"PresenceReserved": 0,
	"Present":          1,
	"Absent":           2,
}
View Source
var UpDown_name = map[int32]string{
	0: "UpDownReserved",
	1: "Up",
	2: "Down",
}
View Source
var UpDown_value = map[string]int32{
	"UpDownReserved": 0,
	"Up":             1,
	"Down":           2,
}
View Source
var Version = "undefined"

set by makefile at link time

Functions

func Any added in v0.2.6

func Any(*Element) bool

func ClearPending

func ClearPending() error

func ErrorE added in v0.2.1

func ErrorE(message string, err error) error

func ErrorEF added in v0.2.2

func ErrorEF(message string, err error, fields log.Fields) error

func ListPorts added in v0.2.1

func ListPorts(hosts []string) (map[string][]*Element, error)

func LoadPendingCommands added in v0.2.6

func LoadPendingCommands(cli *Client) error

func LoadPendingQueries added in v0.2.6

func LoadPendingQueries(cli *Client) error

func RegisterCanopyServer

func RegisterCanopyServer(s *grpc.Server, srv CanopyServer)

func SendSet

func SendSet(host string, set *SetRequest) error

func SetAccess added in v0.2.1

func SetAccess(name string, value *Access) error

func SetBridgePresence added in v0.2.1

func SetBridgePresence(name string, value Presence) error

func SetLearning added in v0.2.1

func SetLearning(name string, value OnOff) error
func SetLink(name string, value UpDown) error

func SetMaster added in v0.2.1

func SetMaster(name string, master *Master) error

func SetMtu added in v0.2.1

func SetMtu(name string, value int32) error

func SetTagged added in v0.2.1

func SetTagged(name string, value *Tagged) error

func SetUntagged added in v0.2.1

func SetUntagged(name string, value *Untagged) error

func SetVlanAware added in v0.2.1

func SetVlanAware(name string, value bool) error

func SetVtepPresence added in v0.2.1

func SetVtepPresence(name string, vtep *VtepPresence) error

func ShowErrors

func ShowErrors(errors map[string]error)

func ShowResult

func ShowResult(data interface{})

Types

type Access added in v0.2.1

type Access struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Vid                  int32    `protobuf:"varint,2,opt,name=vid,proto3" json:"vid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Access) Descriptor added in v0.2.1

func (*Access) Descriptor() ([]byte, []int)

func (*Access) GetPresence added in v0.2.1

func (m *Access) GetPresence() Presence

func (*Access) GetVid added in v0.2.1

func (m *Access) GetVid() int32

func (*Access) ProtoMessage added in v0.2.1

func (*Access) ProtoMessage()

func (*Access) Reset added in v0.2.1

func (m *Access) Reset()

func (*Access) String added in v0.2.1

func (m *Access) String() string

func (*Access) XXX_DiscardUnknown added in v0.2.1

func (m *Access) XXX_DiscardUnknown()

func (*Access) XXX_Marshal added in v0.2.1

func (m *Access) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Access) XXX_Merge added in v0.2.1

func (m *Access) XXX_Merge(src proto.Message)

func (*Access) XXX_Size added in v0.2.1

func (m *Access) XXX_Size() int

func (*Access) XXX_Unmarshal added in v0.2.1

func (m *Access) XXX_Unmarshal(b []byte) error

type Bridge added in v0.2.1

type Bridge struct {
	State                UpDown   `protobuf:"varint,1,opt,name=state,proto3,enum=canopy.UpDown" json:"state,omitempty"`
	VlanAware            bool     `protobuf:"varint,2,opt,name=vlan_aware,json=vlanAware,proto3" json:"vlan_aware,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Bridge) Descriptor added in v0.2.1

func (*Bridge) Descriptor() ([]byte, []int)

func (*Bridge) GetState added in v0.2.1

func (m *Bridge) GetState() UpDown

func (*Bridge) GetVlanAware added in v0.2.1

func (m *Bridge) GetVlanAware() bool

func (*Bridge) ProtoMessage added in v0.2.1

func (*Bridge) ProtoMessage()

func (*Bridge) Reset added in v0.2.1

func (m *Bridge) Reset()

func (*Bridge) String added in v0.2.1

func (m *Bridge) String() string

func (*Bridge) XXX_DiscardUnknown added in v0.2.1

func (m *Bridge) XXX_DiscardUnknown()

func (*Bridge) XXX_Marshal added in v0.2.1

func (m *Bridge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Bridge) XXX_Merge added in v0.2.1

func (m *Bridge) XXX_Merge(src proto.Message)

func (*Bridge) XXX_Size added in v0.2.1

func (m *Bridge) XXX_Size() int

func (*Bridge) XXX_Unmarshal added in v0.2.1

func (m *Bridge) XXX_Unmarshal(b []byte) error

type BridgePresence added in v0.2.1

type BridgePresence struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*BridgePresence) Descriptor added in v0.2.1

func (*BridgePresence) Descriptor() ([]byte, []int)

func (*BridgePresence) GetPresence added in v0.2.1

func (m *BridgePresence) GetPresence() Presence

func (*BridgePresence) ProtoMessage added in v0.2.1

func (*BridgePresence) ProtoMessage()

func (*BridgePresence) Reset added in v0.2.1

func (m *BridgePresence) Reset()

func (*BridgePresence) String added in v0.2.1

func (m *BridgePresence) String() string

func (*BridgePresence) XXX_DiscardUnknown added in v0.2.1

func (m *BridgePresence) XXX_DiscardUnknown()

func (*BridgePresence) XXX_Marshal added in v0.2.1

func (m *BridgePresence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BridgePresence) XXX_Merge added in v0.2.1

func (m *BridgePresence) XXX_Merge(src proto.Message)

func (*BridgePresence) XXX_Size added in v0.2.1

func (m *BridgePresence) XXX_Size() int

func (*BridgePresence) XXX_Unmarshal added in v0.2.1

func (m *BridgePresence) XXX_Unmarshal(b []byte) error

type CanopyClient

type CanopyClient interface {
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

CanopyClient is the client API for Canopy service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCanopyClient

func NewCanopyClient(cc *grpc.ClientConn) CanopyClient

type CanopyServer

type CanopyServer interface {
	List(context.Context, *ListRequest) (*ListResponse, error)
	Set(context.Context, *SetRequest) (*SetResponse, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
}

CanopyServer is the server API for Canopy service.

type Client

type Client struct {
	Counter  int
	Pending  CommandSet
	Queries  QuerySet
	Elements Elements
}

func LoadClient added in v0.2.6

func LoadClient() (*Client, error)

func NewClient

func NewClient() *Client

func (*Client) Add added in v0.2.4

func (c *Client) Add(property *Property, host string) *Client

func (*Client) AddMany added in v0.2.4

func (c *Client) AddMany(property *Property, names, hosts []string) *Client

func (*Client) Commit

func (c *Client) Commit() error

func (*Client) GetPort added in v0.2.6

func (c *Client) GetPort(name, host string) *Client

func (*Client) GetPorts added in v0.2.6

func (c *Client) GetPorts(names []string, host string) *Client

func (*Client) Query added in v0.2.6

func (c *Client) Query() error

func (*Client) SavePending

func (c *Client) SavePending() error

func (*Client) SavePendingCommands added in v0.2.6

func (c *Client) SavePendingCommands() error

func (*Client) SavePendingQueries added in v0.2.6

func (c *Client) SavePendingQueries() error

func (*Client) SetAccessPort added in v0.2.4

func (c *Client) SetAccessPort(value *Access, name, host string) *Client

func (*Client) SetAccessPorts added in v0.2.4

func (c *Client) SetAccessPorts(value *Access, names, hosts []string) *Client

func (*Client) SetBridgePresent added in v0.2.4

func (c *Client) SetBridgePresent(p Presence, name, host string) *Client

func (*Client) SetBridgesPresent added in v0.2.4

func (c *Client) SetBridgesPresent(p Presence, names, hosts []string) *Client

func (*Client) SetLearningVtep added in v0.2.4

func (c *Client) SetLearningVtep(value OnOff, name, host string) *Client

func (*Client) SetLearningVteps added in v0.2.4

func (c *Client) SetLearningVteps(value OnOff, names, hosts []string) *Client
func (c *Client) SetLink(value UpDown, name, host string) *Client
func (c *Client) SetLinks(value UpDown, names, hosts []string) *Client

func (*Client) SetMaster added in v0.2.1

func (c *Client) SetMaster(value *Master, name, host string) *Client

func (*Client) SetMasters added in v0.2.4

func (c *Client) SetMasters(value *Master, names, hosts []string) *Client

func (*Client) SetMtu added in v0.2.1

func (c *Client) SetMtu(value int32, name, host string) *Client

func (*Client) SetMtus added in v0.2.4

func (c *Client) SetMtus(value int32, names, hosts []string) *Client

func (*Client) SetTaggedPort added in v0.2.4

func (c *Client) SetTaggedPort(value *Tagged, name, host string) *Client

func (*Client) SetTaggedPorts added in v0.2.4

func (c *Client) SetTaggedPorts(value *Tagged, names, hosts []string) *Client

func (*Client) SetUntaggedPort added in v0.2.4

func (c *Client) SetUntaggedPort(value *Untagged, name, host string) *Client

func (*Client) SetUntaggedPorts added in v0.2.4

func (c *Client) SetUntaggedPorts(value *Untagged, names, hosts []string) *Client

func (*Client) SetVlanAwareBridge added in v0.2.4

func (c *Client) SetVlanAwareBridge(v bool, name, host string) *Client

func (*Client) SetVlanAwareBridges added in v0.2.4

func (c *Client) SetVlanAwareBridges(v bool, names, hosts []string) *Client

func (*Client) SetVtep

func (c *Client) SetVtep(v *VtepPresence, name, host string) *Client

func (*Client) SetVteps added in v0.2.4

func (c *Client) SetVteps(v *VtepPresence, names, hosts []string) *Client

type CommandSet

type CommandSet map[string]map[string][]*Property

hosts[id][port][]Elements

type Config

type Config struct {
	Switches []string
}

func ReadConfig

func ReadConfig() (*Config, error)

type Element

type Element struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are valid to be assigned to Value:
	//	*Element_Port
	//	*Element_Vtep
	//	*Element_Bridge
	Value                isElement_Value `protobuf_oneof:"value"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-" yaml:"-"`
	XXX_unrecognized     []byte          `json:"-" yaml:"-"`
	XXX_sizecache        int32           `json:"-" yaml:"-"`
}

func List added in v0.2.1

func List(filter func(e *Element) bool) ([]*Element, error)

func SendGet

func SendGet(host string, ports []string) ([]*Element, error)

func (*Element) Descriptor

func (*Element) Descriptor() ([]byte, []int)

func (*Element) GetBridge added in v0.2.1

func (m *Element) GetBridge() *Bridge

func (*Element) GetName added in v0.2.1

func (m *Element) GetName() string

func (*Element) GetPort added in v0.2.1

func (m *Element) GetPort() *Port

func (*Element) GetValue added in v0.2.1

func (m *Element) GetValue() isElement_Value

func (*Element) GetVtep

func (m *Element) GetVtep() *Vtep

func (*Element) ProtoMessage

func (*Element) ProtoMessage()

func (*Element) Reset

func (m *Element) Reset()

func (*Element) String

func (m *Element) String() string

func (*Element) XXX_DiscardUnknown

func (m *Element) XXX_DiscardUnknown()

func (*Element) XXX_Marshal

func (m *Element) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Element) XXX_Merge

func (m *Element) XXX_Merge(src proto.Message)

func (*Element) XXX_OneofWrappers added in v0.2.8

func (*Element) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Element) XXX_Size

func (m *Element) XXX_Size() int

func (*Element) XXX_Unmarshal

func (m *Element) XXX_Unmarshal(b []byte) error

type Element_Bridge added in v0.2.1

type Element_Bridge struct {
	Bridge *Bridge `protobuf:"bytes,4,opt,name=bridge,proto3,oneof"`
}

type Element_Port added in v0.2.1

type Element_Port struct {
	Port *Port `protobuf:"bytes,2,opt,name=port,proto3,oneof"`
}

type Element_Vtep

type Element_Vtep struct {
	Vtep *Vtep `protobuf:"bytes,3,opt,name=vtep,proto3,oneof"`
}

type Elements added in v0.2.6

type Elements map[string]map[string]*Element

func (Elements) Set added in v0.2.6

func (es Elements) Set(host, port string, e *Element)

type GetRequest

type GetRequest struct {
	Names                []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*GetRequest) Descriptor

func (*GetRequest) Descriptor() ([]byte, []int)

func (*GetRequest) GetNames added in v0.2.1

func (m *GetRequest) GetNames() []string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (m *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

type GetResponse

type GetResponse struct {
	Elements             []*Element `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-" yaml:"-"`
	XXX_unrecognized     []byte     `json:"-" yaml:"-"`
	XXX_sizecache        int32      `json:"-" yaml:"-"`
}

func (*GetResponse) Descriptor

func (*GetResponse) Descriptor() ([]byte, []int)

func (*GetResponse) GetElements

func (m *GetResponse) GetElements() []*Element

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetResponse) XXX_Merge

func (m *GetResponse) XXX_Merge(src proto.Message)

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

func (m *GetResponse) XXX_Unmarshal(b []byte) error

type ListRequest added in v0.2.1

type ListRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*ListRequest) Descriptor added in v0.2.1

func (*ListRequest) Descriptor() ([]byte, []int)

func (*ListRequest) ProtoMessage added in v0.2.1

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset added in v0.2.1

func (m *ListRequest) Reset()

func (*ListRequest) String added in v0.2.1

func (m *ListRequest) String() string

func (*ListRequest) XXX_DiscardUnknown added in v0.2.1

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal added in v0.2.1

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge added in v0.2.1

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size added in v0.2.1

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal added in v0.2.1

func (m *ListRequest) XXX_Unmarshal(b []byte) error

type ListResponse added in v0.2.1

type ListResponse struct {
	Elements             []*Element `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-" yaml:"-"`
	XXX_unrecognized     []byte     `json:"-" yaml:"-"`
	XXX_sizecache        int32      `json:"-" yaml:"-"`
}

func (*ListResponse) Descriptor added in v0.2.1

func (*ListResponse) Descriptor() ([]byte, []int)

func (*ListResponse) GetElements added in v0.2.1

func (m *ListResponse) GetElements() []*Element

func (*ListResponse) ProtoMessage added in v0.2.1

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset added in v0.2.1

func (m *ListResponse) Reset()

func (*ListResponse) String added in v0.2.1

func (m *ListResponse) String() string

func (*ListResponse) XXX_DiscardUnknown added in v0.2.1

func (m *ListResponse) XXX_DiscardUnknown()

func (*ListResponse) XXX_Marshal added in v0.2.1

func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListResponse) XXX_Merge added in v0.2.1

func (m *ListResponse) XXX_Merge(src proto.Message)

func (*ListResponse) XXX_Size added in v0.2.1

func (m *ListResponse) XXX_Size() int

func (*ListResponse) XXX_Unmarshal added in v0.2.1

func (m *ListResponse) XXX_Unmarshal(b []byte) error

type Master added in v0.2.1

type Master struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Master) Descriptor added in v0.2.1

func (*Master) Descriptor() ([]byte, []int)

func (*Master) GetPresence added in v0.2.1

func (m *Master) GetPresence() Presence

func (*Master) GetValue added in v0.2.1

func (m *Master) GetValue() string

func (*Master) ProtoMessage added in v0.2.1

func (*Master) ProtoMessage()

func (*Master) Reset added in v0.2.1

func (m *Master) Reset()

func (*Master) String added in v0.2.1

func (m *Master) String() string

func (*Master) XXX_DiscardUnknown added in v0.2.1

func (m *Master) XXX_DiscardUnknown()

func (*Master) XXX_Marshal added in v0.2.1

func (m *Master) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Master) XXX_Merge added in v0.2.1

func (m *Master) XXX_Merge(src proto.Message)

func (*Master) XXX_Size added in v0.2.1

func (m *Master) XXX_Size() int

func (*Master) XXX_Unmarshal added in v0.2.1

func (m *Master) XXX_Unmarshal(b []byte) error

type OnOff

type OnOff int32
const (
	OnOff_OnOffReserved OnOff = 0
	OnOff_On            OnOff = 1
	OnOff_Off           OnOff = 2
)

func ParseOnOff

func ParseOnOff(s string) (OnOff, error)

func (OnOff) EnumDescriptor

func (OnOff) EnumDescriptor() ([]byte, []int)

func (OnOff) String

func (x OnOff) String() string

type Parent added in v0.2.1

type Parent struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Parent) Descriptor added in v0.2.1

func (*Parent) Descriptor() ([]byte, []int)

func (*Parent) GetPresence added in v0.2.1

func (m *Parent) GetPresence() Presence

func (*Parent) GetValue added in v0.2.1

func (m *Parent) GetValue() string

func (*Parent) ProtoMessage added in v0.2.1

func (*Parent) ProtoMessage()

func (*Parent) Reset added in v0.2.1

func (m *Parent) Reset()

func (*Parent) String added in v0.2.1

func (m *Parent) String() string

func (*Parent) XXX_DiscardUnknown added in v0.2.1

func (m *Parent) XXX_DiscardUnknown()

func (*Parent) XXX_Marshal added in v0.2.1

func (m *Parent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Parent) XXX_Merge added in v0.2.1

func (m *Parent) XXX_Merge(src proto.Message)

func (*Parent) XXX_Size added in v0.2.1

func (m *Parent) XXX_Size() int

func (*Parent) XXX_Unmarshal added in v0.2.1

func (m *Parent) XXX_Unmarshal(b []byte) error

type Port added in v0.2.1

type Port struct {
	State                UpDown   `protobuf:"varint,1,opt,name=state,proto3,enum=canopy.UpDown" json:"state,omitempty"`
	Mtu                  int32    `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"`
	Bridge               string   `protobuf:"bytes,3,opt,name=bridge,proto3" json:"bridge,omitempty"`
	Access               int32    `protobuf:"varint,4,opt,name=access,proto3" json:"access,omitempty"`
	Tagged               []int32  `protobuf:"varint,5,rep,packed,name=tagged,proto3" json:"tagged,omitempty"`
	Untagged             []int32  `protobuf:"varint,6,rep,packed,name=untagged,proto3" json:"untagged,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Port) Descriptor added in v0.2.1

func (*Port) Descriptor() ([]byte, []int)

func (*Port) GetAccess added in v0.2.1

func (m *Port) GetAccess() int32

func (*Port) GetBridge added in v0.2.1

func (m *Port) GetBridge() string

func (*Port) GetMtu added in v0.2.1

func (m *Port) GetMtu() int32

func (*Port) GetState added in v0.2.1

func (m *Port) GetState() UpDown

func (*Port) GetTagged added in v0.2.1

func (m *Port) GetTagged() []int32

func (*Port) GetUntagged added in v0.2.1

func (m *Port) GetUntagged() []int32

func (*Port) ProtoMessage added in v0.2.1

func (*Port) ProtoMessage()

func (*Port) Reset added in v0.2.1

func (m *Port) Reset()

func (*Port) String added in v0.2.1

func (m *Port) String() string

func (*Port) XXX_DiscardUnknown added in v0.2.1

func (m *Port) XXX_DiscardUnknown()

func (*Port) XXX_Marshal added in v0.2.1

func (m *Port) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Port) XXX_Merge added in v0.2.1

func (m *Port) XXX_Merge(src proto.Message)

func (*Port) XXX_Size added in v0.2.1

func (m *Port) XXX_Size() int

func (*Port) XXX_Unmarshal added in v0.2.1

func (m *Port) XXX_Unmarshal(b []byte) error

type Presence

type Presence int32
const (
	Presence_PresenceReserved Presence = 0
	Presence_Present          Presence = 1
	Presence_Absent           Presence = 2
)

func ParsePresence

func ParsePresence(s string) (Presence, error)

func (Presence) EnumDescriptor

func (Presence) EnumDescriptor() ([]byte, []int)

func (Presence) String

func (x Presence) String() string

type Property added in v0.2.1

type Property struct {
	Element string `protobuf:"bytes,1,opt,name=element,proto3" json:"element,omitempty"`
	Order   int32  `protobuf:"varint,2,opt,name=order,proto3" json:"order,omitempty"`
	// Types that are valid to be assigned to Value:
	//	*Property_Link
	//	*Property_Mtu
	//	*Property_Access
	//	*Property_Tagged
	//	*Property_Untagged
	//	*Property_Master
	//	*Property_Vtep
	//	*Property_Learning
	//	*Property_Bridge
	//	*Property_VlanAware
	Value                isProperty_Value `protobuf_oneof:"value"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-" yaml:"-"`
	XXX_unrecognized     []byte           `json:"-" yaml:"-"`
	XXX_sizecache        int32            `json:"-" yaml:"-"`
}

func (*Property) Descriptor added in v0.2.1

func (*Property) Descriptor() ([]byte, []int)

func (*Property) GetAccess added in v0.2.1

func (m *Property) GetAccess() *Access

func (*Property) GetBridge added in v0.2.1

func (m *Property) GetBridge() Presence

func (*Property) GetElement added in v0.2.1

func (m *Property) GetElement() string

func (*Property) GetLearning added in v0.2.1

func (m *Property) GetLearning() OnOff
func (m *Property) GetLink() UpDown

func (*Property) GetMaster added in v0.2.1

func (m *Property) GetMaster() *Master

func (*Property) GetMtu added in v0.2.1

func (m *Property) GetMtu() int32

func (*Property) GetOrder added in v0.2.1

func (m *Property) GetOrder() int32

func (*Property) GetTagged added in v0.2.1

func (m *Property) GetTagged() *Tagged

func (*Property) GetUntagged added in v0.2.1

func (m *Property) GetUntagged() *Untagged

func (*Property) GetValue added in v0.2.1

func (m *Property) GetValue() isProperty_Value

func (*Property) GetVlanAware added in v0.2.1

func (m *Property) GetVlanAware() bool

func (*Property) GetVtep added in v0.2.1

func (m *Property) GetVtep() *VtepPresence

func (*Property) ProtoMessage added in v0.2.1

func (*Property) ProtoMessage()

func (*Property) Reset added in v0.2.1

func (m *Property) Reset()

func (*Property) String added in v0.2.1

func (m *Property) String() string

func (*Property) XXX_DiscardUnknown added in v0.2.1

func (m *Property) XXX_DiscardUnknown()

func (*Property) XXX_Marshal added in v0.2.1

func (m *Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Property) XXX_Merge added in v0.2.1

func (m *Property) XXX_Merge(src proto.Message)

func (*Property) XXX_OneofWrappers added in v0.2.8

func (*Property) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Property) XXX_Size added in v0.2.1

func (m *Property) XXX_Size() int

func (*Property) XXX_Unmarshal added in v0.2.1

func (m *Property) XXX_Unmarshal(b []byte) error

type Property_Access added in v0.2.1

type Property_Access struct {
	Access *Access `protobuf:"bytes,5,opt,name=access,proto3,oneof"`
}

type Property_Bridge added in v0.2.1

type Property_Bridge struct {
	Bridge Presence `protobuf:"varint,11,opt,name=bridge,proto3,enum=canopy.Presence,oneof"`
}

type Property_Learning added in v0.2.1

type Property_Learning struct {
	Learning OnOff `protobuf:"varint,10,opt,name=learning,proto3,enum=canopy.OnOff,oneof"`
}
type Property_Link struct {
	Link UpDown `protobuf:"varint,3,opt,name=link,proto3,enum=canopy.UpDown,oneof"`
}

type Property_Master added in v0.2.1

type Property_Master struct {
	Master *Master `protobuf:"bytes,8,opt,name=master,proto3,oneof"`
}

type Property_Mtu added in v0.2.1

type Property_Mtu struct {
	Mtu int32 `protobuf:"varint,4,opt,name=mtu,proto3,oneof"`
}

type Property_Tagged added in v0.2.1

type Property_Tagged struct {
	Tagged *Tagged `protobuf:"bytes,6,opt,name=tagged,proto3,oneof"`
}

type Property_Untagged added in v0.2.1

type Property_Untagged struct {
	Untagged *Untagged `protobuf:"bytes,7,opt,name=untagged,proto3,oneof"`
}

type Property_VlanAware added in v0.2.1

type Property_VlanAware struct {
	VlanAware bool `protobuf:"varint,12,opt,name=vlan_aware,json=vlanAware,proto3,oneof"`
}

type Property_Vtep added in v0.2.1

type Property_Vtep struct {
	Vtep *VtepPresence `protobuf:"bytes,9,opt,name=vtep,proto3,oneof"`
}

type QuerySet added in v0.2.6

type QuerySet map[string][]string

hosts[id][]port

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) Get

func (s *Server) Get(ctx context.Context, req *GetRequest) (
	*GetResponse, error)

Implements Canopy::Get gRPC interface

func (*Server) List added in v0.2.1

func (s *Server) List(ctx context.Context, req *ListRequest) (
	*ListResponse, error)

func (*Server) Run

func (s *Server) Run()

Starts the canopy server and listens for requests.

func (*Server) Set

func (s *Server) Set(ctx context.Context, req *SetRequest) (
	*SetResponse, error)

Implements Canopy::Set gRPC interface

type SetRequest

type SetRequest struct {
	Properties           []*Property `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-" yaml:"-"`
	XXX_unrecognized     []byte      `json:"-" yaml:"-"`
	XXX_sizecache        int32       `json:"-" yaml:"-"`
}

func (*SetRequest) Descriptor

func (*SetRequest) Descriptor() ([]byte, []int)

func (*SetRequest) GetProperties added in v0.2.1

func (m *SetRequest) GetProperties() []*Property

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) Reset

func (m *SetRequest) Reset()

func (*SetRequest) String

func (m *SetRequest) String() string

func (*SetRequest) XXX_DiscardUnknown

func (m *SetRequest) XXX_DiscardUnknown()

func (*SetRequest) XXX_Marshal

func (m *SetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetRequest) XXX_Merge

func (m *SetRequest) XXX_Merge(src proto.Message)

func (*SetRequest) XXX_Size

func (m *SetRequest) XXX_Size() int

func (*SetRequest) XXX_Unmarshal

func (m *SetRequest) XXX_Unmarshal(b []byte) error

type SetResponse

type SetResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*SetResponse) Descriptor

func (*SetResponse) Descriptor() ([]byte, []int)

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) Reset

func (m *SetResponse) Reset()

func (*SetResponse) String

func (m *SetResponse) String() string

func (*SetResponse) XXX_DiscardUnknown

func (m *SetResponse) XXX_DiscardUnknown()

func (*SetResponse) XXX_Marshal

func (m *SetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetResponse) XXX_Merge

func (m *SetResponse) XXX_Merge(src proto.Message)

func (*SetResponse) XXX_Size

func (m *SetResponse) XXX_Size() int

func (*SetResponse) XXX_Unmarshal

func (m *SetResponse) XXX_Unmarshal(b []byte) error

type Tagged added in v0.2.1

type Tagged struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Vids                 []int32  `protobuf:"varint,2,rep,packed,name=vids,proto3" json:"vids,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Tagged) Descriptor added in v0.2.1

func (*Tagged) Descriptor() ([]byte, []int)

func (*Tagged) GetPresence added in v0.2.1

func (m *Tagged) GetPresence() Presence

func (*Tagged) GetVids added in v0.2.1

func (m *Tagged) GetVids() []int32

func (*Tagged) ProtoMessage added in v0.2.1

func (*Tagged) ProtoMessage()

func (*Tagged) Reset added in v0.2.1

func (m *Tagged) Reset()

func (*Tagged) String added in v0.2.1

func (m *Tagged) String() string

func (*Tagged) XXX_DiscardUnknown added in v0.2.1

func (m *Tagged) XXX_DiscardUnknown()

func (*Tagged) XXX_Marshal added in v0.2.1

func (m *Tagged) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Tagged) XXX_Merge added in v0.2.1

func (m *Tagged) XXX_Merge(src proto.Message)

func (*Tagged) XXX_Size added in v0.2.1

func (m *Tagged) XXX_Size() int

func (*Tagged) XXX_Unmarshal added in v0.2.1

func (m *Tagged) XXX_Unmarshal(b []byte) error

type UnimplementedCanopyServer added in v0.2.8

type UnimplementedCanopyServer struct {
}

UnimplementedCanopyServer can be embedded to have forward compatible implementations.

func (*UnimplementedCanopyServer) Get added in v0.2.8

func (*UnimplementedCanopyServer) List added in v0.2.8

func (*UnimplementedCanopyServer) Set added in v0.2.8

type Untagged added in v0.2.1

type Untagged struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Vids                 []int32  `protobuf:"varint,2,rep,packed,name=vids,proto3" json:"vids,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Untagged) Descriptor added in v0.2.1

func (*Untagged) Descriptor() ([]byte, []int)

func (*Untagged) GetPresence added in v0.2.1

func (m *Untagged) GetPresence() Presence

func (*Untagged) GetVids added in v0.2.1

func (m *Untagged) GetVids() []int32

func (*Untagged) ProtoMessage added in v0.2.1

func (*Untagged) ProtoMessage()

func (*Untagged) Reset added in v0.2.1

func (m *Untagged) Reset()

func (*Untagged) String added in v0.2.1

func (m *Untagged) String() string

func (*Untagged) XXX_DiscardUnknown added in v0.2.1

func (m *Untagged) XXX_DiscardUnknown()

func (*Untagged) XXX_Marshal added in v0.2.1

func (m *Untagged) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Untagged) XXX_Merge added in v0.2.1

func (m *Untagged) XXX_Merge(src proto.Message)

func (*Untagged) XXX_Size added in v0.2.1

func (m *Untagged) XXX_Size() int

func (*Untagged) XXX_Unmarshal added in v0.2.1

func (m *Untagged) XXX_Unmarshal(b []byte) error

type UpDown

type UpDown int32
const (
	UpDown_UpDownReserved UpDown = 0
	UpDown_Up             UpDown = 1
	UpDown_Down           UpDown = 2
)

func ParseLinkState

func ParseLinkState(s string) (UpDown, error)

func (UpDown) EnumDescriptor

func (UpDown) EnumDescriptor() ([]byte, []int)

func (UpDown) String

func (x UpDown) String() string

type VlanAware added in v0.2.1

type VlanAware struct {
	Value                bool     `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*VlanAware) Descriptor added in v0.2.1

func (*VlanAware) Descriptor() ([]byte, []int)

func (*VlanAware) GetValue added in v0.2.1

func (m *VlanAware) GetValue() bool

func (*VlanAware) ProtoMessage added in v0.2.1

func (*VlanAware) ProtoMessage()

func (*VlanAware) Reset added in v0.2.1

func (m *VlanAware) Reset()

func (*VlanAware) String added in v0.2.1

func (m *VlanAware) String() string

func (*VlanAware) XXX_DiscardUnknown added in v0.2.1

func (m *VlanAware) XXX_DiscardUnknown()

func (*VlanAware) XXX_Marshal added in v0.2.1

func (m *VlanAware) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VlanAware) XXX_Merge added in v0.2.1

func (m *VlanAware) XXX_Merge(src proto.Message)

func (*VlanAware) XXX_Size added in v0.2.1

func (m *VlanAware) XXX_Size() int

func (*VlanAware) XXX_Unmarshal added in v0.2.1

func (m *VlanAware) XXX_Unmarshal(b []byte) error

type Vtep

type Vtep struct {
	State                UpDown   `protobuf:"varint,1,opt,name=state,proto3,enum=canopy.UpDown" json:"state,omitempty"`
	Vni                  int32    `protobuf:"varint,2,opt,name=vni,proto3" json:"vni,omitempty"`
	BridgeAccess         int32    `protobuf:"varint,3,opt,name=bridge_access,json=bridgeAccess,proto3" json:"bridge_access,omitempty"`
	Device               string   `protobuf:"bytes,4,opt,name=device,proto3" json:"device,omitempty"`
	Bridge               string   `protobuf:"bytes,5,opt,name=bridge,proto3" json:"bridge,omitempty"`
	Learning             OnOff    `protobuf:"varint,6,opt,name=learning,proto3,enum=canopy.OnOff" json:"learning,omitempty"`
	LocalIP              string   `protobuf:"bytes,7,opt,name=localIP,proto3" json:"localIP,omitempty"`
	Mtu                  int32    `protobuf:"varint,8,opt,name=mtu,proto3" json:"mtu,omitempty"`
	Access               int32    `protobuf:"varint,9,opt,name=access,proto3" json:"access,omitempty"`
	Tagged               []int32  `protobuf:"varint,10,rep,packed,name=tagged,proto3" json:"tagged,omitempty"`
	Untagged             []int32  `protobuf:"varint,11,rep,packed,name=untagged,proto3" json:"untagged,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*Vtep) Descriptor

func (*Vtep) Descriptor() ([]byte, []int)

func (*Vtep) GetAccess added in v0.2.1

func (m *Vtep) GetAccess() int32

func (*Vtep) GetBridge added in v0.2.1

func (m *Vtep) GetBridge() string

func (*Vtep) GetBridgeAccess added in v0.2.1

func (m *Vtep) GetBridgeAccess() int32

func (*Vtep) GetDevice added in v0.2.1

func (m *Vtep) GetDevice() string

func (*Vtep) GetLearning added in v0.2.1

func (m *Vtep) GetLearning() OnOff

func (*Vtep) GetLocalIP added in v0.2.1

func (m *Vtep) GetLocalIP() string

func (*Vtep) GetMtu added in v0.2.1

func (m *Vtep) GetMtu() int32

func (*Vtep) GetState added in v0.2.1

func (m *Vtep) GetState() UpDown

func (*Vtep) GetTagged added in v0.2.1

func (m *Vtep) GetTagged() []int32

func (*Vtep) GetUntagged added in v0.2.1

func (m *Vtep) GetUntagged() []int32

func (*Vtep) GetVni added in v0.2.1

func (m *Vtep) GetVni() int32

func (*Vtep) ProtoMessage

func (*Vtep) ProtoMessage()

func (*Vtep) Reset

func (m *Vtep) Reset()

func (*Vtep) String

func (m *Vtep) String() string

func (*Vtep) XXX_DiscardUnknown

func (m *Vtep) XXX_DiscardUnknown()

func (*Vtep) XXX_Marshal

func (m *Vtep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Vtep) XXX_Merge

func (m *Vtep) XXX_Merge(src proto.Message)

func (*Vtep) XXX_Size

func (m *Vtep) XXX_Size() int

func (*Vtep) XXX_Unmarshal

func (m *Vtep) XXX_Unmarshal(b []byte) error

type VtepPresence added in v0.2.1

type VtepPresence struct {
	Presence             Presence `protobuf:"varint,1,opt,name=presence,proto3,enum=canopy.Presence" json:"presence,omitempty"`
	Vni                  int32    `protobuf:"varint,2,opt,name=vni,proto3" json:"vni,omitempty"`
	TunnelIp             string   `protobuf:"bytes,3,opt,name=tunnel_ip,json=tunnelIp,proto3" json:"tunnel_ip,omitempty"`
	Parent               string   `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"`
	Learning             OnOff    `protobuf:"varint,5,opt,name=learning,proto3,enum=canopy.OnOff" json:"learning,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

func (*VtepPresence) Descriptor added in v0.2.1

func (*VtepPresence) Descriptor() ([]byte, []int)

func (*VtepPresence) GetLearning added in v0.2.9

func (m *VtepPresence) GetLearning() OnOff

func (*VtepPresence) GetParent added in v0.2.1

func (m *VtepPresence) GetParent() string

func (*VtepPresence) GetPresence added in v0.2.1

func (m *VtepPresence) GetPresence() Presence

func (*VtepPresence) GetTunnelIp added in v0.2.1

func (m *VtepPresence) GetTunnelIp() string

func (*VtepPresence) GetVni added in v0.2.1

func (m *VtepPresence) GetVni() int32

func (*VtepPresence) ProtoMessage added in v0.2.1

func (*VtepPresence) ProtoMessage()

func (*VtepPresence) Reset added in v0.2.1

func (m *VtepPresence) Reset()

func (*VtepPresence) String added in v0.2.1

func (m *VtepPresence) String() string

func (*VtepPresence) XXX_DiscardUnknown added in v0.2.1

func (m *VtepPresence) XXX_DiscardUnknown()

func (*VtepPresence) XXX_Marshal added in v0.2.1

func (m *VtepPresence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VtepPresence) XXX_Merge added in v0.2.1

func (m *VtepPresence) XXX_Merge(src proto.Message)

func (*VtepPresence) XXX_Size added in v0.2.1

func (m *VtepPresence) XXX_Size() int

func (*VtepPresence) XXX_Unmarshal added in v0.2.1

func (m *VtepPresence) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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