objects

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: 8 Imported by: 0

Documentation

Overview

This module should give a wrapper over underlying objects to give easy API access for Virtual Services.

Index

Constants

View Source
const (
	IstioMeshGateway = "mesh"

	IstioSystemNamespace = "istio-system"
)

Variables

This section is empty.

Functions

func Remove

func Remove(s []string, r string) []string

Types

type AviGraphLister

type AviGraphLister struct {
	AviGraphStore *ObjectMapStore
}

func SharedAviGraphLister

func SharedAviGraphLister() *AviGraphLister

func (*AviGraphLister) Delete

func (a *AviGraphLister) Delete(vsName string)

func (*AviGraphLister) Get

func (a *AviGraphLister) Get(vsName string) (bool, interface{})

func (*AviGraphLister) Save

func (a *AviGraphLister) Save(vsName string, aviGraph interface{})

type ConfigMeta

type ConfigMeta struct {
	// Type is a short configuration name that matches the content message type
	// (e.g. "route-rule")
	Type string `json:"type,omitempty"`

	// Group is the API group of the config.
	Group string `json:"group,omitempty"`

	// Version is the API version of the Config.
	Version string `json:"version,omitempty"`

	// Name is a unique immutable identifier in a namespace
	Name string `json:"name,omitempty"`

	// Namespace defines the space for names (optional for some types),
	// applications may choose to use namespaces for a variety of purposes
	// (security domains, fault domains, organizational domains)
	Namespace string `json:"namespace,omitempty"`

	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects.
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	Annotations map[string]string `json:"annotations,omitempty"`

	ResourceVersion string `json:"resourceVersion,omitempty"`
	// CreationTimestamp records the creation time
	CreationTimestamp time.Time `json:"creationTimestamp,omitempty"`
}

type DRLister

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

func SharedDRLister

func SharedDRLister() *DRLister

func (*DRLister) DestinationRule

func (v *DRLister) DestinationRule(ns string) *DRNSCache

func (*DRLister) GetAllDRs

func (v *DRLister) GetAllDRs() map[string]map[string]string

type DRNSCache

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

func (*DRNSCache) Delete

func (v *DRNSCache) Delete(name string) bool

func (*DRNSCache) DeleteDRToSvc

func (v *DRNSCache) DeleteDRToSvc(drName string)

func (*DRNSCache) DeleteSVCToDRRefs

func (v *DRNSCache) DeleteSVCToDRRefs(drName string, namespace string)

func (*DRNSCache) Get

func (v *DRNSCache) Get(name string) (bool, *IstioObject)

func (*DRNSCache) GetAllDRNameVers

func (v *DRNSCache) GetAllDRNameVers() map[string]string

func (*DRNSCache) GetSVCMapping

func (v *DRNSCache) GetSVCMapping(drname string) (bool, []string)

func (*DRNSCache) GetServiceFromDRObj

func (v *DRNSCache) GetServiceFromDRObj(dr *IstioObject) string

func (*DRNSCache) GetSvcForDR

func (v *DRNSCache) GetSvcForDR(drName string) (bool, string)

func (*DRNSCache) List

func (v *DRNSCache) List() map[string]*IstioObject

func (*DRNSCache) Update

func (v *DRNSCache) Update(obj *IstioObject)

func (*DRNSCache) UpdateDRToSVCMapping

func (v *DRNSCache) UpdateDRToSVCMapping(drName string, svc string)

func (*DRNSCache) UpdateSvcDRRefs

func (v *DRNSCache) UpdateSvcDRRefs(obj *IstioObject)

type DRNameSpaceIntf

type DRNameSpaceIntf interface {
	Get(name string) (bool, *IstioObject)
	Update(obj IstioObject) bool
	List() map[string]*IstioObject
	Delete(name string) bool
}

type GatewayLister

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

func SharedGatewayLister

func SharedGatewayLister() *GatewayLister

func (*GatewayLister) Gateway

func (v *GatewayLister) Gateway(ns string) *GatewayNSCache

func (*GatewayLister) GetAllGateways

func (v *GatewayLister) GetAllGateways() map[string]map[string]string

type GatewayNSCache

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

func (*GatewayNSCache) Delete

func (v *GatewayNSCache) Delete(name string) bool

func (*GatewayNSCache) DeleteGwSecretMapping

func (v *GatewayNSCache) DeleteGwSecretMapping(gwName string)

func (*GatewayNSCache) DeleteGwVSMapping

func (v *GatewayNSCache) DeleteGwVSMapping(gwname string) bool

func (*GatewayNSCache) Get

func (v *GatewayNSCache) Get(name string) (bool, *IstioObject)

func (*GatewayNSCache) GetAllGatewayNameVers

func (v *GatewayNSCache) GetAllGatewayNameVers() map[string]string

func (*GatewayNSCache) GetSecretsForGateway

func (v *GatewayNSCache) GetSecretsForGateway(gwName string) []string

func (*GatewayNSCache) GetSecretsFromGW

func (v *GatewayNSCache) GetSecretsFromGW(obj *IstioObject) []string

func (*GatewayNSCache) GetVSMapping

func (v *GatewayNSCache) GetVSMapping(gwname string) (bool, []string)

func (*GatewayNSCache) List

func (v *GatewayNSCache) List() map[string]*IstioObject

func (*GatewayNSCache) RemoveSecretGWRefs

func (v *GatewayNSCache) RemoveSecretGWRefs(gwName string, gwNs string)

func (*GatewayNSCache) Update

func (v *GatewayNSCache) Update(obj *IstioObject)

func (*GatewayNSCache) UpdateGWVSMapping

func (v *GatewayNSCache) UpdateGWVSMapping(gwName string, vsList []string)

func (*GatewayNSCache) UpdateSecretGWRefs

func (v *GatewayNSCache) UpdateSecretGWRefs(obj *IstioObject)

type GatewayNameSpaceIntf

type GatewayNameSpaceIntf interface {
	Get(name string) (bool, *IstioObject)
	Update(obj IstioObject) bool
	List() map[string]*IstioObject
	Delete(name string) bool
}

type IstioDR

type IstioDR interface {
	DestinationRule(ns string) DRNameSpaceIntf
}

type IstioGateway

type IstioGateway interface {
	Gateway(ns string) GatewayNameSpaceIntf
}

type IstioObject

type IstioObject struct {
	ConfigMeta
	Spec proto.Message
}

This is a basic object that is used to store istio object information.

func Make

func Make(namespace string, name string, i int) *IstioObject

func MakeGateway

func MakeGateway(namespace string, name string, i int) *IstioObject

func MakeVirtualService

func MakeVirtualService(namespace string, name string, i int) *IstioObject

func NewIstioObject

func NewIstioObject(configMeta ConfigMeta, spec proto.Message) *IstioObject

type IstioVirtualService

type IstioVirtualService interface {
	VirtualService(ns string) VirtualServiceNameSpaceIntf
}

type ObjectMapStore

type ObjectMapStore struct {
	ObjectMap map[string]interface{}
	ObjLock   sync.RWMutex
}

func NewObjectMapStore

func NewObjectMapStore() *ObjectMapStore

func (*ObjectMapStore) AddOrUpdate

func (o *ObjectMapStore) AddOrUpdate(objName string, obj interface{})

func (*ObjectMapStore) Delete

func (o *ObjectMapStore) Delete(objName string) bool

func (*ObjectMapStore) Get

func (o *ObjectMapStore) Get(objName string) (bool, interface{})

func (*ObjectMapStore) GetAllObjectNames

func (o *ObjectMapStore) GetAllObjectNames() map[string]interface{}

type ObjectStore

type ObjectStore struct {
	NSObjectMap map[string]*ObjectMapStore
	NSLock      sync.RWMutex
}

func NewObjectStore

func NewObjectStore() *ObjectStore

func (*ObjectStore) DeleteNSStore

func (store *ObjectStore) DeleteNSStore(nsName string) bool

func (*ObjectStore) GetAllNamespaces

func (store *ObjectStore) GetAllNamespaces() []string

func (*ObjectStore) GetNSStore

func (store *ObjectStore) GetNSStore(nsName string) *ObjectMapStore

func (*ObjectStore) UpdateNSStore

func (store *ObjectStore) UpdateNSStore(obj *IstioObject) bool

type SecretLister

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

func SharedSecretLister

func SharedSecretLister() *SecretLister

func (*SecretLister) Secret

func (v *SecretLister) Secret(ns string) *SecretNSCache

type SecretNSCache

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

func (*SecretNSCache) DeleteSecretToGWMapping

func (v *SecretNSCache) DeleteSecretToGWMapping(secretName string) bool

func (*SecretNSCache) GetSecretToGW

func (v *SecretNSCache) GetSecretToGW(secretName string) (bool, []string)

func (*SecretNSCache) UpdateSecretToGwMapping

func (v *SecretNSCache) UpdateSecretToGwMapping(secretName string, gwList []string)

type SvcLister

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

func SharedSvcLister

func SharedSvcLister() *SvcLister

func (*SvcLister) Service

func (v *SvcLister) Service(ns string) *SvcNSCache

type SvcNSCache

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

func (*SvcNSCache) DeleteSvcToDRMapping

func (v *SvcNSCache) DeleteSvcToDRMapping(svcName string) bool

func (*SvcNSCache) DeleteSvcToVSMapping

func (v *SvcNSCache) DeleteSvcToVSMapping(svcName string) bool

func (*SvcNSCache) GetSvcToDR

func (v *SvcNSCache) GetSvcToDR(svcName string) (bool, []string)

func (*SvcNSCache) GetSvcToVS

func (v *SvcNSCache) GetSvcToVS(svcName string) (bool, []string)

func (*SvcNSCache) UpdateSvcToDR

func (v *SvcNSCache) UpdateSvcToDR(svcName string, drList []string)

func (*SvcNSCache) UpdateSvcToVSMapping

func (v *SvcNSCache) UpdateSvcToVSMapping(svcName string, vsList []string)

type VirtualServiceLister

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

func SharedVirtualServiceLister

func SharedVirtualServiceLister() *VirtualServiceLister

func (*VirtualServiceLister) GetAllVirtualServices

func (v *VirtualServiceLister) GetAllVirtualServices() map[string]map[string]string

func (*VirtualServiceLister) VirtualService

func (v *VirtualServiceLister) VirtualService(ns string) *VirtualServiceNSCache

type VirtualServiceNSCache

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

func (*VirtualServiceNSCache) Delete

func (v *VirtualServiceNSCache) Delete(name string) bool

func (*VirtualServiceNSCache) DeleteGwToVsRefs

func (v *VirtualServiceNSCache) DeleteGwToVsRefs(gwName string, vsName string)

func (*VirtualServiceNSCache) DeleteSvcToVs

func (v *VirtualServiceNSCache) DeleteSvcToVs(vsName string)

func (*VirtualServiceNSCache) DeleteVSToGw

func (v *VirtualServiceNSCache) DeleteVSToGw(vsName string)

func (*VirtualServiceNSCache) DeleteVSToSVC

func (v *VirtualServiceNSCache) DeleteVSToSVC(vsName string)

func (*VirtualServiceNSCache) Get

func (v *VirtualServiceNSCache) Get(name string) (bool, *IstioObject)

func (*VirtualServiceNSCache) GetAllVSNamesVers

func (v *VirtualServiceNSCache) GetAllVSNamesVers() map[string]string

func (*VirtualServiceNSCache) GetGatewayNamesForVS

func (v *VirtualServiceNSCache) GetGatewayNamesForVS(vs *IstioObject) []string

func (*VirtualServiceNSCache) GetGatewaysForVS

func (v *VirtualServiceNSCache) GetGatewaysForVS(vsName string) (bool, []string)

func (*VirtualServiceNSCache) GetServiceForVS

func (v *VirtualServiceNSCache) GetServiceForVS(vs *IstioObject) []string

func (*VirtualServiceNSCache) GetVSToSVC

func (v *VirtualServiceNSCache) GetVSToSVC(vsName string) []string

func (*VirtualServiceNSCache) List

func (v *VirtualServiceNSCache) List() map[string]*IstioObject

func (*VirtualServiceNSCache) Update

func (v *VirtualServiceNSCache) Update(obj *IstioObject)

func (*VirtualServiceNSCache) UpdateGatewayVsRefs

func (v *VirtualServiceNSCache) UpdateGatewayVsRefs(obj *IstioObject)

func (*VirtualServiceNSCache) UpdateSvcVSRefs

func (v *VirtualServiceNSCache) UpdateSvcVSRefs(obj *IstioObject)

type VirtualServiceNameSpaceIntf

type VirtualServiceNameSpaceIntf interface {
	Get(name string) (bool, *IstioObject)
	Update(obj *IstioObject) bool
	List() map[string]*IstioObject
	Delete(name string) bool
}

Jump to

Keyboard shortcuts

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