istio: istio.io/istio/pilot/pkg/serviceregistry/memory Index | Files

package memory

import "istio.io/istio/pilot/pkg/serviceregistry/memory"

Index

Package Files

discovery.go discovery_mock.go

Variables

var (
    // HelloService is a mock service with `hello.default.svc.cluster.local` as
    // a hostname and `10.1.0.0` for ip
    HelloService = MakeService("hello.default.svc.cluster.local", "10.1.0.0")

    // WorldService is a mock service with `world.default.svc.cluster.local` as
    // a hostname and `10.2.0.0` for ip
    WorldService = MakeService("world.default.svc.cluster.local", "10.2.0.0")

    // ExtHTTPService is a mock external HTTP service
    ExtHTTPService = MakeExternalHTTPService("httpbin.default.svc.cluster.local",
        true, "")

    // ExtHTTPSService is a mock external HTTPS service
    ExtHTTPSService = MakeExternalHTTPSService("httpsbin.default.svc.cluster.local",
        true, "")

    // HelloInstanceV0 is a mock IP address for v0 of HelloService
    HelloInstanceV0 = MakeIP(HelloService, 0)

    // HelloProxyV0 is a mock proxy v0 of HelloService
    HelloProxyV0 = model.Proxy{
        Type:         model.SidecarProxy,
        IPAddresses:  []string{HelloInstanceV0},
        ID:           "v0.default",
        DNSDomain:    "default.svc.cluster.local",
        IstioVersion: model.MaxIstioVersion,
        Metadata:     &model.NodeMetadata{},
    }

    // MockDiscovery is an in-memory ServiceDiscover with mock services
    MockDiscovery = &ServiceDiscovery{
        services: map[host.Name]*model.Service{
            HelloService.Hostname:   HelloService,
            WorldService.Hostname:   WorldService,
            ExtHTTPService.Hostname: ExtHTTPService,

            ExtHTTPSService.Hostname: ExtHTTPSService,
        },
        versions: 2,
    }
)
var (
    // PortHTTPName is the HTTP port name
    PortHTTPName = "http"
)

func MakeExternalHTTPSService Uses

func MakeExternalHTTPSService(hostname host.Name, isMeshExternal bool, address string) *model.Service

MakeExternalHTTPSService creates memory external service

func MakeExternalHTTPService Uses

func MakeExternalHTTPService(hostname host.Name, isMeshExternal bool, address string) *model.Service

MakeExternalHTTPService creates memory external service

func MakeIP Uses

func MakeIP(service *model.Service, version int) string

MakeIP creates a fake IP address for a service and instance version

func MakeInstance Uses

func MakeInstance(service *model.Service, port *model.Port, version int, az string) *model.ServiceInstance

MakeInstance creates a memory instance, version enumerates endpoints

func MakeService Uses

func MakeService(hostname host.Name, address string) *model.Service

MakeService creates a memory service

type ServiceDiscovery Uses

type ServiceDiscovery struct {
    WantGetProxyServiceInstances  []*model.ServiceInstance
    ServicesError                 error
    GetServiceError               error
    InstancesError                error
    GetProxyServiceInstancesError error
    // contains filtered or unexported fields
}

ServiceDiscovery is a memory discovery interface

func NewDiscovery Uses

func NewDiscovery(services map[host.Name]*model.Service, versions int) *ServiceDiscovery

NewDiscovery builds a memory ServiceDiscovery

func (*ServiceDiscovery) AddService Uses

func (sd *ServiceDiscovery) AddService(name host.Name, svc *model.Service)

AddService will add to the registry the provided service

func (*ServiceDiscovery) ClearErrors Uses

func (sd *ServiceDiscovery) ClearErrors()

ClearErrors clear errors used for failures during model.ServiceDiscovery interface methods

func (*ServiceDiscovery) GetIstioServiceAccounts Uses

func (sd *ServiceDiscovery) GetIstioServiceAccounts(svc *model.Service, ports []int) []string

GetIstioServiceAccounts gets the Istio service accounts for a service hostname.

func (*ServiceDiscovery) GetProxyServiceInstances Uses

func (sd *ServiceDiscovery) GetProxyServiceInstances(node *model.Proxy) ([]*model.ServiceInstance, error)

GetProxyServiceInstances implements discovery interface

func (*ServiceDiscovery) GetProxyWorkloadLabels Uses

func (sd *ServiceDiscovery) GetProxyWorkloadLabels(proxy *model.Proxy) (labels.Collection, error)

func (*ServiceDiscovery) GetService Uses

func (sd *ServiceDiscovery) GetService(hostname host.Name) (*model.Service, error)

GetService implements discovery interface

func (*ServiceDiscovery) InstancesByPort Uses

func (sd *ServiceDiscovery) InstancesByPort(svc *model.Service, num int,
    labels labels.Collection) ([]*model.ServiceInstance, error)

InstancesByPort implements discovery interface

func (*ServiceDiscovery) ManagementPorts Uses

func (sd *ServiceDiscovery) ManagementPorts(addr string) model.PortList

ManagementPorts implements discovery interface

func (*ServiceDiscovery) Services Uses

func (sd *ServiceDiscovery) Services() ([]*model.Service, error)

Services implements discovery interface

func (*ServiceDiscovery) WorkloadHealthCheckInfo Uses

func (sd *ServiceDiscovery) WorkloadHealthCheckInfo(addr string) model.ProbeList

WorkloadHealthCheckInfo implements discovery interface

Package memory imports 8 packages (graph) and is imported by 2 packages. Updated 2019-09-27. Refresh now. Tools for package owners.