...

Source file src/github.com/datawire/ambassador/v2/pkg/gateway/helpers_test.go

Documentation: github.com/datawire/ambassador/v2/pkg/gateway

     1  package gateway_test
     2  
     3  import (
     4  	"github.com/datawire/ambassador/v2/pkg/kates"
     5  	"k8s.io/apimachinery/pkg/runtime"
     6  )
     7  
     8  // makeFoo, Foo, and FooSpec are all helpers for quickly/easily creating dummy resources for testing
     9  // purposes.
    10  func makeFoo(namespace, name, value string) *Foo {
    11  	return &Foo{
    12  		TypeMeta:   kates.TypeMeta{Kind: "Foo"},
    13  		ObjectMeta: kates.ObjectMeta{Namespace: namespace, Name: name},
    14  		Spec: FooSpec{
    15  			Value: value,
    16  		},
    17  	}
    18  }
    19  
    20  type Foo struct {
    21  	kates.TypeMeta
    22  	kates.ObjectMeta
    23  	Spec FooSpec
    24  }
    25  
    26  type FooSpec struct {
    27  	Value    string
    28  	PanicArg error
    29  }
    30  
    31  func (f *Foo) DeepCopyObject() runtime.Object {
    32  	return nil
    33  }
    34  

View as plain text