configinfo

package
v0.0.0-...-32f485c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDiscoveryAPI

func IsDiscoveryAPI(operationName string) bool

Types

type BackendRoutingCluster

type BackendRoutingCluster struct {
	// TODO(nareddyt): Fix immutability, this var is updated by consumers
	ClusterName string
	Hostname    string
	Port        uint32
	UseTLS      bool
	Protocol    util.BackendProtocol
}

type MethodInfo

type MethodInfo struct {
	ShortName              string
	ApiName                string
	ApiVersion             string
	HttpRule               []*httppattern.Pattern
	BackendInfo            *backendInfo
	HttpBackendInfo        *backendInfo
	AllowUnregisteredCalls bool
	// Method that is generated by ESPv2.
	IsGenerated        bool
	SkipServiceControl bool
	RequireAuth        bool
	ApiKeyLocations    []*scpb.ApiKeyLocation
	MetricCosts        []*scpb.MetricCost
	// All non-unary gRPC methods are considered streaming.
	IsStreaming bool

	// The request type name (not the entire type URL).
	RequestTypeName string

	// The auto-generated cors methods, used to replace snakeName with jsonName in their
	// url templates in config time.
	GeneratedCorsMethod *MethodInfo
}

MethodInfo contains all information about this method.

func (*MethodInfo) GRPCPath

func (m *MethodInfo) GRPCPath() string

func (*MethodInfo) IsGRPCPath

func (m *MethodInfo) IsGRPCPath(path string) bool

func (*MethodInfo) Operation

func (m *MethodInfo) Operation() string

type ServiceInfo

type ServiceInfo struct {
	Name     string
	ConfigID string

	// An array to store all the api names
	ApiNames []string

	// A ordered slice of operation names. Follows the same order as the `apis.methods` in service config.
	// All functions that output order-dependent configs should use this ordering.
	//
	// Ordering is important for Envoy route matching and testability.
	// Envoy's router matches linearly with first-to-win. When wildcard routes are introduced,
	// they must show up last as a fallback route. Otherwise we may match a less-specific route,
	// resulting in an incorrect host rewrite.
	Operations []string

	// Stores all methods info for this service, using selector as key.
	Methods map[string]*MethodInfo

	// Stores all the query parameters to be ignored for json-grpc transcoder.
	AllTranscodingIgnoredQueryParams map[string]bool

	AllowCors         bool
	ServiceControlURI url.URL
	// TODO(nareddyt): Fix immutability, this var is updated by consumers
	GcpAttributes *scpb.GcpAttributes

	AccessToken *commonpb.AccessToken
	// TODO(nareddyt): Fix immutability, this var is updated by consumers
	Options options.ConfigGeneratorOptions

	// Stores information about all backend clusters.
	GrpcSupportRequired   bool
	LocalBackendCluster   *BackendRoutingCluster
	RemoteBackendClusters []*BackendRoutingCluster
	// contains filtered or unexported fields
}

ServiceInfo contains service level information.

TODO(b/288170480): Remove file and clean up all doc references.

func NewServiceInfoFromServiceConfig

func NewServiceInfoFromServiceConfig(serviceConfig *confpb.Service, opts options.ConfigGeneratorOptions) (*ServiceInfo, error)

NewServiceInfoFromServiceConfig returns an instance of ServiceInfo.

func (*ServiceInfo) LocalBackendClusterName

func (s *ServiceInfo) LocalBackendClusterName() string

func (*ServiceInfo) ServiceConfig

func (s *ServiceInfo) ServiceConfig() *confpb.Service

Returns the pointer of the ServiceConfig that this API belongs to.

type SnakeToJsonSegments

type SnakeToJsonSegments = map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL