Documentation
¶
Overview ¶
Package api implements the resource struct definitions used by the northbound client API.
Index ¶
- type BGPPeer
- type BGPPeerList
- type BGPPeerMetadata
- type BGPPeerSpec
- type BackendType
- type ClientConfig
- type EntityRule
- type HostEndpoint
- type HostEndpointList
- type HostEndpointMetadata
- type HostEndpointSpec
- type ICMPFields
- type IPIPConfiguration
- type Policy
- type PolicyList
- type PolicyMetadata
- type PolicySpec
- type Pool
- type PoolList
- type PoolMetadata
- type PoolSpec
- type Profile
- type ProfileList
- type ProfileMetadata
- type ProfileSpec
- type Rule
- type WorkloadEndpoint
- type WorkloadEndpointList
- type WorkloadEndpointMetadata
- type WorkloadEndpointSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGPPeer ¶
type BGPPeer struct {
TypeMetadata
// Metadata for a BGPPeer.
Metadata BGPPeerMetadata `json:"metadata,omitempty"`
// Specification for a BGPPeer.
Spec BGPPeerSpec `json:"spec,omitempty"`
}
type BGPPeerList ¶
type BGPPeerList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []BGPPeer `json:"items" validate:"dive"`
}
func NewBGPPeerList ¶
func NewBGPPeerList() *BGPPeerList
type BGPPeerMetadata ¶
type BGPPeerMetadata struct {
ObjectMetadata
// The scope of the peer. This may be global or node. A global peer is a
// BGP device that peers with all Calico nodes. A node peer is a BGP device that
// peers with the specified Calico node (specified by the node hostname).
Scope scope.Scope `json:"scope" validate:"omitempty,scopeglobalornode"`
// The hostname of the node that is peering with this peer. When modifying a
// BGP peer, the hostname must be specified when the scope is `node`, and must
// be omitted when the scope is `global`.
Hostname string `json:"hostname,omitempty" validate:"omitempty,name"`
// The IP address of the peer.
PeerIP IP `json:"peerIP" validate:"omitempty,ip"`
}
type BGPPeerSpec ¶
type BGPPeerSpec struct {
// The AS Number of the peer.
ASNumber int `json:"asNumber" validate:"required,asn"`
}
type BackendType ¶
type BackendType string
const (
EtcdV2 BackendType = "etcdv2"
)
func (BackendType) NewConfig ¶
func (b BackendType) NewConfig() interface{}
NewConfig returns a pointer to a new config struct for the relevant datastore.
type ClientConfig ¶
type ClientConfig struct {
BackendType BackendType `json:"datastoreType" envconfig:"DATASTORE_TYPE" default:"etcdv2"`
BackendConfig interface{} `json:"-"`
}
Client configuration required to instantiate a Calico client interface.
type EntityRule ¶
type EntityRule struct {
Tag string `json:"tag,omitempty" validate:"omitempty,tag"`
Net *IPNet `json:"net,omitempty" validate:"omitempty"`
Selector string `json:"selector,omitempty" validate:"omitempty,selector"`
Ports []Port `json:"ports,omitempty" validate:"omitempty,dive"`
NotTag string `json:"!tag,omitempty" validate:"omitempty,tag"`
NotNet *IPNet `json:"!net,omitempty" validate:"omitempty"`
NotSelector string `json:"!selector,omitempty" validate:"omitempty,selector"`
NotPorts []Port `json:"!ports,omitempty" validate:"omitempty,dive"`
}
type HostEndpoint ¶
type HostEndpoint struct {
TypeMetadata
Metadata HostEndpointMetadata `json:"metadata,omitempty"`
Spec HostEndpointSpec `json:"spec,omitempty"`
}
func NewHostEndpoint ¶
func NewHostEndpoint() *HostEndpoint
type HostEndpointList ¶
type HostEndpointList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []HostEndpoint `json:"items" validate:"dive"`
}
func NewHostEndpointList ¶
func NewHostEndpointList() *HostEndpointList
type HostEndpointMetadata ¶
type HostEndpointSpec ¶
type ICMPFields ¶
type ICMPFields struct {
Type *int `json:"type,omitempty" validate:"omitempty,gte=0,lte=255"`
Code *int `json:"code,omitempty" validate:"omitempty,gte=0,lte=255"`
}
ICMPFields defines structure for ICMP and NotICMP sub-struct for ICMP code and type
type IPIPConfiguration ¶
type IPIPConfiguration struct {
// When enabled is true, ipip tunneling will be
// used to deliver packets to destinations within this
// pool.
Enabled bool `json:"enabled,omitempty"`
}
type Policy ¶
type Policy struct {
TypeMetadata
Metadata PolicyMetadata `json:"metadata,omitempty"`
Spec PolicySpec `json:"spec,omitempty"`
}
type PolicyList ¶
type PolicyList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []Policy `json:"items" validate:"dive"`
}
func NewPolicyList ¶
func NewPolicyList() *PolicyList
type PolicyMetadata ¶
type PolicySpec ¶
type Pool ¶
type Pool struct {
TypeMetadata
// Metadata for a Pool.
Metadata PoolMetadata `json:"metadata,omitempty"`
// Specification for a Pool.
Spec PoolSpec `json:"spec,omitempty"`
}
type PoolList ¶
type PoolList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []Pool `json:"items" validate:"dive"`
}
type PoolMetadata ¶
type PoolMetadata struct {
ObjectMetadata
CIDR IPNet `json:"cidr"`
}
type PoolSpec ¶
type PoolSpec struct {
// Contains configuration for ipip tunneling
// for this pool. If not specified, then ipip
// tunneling is disabled for this pool.
IPIP *IPIPConfiguration `json:"ipip,omitempty"`
// When nat-outgoing is true, packets sent from Calico networked
// containers in this pool to destinations outside of this pool
// will be masqueraded.
NATOutgoing bool `json:"nat-outgoing,omitempty"`
// When disabled is true, Calico IPAM will not assign
// addreses from this pool.
Disabled bool `json:"disabled,omitempty"`
}
type Profile ¶
type Profile struct {
TypeMetadata
Metadata ProfileMetadata `json:"metadata,omitempty"`
Spec ProfileSpec `json:"spec,omitempty"`
}
type ProfileList ¶
type ProfileList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []Profile `json:"items" validate:"dive,omitempty"`
}
func NewProfileList ¶
func NewProfileList() *ProfileList
type ProfileMetadata ¶
type ProfileSpec ¶
type Rule ¶
type Rule struct {
Action string `json:"action" validate:"action"`
Protocol *Protocol `json:"protocol,omitempty" validate:"omitempty"`
ICMP *ICMPFields `json:"icmp,omitempty" validate:"omitempty"`
NotProtocol *Protocol `json:"!protocol,omitempty" validate:"omitempty"`
NotICMP *ICMPFields `json:"!icmp,omitempty" validate:"omitempty"`
Source EntityRule `json:"source,omitempty" validate:"omitempty"`
Destination EntityRule `json:"destination,omitempty" validate:"omitempty"`
}
type WorkloadEndpoint ¶
type WorkloadEndpoint struct {
TypeMetadata
Metadata WorkloadEndpointMetadata `json:"metadata,omitempty"`
Spec WorkloadEndpointSpec `json:"spec,omitempty"`
}
func NewWorkloadEndpoint ¶
func NewWorkloadEndpoint() *WorkloadEndpoint
type WorkloadEndpointList ¶
type WorkloadEndpointList struct {
TypeMetadata
Metadata ListMetadata `json:"metadata,omitempty"`
Items []WorkloadEndpoint `json:"items" validate:"dive"`
}
func NewWorkloadEndpointList ¶
func NewWorkloadEndpointList() *WorkloadEndpointList
type WorkloadEndpointMetadata ¶
type WorkloadEndpointMetadata struct {
ObjectMetadata
Name string `json:"name,omitempty" validate:"omitempty,name"`
WorkloadID string `json:"workloadID,omitempty" valid:"omitempty,name"`
OrchestratorID string `json:"orchestratorID,omitempty" valid:"omitempty,name"`
Hostname string `json:"hostname,omitempty" valid:"omitempty,name"`
Labels map[string]string `json:"labels,omitempty" validate:"omitempty,labels"`
}
type WorkloadEndpointSpec ¶
type WorkloadEndpointSpec struct {
IPNetworks []IPNet `json:"ipNetworks,omitempty" validate:"omitempty"`
Profiles []string `json:"profiles,omitempty" validate:"omitempty,dive,name"`
InterfaceName string `json:"interfaceName,omitempty" validate:"omitempty,interface"`
MAC MAC `json:"mac,omitempty" validate:"omitempty"`
}
Source Files
¶
- bgppeer.go
- config.go
- doc.go
- hostendpoint.go
- policy.go
- pool.go
- profile.go
- rule.go
- workloadendpoint.go
Click to show internal directories.
Click to hide internal directories.