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.
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 )
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(incremental bool, collection, nonce string, errorCode codes.Code) *mcp.RequestResources
func MakeResources(incremental bool, collection, version, nonce string, removed []string, fakes ...*Fake) *mcp.Resources
type Fake struct { Resource *mcp.Resource Metadata *mcp.Metadata Proto proto.Message Collection string TypeURL string }
func NewFakeAuthChecker() *FakeAuthChecker
func (f *FakeAuthChecker) AuthType() string
func (f *FakeAuthChecker) Check(authInfo credentials.AuthInfo) error
type FakeType0 struct{ FakeTypeBase }
type FakeType1 struct{ FakeTypeBase }
type FakeType2 struct{ FakeTypeBase }
func (f *FakeTypeBase) Marshal() ([]byte, error)
func (f *FakeTypeBase) ProtoMessage()
func (f *FakeTypeBase) Reset()
func (f *FakeTypeBase) String() string
func (f *FakeTypeBase) Unmarshal(in []byte) error
type UnmarshalErrorType struct{ FakeTypeBase }
func (f *UnmarshalErrorType) Unmarshal(in []byte) error
Package test imports 9 packages (graph). Updated 2020-11-14. Refresh now. Tools for package owners.