mcp

package
v0.0.0-...-4b4864e Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* [2013] - [2018] Avi Networks Incorporated * All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (

	// DefaultMCPMaxMsgSize is the default maximum message size
	DefaultMCPMaxMsgSize = 1024 * 1024 * 4
)

Variables

View Source
var (
	// VirtualService describes v1alpha3 route rules
	VirtualService = ProtoSchema{
		Type:        "virtual-service",
		Plural:      "virtual-services",
		Group:       "networking",
		Version:     "v1alpha3",
		MessageName: "istio.networking.v1alpha3.VirtualService",
		GetAll:      GetAllVSes,
		Store:       ProcessVS,
		Collection:  "istio/networking/v1alpha3/virtualservices",
	}
	Gateway = ProtoSchema{
		Type:        "gateway",
		Plural:      "gateways",
		Group:       "networking",
		Version:     "v1alpha3",
		MessageName: "istio.networking.v1alpha3.Gateway",
		Store:       ProcessGateway,
		GetAll:      GetAllGateways,
		Collection:  "istio/networking/v1alpha3/gateways",
	}
	// ServiceEntry describes service entries
	ServiceEntry = ProtoSchema{
		Type:        "service-entry",
		Plural:      "service-entries",
		Group:       "networking",
		Version:     "v1alpha3",
		MessageName: "istio.networking.v1alpha3.ServiceEntry",

		Store:      ProcessVS,
		GetAll:     GetAllVSes,
		Collection: "istio/networking/v1alpha3/serviceentries",
	}

	DestinationRule = ProtoSchema{
		Type:        "destination-rule",
		Plural:      "destination-rules",
		Group:       "networking",
		Version:     "v1alpha3",
		MessageName: "istio.networking.v1alpha3.DestinationRule",

		Store:      ProcessDR,
		GetAll:     GetAllDRs,
		Collection: "istio/networking/v1alpha3/destinationrules",
	}
	// IstioConfigTypes lists all Istio config types with schemas and validation
	IstioConfigTypes = ConfigDescriptor{
		VirtualService,
		Gateway,
		ServiceEntry,
		DestinationRule,
	}
)

Functions

func GetAllDRs

func GetAllDRs() map[string]map[string]string

func GetAllGateways

func GetAllGateways() map[string]map[string]string

func GetAllVSes

func GetAllVSes() map[string]map[string]string

func ProcessDR

func ProcessDR(currStore map[string]map[string]*istio_objs.IstioObject, prevStore map[string]map[string]string)

func ProcessGateway

func ProcessGateway(currStore map[string]map[string]*istio_objs.IstioObject, prevStore map[string]map[string]string)

func ProcessVS

func ProcessVS(currStore map[string]map[string]*istio_objs.IstioObject, prevStore map[string]map[string]string)

Types

type ConfigDescriptor

type ConfigDescriptor []ProtoSchema

func (ConfigDescriptor) CalculateUpdates

func (descriptor ConfigDescriptor) CalculateUpdates(prevStore map[string]map[string]string, currentStore map[string]map[string]string) map[string][]string

func (ConfigDescriptor) GetByType

func (descriptor ConfigDescriptor) GetByType(name string) (ProtoSchema, bool)

GetByType finds a schema by type if it is available

type Controller

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

func NewController

func NewController() *Controller

func (*Controller) Apply

func (c *Controller) Apply(change *sink.Change) error

Apply receives changes from MCP server and creates the corresponding config

func (*Controller) ConfigDescriptor

func (c *Controller) ConfigDescriptor() ConfigDescriptor

ConfigDescriptor returns all the ConfigDescriptors that this controller is responsible for

func (*Controller) HasSynced

func (c *Controller) HasSynced() bool

HasSynced is used to tell the MCP server that the first set of items that were supposed to be sent to this client for the registered types has been received.

type MCPClient

type MCPClient struct {
	MCPServerAddrs []string
	// contains filtered or unexported fields
}

func (*MCPClient) InitMCPClient

func (c *MCPClient) InitMCPClient() error

func (*MCPClient) Start

func (c *MCPClient) Start(stop <-chan struct{}) error

type ProtoSchema

type ProtoSchema struct {
	ClusterScoped    bool
	Type             string
	Plural           string
	Group            string
	Version          string
	MessageName      string
	CalculateUpdates func(map[string]map[string]string, map[string]map[string]string)
	GetAll           func() map[string]map[string]string
	Store            func(map[string]map[string]*istio_objs.IstioObject, map[string]map[string]string)
	Collection       string
}

Jump to

Keyboard shortcuts

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