Documentation ¶
Overview ¶
Package api implements the resource struct definitions used by the northbound client API.
Index ¶
- type BackendType
- type ClientConfig
- type EntityRule
- type HostEndpoint
- type HostEndpointList
- type HostEndpointMetadata
- type HostEndpointSpec
- 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 Tier
- type TierList
- type TierMetadata
- type TierSpec
- 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 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 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"` }
func NewPoolList ¶
func NewPoolList() *PoolList
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"` }
func NewProfile ¶
func NewProfile() *Profile
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"` ICMPType *int `json:"icmpType,omitempty" validate:"omitempty,gte=0,lte=255"` ICMPCode *int `json:"icmpCode,omitempty" validate:"omitempty,gte=0,lte=255"` NotProtocol *Protocol `json:"!protocol,omitempty" validate:"omitempty"` NotICMPType *int `json:"!icmpType,omitempty" validate:"omitempty,gte=0,lte=255"` NotICMPCode *int `json:"!icmpCode,omitempty" validate:"omitempty,gte=0,lte=255"` Source EntityRule `json:"source,omitempty" validate:"omitempty"` Destination EntityRule `json:"destination,omitempty" validate:"omitempty"` }
type Tier ¶
type Tier struct { TypeMetadata Metadata TierMetadata `json:"metadata,omitempty"` Spec TierSpec `json:"spec,omitempty"` }
type TierList ¶
type TierList struct { TypeMetadata Metadata ListMetadata `json:"metadata,omitempty"` Items []Tier `json:"items" validate:"dive"` }
func NewTierList ¶
func NewTierList() *TierList
type TierMetadata ¶
type TierMetadata struct { ObjectMetadata Name string `json:"name,omitempty" validate:"omitempty,name"` }
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 ¶
Click to show internal directories.
Click to hide internal directories.