...

Package util

import "github.com/linkerd/linkerd2/controller/api/util"
Overview
Index

Overview ▾

func BuildAddrSet

func BuildAddrSet(endpoint AuthorityEndpoints) *destinationPb.WeightedAddrSet

BuildAddrSet converts AuthorityEndpoints into its protobuf representation

type AuthorityEndpoints

AuthorityEndpoints holds the details for the Endpoints associated to an authority

type AuthorityEndpoints struct {
    Namespace string
    ServiceID string
    Pods      []PodDetails
}

type MockAPIClient

MockAPIClient satisfies the destination API's interfaces

type MockAPIClient struct {
    ErrorToReturn                error
    DestinationGetClientToReturn destinationPb.Destination_GetClient
}

func (*MockAPIClient) Get

func (c *MockAPIClient) Get(ctx context.Context, in *destinationPb.GetDestination, opts ...grpc.CallOption) (destinationPb.Destination_GetClient, error)

Get provides a mock of a destination API method.

func (*MockAPIClient) GetProfile

func (c *MockAPIClient) GetProfile(ctx context.Context, _ *destinationPb.GetDestination, _ ...grpc.CallOption) (destinationPb.Destination_GetProfileClient, error)

GetProfile provides a mock of a destination API method

type MockDestinationGetClient

MockDestinationGetClient satisfies the Destination_GetClient gRPC interface.

type MockDestinationGetClient struct {
    UpdatesToReturn []destinationPb.Update
    ErrorsToReturn  []error
    grpc.ClientStream
    sync.Mutex
}

func (*MockDestinationGetClient) Recv

func (a *MockDestinationGetClient) Recv() (*destinationPb.Update, error)

Recv satisfies the Destination_GetClient.Recv() gRPC method.

type MockServerStream

MockServerStream satisfies the grpc.ServerStream interface

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

func NewMockServerStream

func NewMockServerStream() MockServerStream

NewMockServerStream instantiates a MockServerStream

func (MockServerStream) Context

func (ms MockServerStream) Context() context.Context

func (MockServerStream) RecvMsg

func (ms MockServerStream) RecvMsg(m interface{}) error

func (MockServerStream) SendHeader

func (mss MockServerStream) SendHeader(metadata.MD) error

SendHeader satisfies the grpc.ServerStream interface

func (MockServerStream) SendMsg

func (ms MockServerStream) SendMsg(m interface{}) error

func (MockServerStream) SetHeader

func (mss MockServerStream) SetHeader(metadata.MD) error

SetHeader satisfies the grpc.ServerStream interface

func (MockServerStream) SetTrailer

func (mss MockServerStream) SetTrailer(metadata.MD)

SetTrailer satisfies the grpc.ServerStream interface

type PodDetails

PodDetails holds the details for pod associated to an Endpoint

type PodDetails struct {
    Name string
    IP   uint32
    Port uint32
}