istio: istio.io/istio/pkg/mcp/internal/test Index | Files

package test

import "istio.io/istio/pkg/mcp/internal/test"

Copyright Istio Authors

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

Package Files

auth_checker.go types.go

Constants

const (
    TypePrefix                = "type.googleapis.com/"
    FakeType0MessageName      = "istio.io.galley.pkg.mcp.server.FakeType0"
    FakeType1MessageName      = "istio.io.galley.pkg.mcp.server.FakeType1"
    FakeType2MessageName      = "istio.io.galley.pkg.mcp.server.FakeType2"
    UnmarshalErrorMessageName = "istio.io.galley.pkg.mcp.server.UnmarshalErrorType"

    FakeType0TypeURL      = TypePrefix + FakeType0MessageName
    FakeType1TypeURL      = TypePrefix + FakeType1MessageName
    FakeType2TypeURL      = TypePrefix + FakeType2MessageName
    UnmarshalErrorTypeURL = TypePrefix + UnmarshalErrorMessageName
)

Variables

var (
    FakeType0Collection      = strings.Replace(FakeType0MessageName, ".", "/", -1)
    FakeType1Collection      = strings.Replace(FakeType1MessageName, ".", "/", -1)
    FakeType2Collection      = strings.Replace(FakeType2MessageName, ".", "/", -1)
    UnmarshalErrorCollection = strings.Replace(UnmarshalErrorMessageName, ".", "/", -1)
)
var (
    Type0A = []*Fake{}
    Type0B = []*Fake{}
    Type0C = []*Fake{}
    Type1A = []*Fake{}
    Type2A = []*Fake{}

    BadUnmarshal = MakeFakeResource(UnmarshalErrorCollection, UnmarshalErrorTypeURL, "v0", "bad", "data")

    SupportedCollections = []string{
        FakeType0Collection,
        FakeType1Collection,
        FakeType2Collection,
    }

    NodeID = "test-node"
    Node   = &mcp.SinkNode{
        Id: NodeID,
        Annotations: map[string]string{
            "foo": "bar",
        },
    }
    NodeMetadata = map[string]string{"foo": "bar"}
)

func MakeRequest Uses

func MakeRequest(incremental bool, collection, nonce string, errorCode codes.Code) *mcp.RequestResources

func MakeResources Uses

func MakeResources(incremental bool, collection, version, nonce string, removed []string, fakes ...*Fake) *mcp.Resources

type Fake Uses

type Fake struct {
    Resource   *mcp.Resource
    Metadata   *mcp.Metadata
    Proto      proto.Message
    Collection string
    TypeURL    string
}

func MakeFakeResource Uses

func MakeFakeResource(collection, typeURL, version, name, data string) *Fake

type FakeAuthChecker Uses

type FakeAuthChecker struct {
    AllowError error
}

func NewFakeAuthChecker Uses

func NewFakeAuthChecker() *FakeAuthChecker

func (*FakeAuthChecker) AuthType Uses

func (f *FakeAuthChecker) AuthType() string

func (*FakeAuthChecker) Check Uses

func (f *FakeAuthChecker) Check(authInfo credentials.AuthInfo) error

type FakeType0 Uses

type FakeType0 struct{ FakeTypeBase }

type FakeType1 Uses

type FakeType1 struct{ FakeTypeBase }

type FakeType2 Uses

type FakeType2 struct{ FakeTypeBase }

type FakeTypeBase Uses

type FakeTypeBase struct{ Info string }

func (*FakeTypeBase) Marshal Uses

func (f *FakeTypeBase) Marshal() ([]byte, error)

func (*FakeTypeBase) ProtoMessage Uses

func (f *FakeTypeBase) ProtoMessage()

func (*FakeTypeBase) Reset Uses

func (f *FakeTypeBase) Reset()

func (*FakeTypeBase) String Uses

func (f *FakeTypeBase) String() string

func (*FakeTypeBase) Unmarshal Uses

func (f *FakeTypeBase) Unmarshal(in []byte) error

type UnmarshalErrorType Uses

type UnmarshalErrorType struct{ FakeTypeBase }

func (*UnmarshalErrorType) Unmarshal Uses

func (f *UnmarshalErrorType) Unmarshal(in []byte) error

Package test imports 9 packages (graph). Updated 2020-11-14. Refresh now. Tools for package owners.