github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/agent/structs/testing_service_definition.go (about)

     1  package structs
     2  
     3  import (
     4  	"github.com/mitchellh/go-testing-interface"
     5  )
     6  
     7  // TestServiceDefinition returns a ServiceDefinition for a typical service.
     8  func TestServiceDefinition(t testing.T) *ServiceDefinition {
     9  	return &ServiceDefinition{
    10  		Name: "db",
    11  		Port: 1234,
    12  	}
    13  }
    14  
    15  // TestServiceDefinitionProxy returns a ServiceDefinition for a proxy.
    16  func TestServiceDefinitionProxy(t testing.T) *ServiceDefinition {
    17  	return &ServiceDefinition{
    18  		Kind: ServiceKindConnectProxy,
    19  		Name: "foo-proxy",
    20  		Port: 1234,
    21  		Proxy: &ConnectProxyConfig{
    22  			DestinationServiceName: "db",
    23  		},
    24  	}
    25  }